diff options
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/nameres/path_resolution.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/hir_def/src/nameres/path_resolution.rs b/crates/hir_def/src/nameres/path_resolution.rs index 60471937c..a9cf651d2 100644 --- a/crates/hir_def/src/nameres/path_resolution.rs +++ b/crates/hir_def/src/nameres/path_resolution.rs | |||
@@ -384,15 +384,10 @@ impl DefMap { | |||
384 | } | 384 | } |
385 | } | 385 | } |
386 | }; | 386 | }; |
387 | // Give precedence to names in outer `DefMap`s over the extern prelude; only check prelude | 387 | let from_extern_prelude = self |
388 | // from the crate DefMap. | 388 | .extern_prelude |
389 | let from_extern_prelude = match self.block { | 389 | .get(name) |
390 | Some(_) => PerNs::none(), | 390 | .map_or(PerNs::none(), |&it| PerNs::types(it, Visibility::Public)); |
391 | None => self | ||
392 | .extern_prelude | ||
393 | .get(name) | ||
394 | .map_or(PerNs::none(), |&it| PerNs::types(it, Visibility::Public)), | ||
395 | }; | ||
396 | 391 | ||
397 | let from_prelude = self.resolve_in_prelude(db, name); | 392 | let from_prelude = self.resolve_in_prelude(db, name); |
398 | 393 | ||