Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e9b128

Browse files
committed
fix: check pseudo-block by local_id instead of ModuleOrigin
1 parent719eee2 commit4e9b128

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎src/tools/rust-analyzer/crates/hir-def/src/nameres/path_resolution.rs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ use crate::{
1818
db::DefDatabase,
1919
item_scope::{ImportOrExternCrate,BUILTIN_SCOPE},
2020
item_tree::Fields,
21-
nameres::{
22-
sub_namespace_match,BlockInfo,BuiltinShadowMode,DefMap,MacroSubNs,ModuleOrigin,
23-
},
21+
nameres::{sub_namespace_match,BlockInfo,BuiltinShadowMode,DefMap,MacroSubNs},
2422
path::{ModPath,PathKind},
2523
per_ns::PerNs,
2624
visibility::{RawVisibility,Visibility},
@@ -472,7 +470,7 @@ impl DefMap {
472470
};
473471

474472
let extern_prelude = ||{
475-
ifmatches!(self[module].origin,ModuleOrigin::BlockExpr{ ..}){
473+
ifself.block.is_some() && module ==DefMap::ROOT{
476474
// Don't resolve extern prelude in pseudo-modules of blocks, because
477475
// they might been shadowed by local names.
478476
returnPerNs::none();
@@ -518,7 +516,7 @@ impl DefMap {
518516
None =>self[Self::ROOT].scope.get(name),
519517
};
520518
let from_extern_prelude = ||{
521-
ifmatches!(self[module].origin,ModuleOrigin::BlockExpr{ ..}){
519+
ifself.block.is_some() && module ==DefMap::ROOT{
522520
// Don't resolve extern prelude in pseudo-module of a block.
523521
returnPerNs::none();
524522
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp