aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/lower.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-03 22:23:22 +0000
committerFlorian Diebold <[email protected]>2019-02-04 20:49:34 +0000
commit1056b480d6235ee72849a416b84e13180f84307c (patch)
tree7c9cf6822357bff4bd4d2055f464bf9991c8e4a4 /crates/ra_hir/src/nameres/lower.rs
parentd69023fc72b26e64ebf1f96fc322a2f7377a5f4d (diff)
Make extern crates in the root module add to the extern prelude
To accomplish this, separate the extern prelude from the per-module item maps.
Diffstat (limited to 'crates/ra_hir/src/nameres/lower.rs')
-rw-r--r--crates/ra_hir/src/nameres/lower.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs
index db898a782..7e6e48ae0 100644
--- a/crates/ra_hir/src/nameres/lower.rs
+++ b/crates/ra_hir/src/nameres/lower.rs
@@ -23,6 +23,7 @@ pub(super) struct ImportData {
23 pub(super) path: Path, 23 pub(super) path: Path,
24 pub(super) alias: Option<Name>, 24 pub(super) alias: Option<Name>,
25 pub(super) is_glob: bool, 25 pub(super) is_glob: bool,
26 pub(super) is_extern_crate: bool,
26} 27}
27 28
28/// A set of items and imports declared inside a module, without relation to 29/// A set of items and imports declared inside a module, without relation to
@@ -199,6 +200,7 @@ impl LoweredModule {
199 path, 200 path,
200 alias, 201 alias,
201 is_glob: false, 202 is_glob: false,
203 is_extern_crate: true,
202 }); 204 });
203 } 205 }
204 } 206 }
@@ -228,6 +230,7 @@ impl LoweredModule {
228 path, 230 path,
229 alias, 231 alias,
230 is_glob: segment.is_none(), 232 is_glob: segment.is_none(),
233 is_extern_crate: false,
231 }); 234 });
232 if let Some(segment) = segment { 235 if let Some(segment) = segment {
233 source_map.insert(import, segment) 236 source_map.insert(import, segment)