diff options
author | Florian Diebold <[email protected]> | 2019-02-01 23:18:10 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-01 23:23:53 +0000 |
commit | 5a7fce4e4cd8846a49ce007910f72340007d9c8c (patch) | |
tree | 7ec654f142d821e5ad5f9347bb84367fef0943d6 /crates/ra_hir/src/nameres | |
parent | aa5f6a1ee8b56343e9f3dc9b1578d56f29dd2bc8 (diff) |
Pass aliases to ImportData
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r-- | crates/ra_hir/src/nameres/lower.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 9a45fa61c..df87f520f 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs | |||
@@ -21,6 +21,7 @@ impl_arena_id!(ImportId); | |||
21 | #[derive(Debug, PartialEq, Eq)] | 21 | #[derive(Debug, PartialEq, Eq)] |
22 | pub(super) struct ImportData { | 22 | pub(super) struct ImportData { |
23 | pub(super) path: Path, | 23 | pub(super) path: Path, |
24 | pub(super) alias: Option<Name>, | ||
24 | pub(super) is_glob: bool, | 25 | pub(super) is_glob: bool, |
25 | } | 26 | } |
26 | 27 | ||
@@ -209,9 +210,10 @@ impl LoweredModule { | |||
209 | } | 210 | } |
210 | 211 | ||
211 | fn add_use_item(&mut self, source_map: &mut ImportSourceMap, item: &ast::UseItem) { | 212 | fn add_use_item(&mut self, source_map: &mut ImportSourceMap, item: &ast::UseItem) { |
212 | Path::expand_use_item(item, |path, segment| { | 213 | Path::expand_use_item(item, |path, segment, alias| { |
213 | let import = self.imports.alloc(ImportData { | 214 | let import = self.imports.alloc(ImportData { |
214 | path, | 215 | path, |
216 | alias, | ||
215 | is_glob: segment.is_none(), | 217 | is_glob: segment.is_none(), |
216 | }); | 218 | }); |
217 | if let Some(segment) = segment { | 219 | if let Some(segment) = segment { |