aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/item_tree/lower.rs21
-rw-r--r--crates/ra_hir_def/src/path/lower/lower_use.rs2
2 files changed, 11 insertions, 12 deletions
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index eb1da4632..6c58c6378 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -153,13 +153,12 @@ impl Ctx {
153 self.forced_visibility = forced_vis; 153 self.forced_visibility = forced_vis;
154 } 154 }
155 155
156 fn lower_assoc_item(&mut self, item: &ast::Item) -> Option<AssocItem> { 156 fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> {
157 match item { 157 match item {
158 ast::Item::FnDef(ast) => self.lower_function(ast).map(Into::into), 158 ast::AssocItem::FnDef(ast) => self.lower_function(ast).map(Into::into),
159 ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), 159 ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into),
160 ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), 160 ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()),
161 ast::Item::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), 161 ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into),
162 _ => None,
163 } 162 }
164 } 163 }
165 164
@@ -419,9 +418,9 @@ impl Ctx {
419 let generic_params = 418 let generic_params =
420 self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def); 419 self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def);
421 let auto = trait_def.auto_token().is_some(); 420 let auto = trait_def.auto_token().is_some();
422 let items = trait_def.item_list().map(|list| { 421 let items = trait_def.assoc_item_list().map(|list| {
423 self.with_inherited_visibility(visibility, |this| { 422 self.with_inherited_visibility(visibility, |this| {
424 list.items() 423 list.assoc_items()
425 .filter_map(|item| { 424 .filter_map(|item| {
426 let attrs = Attrs::new(&item, &this.hygiene); 425 let attrs = Attrs::new(&item, &this.hygiene);
427 this.collect_inner_items(item.syntax()); 426 this.collect_inner_items(item.syntax());
@@ -454,9 +453,9 @@ impl Ctx {
454 453
455 // We cannot use `assoc_items()` here as that does not include macro calls. 454 // We cannot use `assoc_items()` here as that does not include macro calls.
456 let items = impl_def 455 let items = impl_def
457 .item_list() 456 .assoc_item_list()
458 .into_iter() 457 .into_iter()
459 .flat_map(|it| it.items()) 458 .flat_map(|it| it.assoc_items())
460 .filter_map(|item| { 459 .filter_map(|item| {
461 self.collect_inner_items(item.syntax()); 460 self.collect_inner_items(item.syntax());
462 let assoc = self.lower_assoc_item(&item)?; 461 let assoc = self.lower_assoc_item(&item)?;
@@ -502,7 +501,7 @@ impl Ctx {
502 extern_crate: &ast::ExternCrateItem, 501 extern_crate: &ast::ExternCrateItem,
503 ) -> Option<FileItemTreeId<ExternCrate>> { 502 ) -> Option<FileItemTreeId<ExternCrate>> {
504 let path = ModPath::from_name_ref(&extern_crate.name_ref()?); 503 let path = ModPath::from_name_ref(&extern_crate.name_ref()?);
505 let alias = extern_crate.alias().map(|a| { 504 let alias = extern_crate.rename().map(|a| {
506 a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) 505 a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias)
507 }); 506 });
508 let visibility = self.lower_visibility(extern_crate); 507 let visibility = self.lower_visibility(extern_crate);
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs
index 7cc655487..794be45e8 100644
--- a/crates/ra_hir_def/src/path/lower/lower_use.rs
+++ b/crates/ra_hir_def/src/path/lower/lower_use.rs
@@ -31,7 +31,7 @@ pub(crate) fn lower_use_tree(
31 lower_use_tree(prefix.clone(), child_tree, hygiene, cb); 31 lower_use_tree(prefix.clone(), child_tree, hygiene, cb);
32 } 32 }
33 } else { 33 } else {
34 let alias = tree.alias().map(|a| { 34 let alias = tree.rename().map(|a| {
35 a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) 35 a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias)
36 }); 36 });
37 let is_glob = tree.star_token().is_some(); 37 let is_glob = tree.star_token().is_some();