diff options
Diffstat (limited to 'crates/hir_def/src/nameres/collector.rs')
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index 6e86cc4a7..6bd41bc08 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -655,7 +655,7 @@ impl DefCollector<'_> { | |||
655 | } | 655 | } |
656 | } | 656 | } |
657 | } else { | 657 | } else { |
658 | match import.path.segments.last() { | 658 | match import.path.segments().last() { |
659 | Some(last_segment) => { | 659 | Some(last_segment) => { |
660 | let name = match &import.alias { | 660 | let name = match &import.alias { |
661 | Some(ImportAlias::Alias(name)) => Some(name.clone()), | 661 | Some(ImportAlias::Alias(name)) => Some(name.clone()), |
@@ -956,7 +956,7 @@ impl DefCollector<'_> { | |||
956 | let item_tree = self.db.item_tree(import.file_id); | 956 | let item_tree = self.db.item_tree(import.file_id); |
957 | let import_data = &item_tree[import.value]; | 957 | let import_data = &item_tree[import.value]; |
958 | 958 | ||
959 | match (import_data.path.segments.first(), &import_data.path.kind) { | 959 | match (import_data.path.segments().first(), &import_data.path.kind) { |
960 | (Some(krate), PathKind::Plain) | (Some(krate), PathKind::Abs) => { | 960 | (Some(krate), PathKind::Plain) | (Some(krate), PathKind::Abs) => { |
961 | if diagnosed_extern_crates.contains(krate) { | 961 | if diagnosed_extern_crates.contains(krate) { |
962 | continue; | 962 | continue; |
@@ -1449,10 +1449,11 @@ impl ModCollector<'_, '_> { | |||
1449 | if let Some(macro_call_id) = | 1449 | if let Some(macro_call_id) = |
1450 | ast_id.as_call_id(self.def_collector.db, self.def_collector.def_map.krate, |path| { | 1450 | ast_id.as_call_id(self.def_collector.db, self.def_collector.def_map.krate, |path| { |
1451 | path.as_ident().and_then(|name| { | 1451 | path.as_ident().and_then(|name| { |
1452 | self.def_collector | 1452 | self.def_collector.def_map.with_ancestor_maps( |
1453 | .def_map | 1453 | self.def_collector.db, |
1454 | .ancestor_maps(self.module_id) | 1454 | self.module_id, |
1455 | .find_map(|(map, module)| map[module].scope.get_legacy_macro(&name)) | 1455 | &mut |map, module| map[module].scope.get_legacy_macro(&name), |
1456 | ) | ||
1456 | }) | 1457 | }) |
1457 | }) | 1458 | }) |
1458 | { | 1459 | { |