diff options
author | Jonas Schievink <[email protected]> | 2021-04-09 13:46:52 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-09 13:46:52 +0100 |
commit | 4ea5f690bc2692699208999f46a85a9872cbfc73 (patch) | |
tree | f0437e6259652d32a858237edd32f5430f644084 | |
parent | 99ed68a109c9f7e0dc6a82ccb5bf854d60943957 (diff) |
Undo path resolution hack for extern prelude
We don't populate the extern prelude for block DefMaps anymore,
so this is unnecessary
-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 | ||