diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 10:51:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 10:51:20 +0100 |
commit | 74864d560b9293174c82fdee2b9d15991ebf075f (patch) | |
tree | f76a250431629a36d225d456ed41f393aaa9a579 /crates/ra_hir_def | |
parent | 72ffd851dd5b0fcdf3aa072131ba11009878b4ae (diff) | |
parent | 7d09e5ed618b9b9d6e00b57b24db0b9c8a8c12d7 (diff) |
Merge #5582
5582: Finish Module grammar r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/item_tree/lower.rs | 19 |
1 files changed, 9 insertions, 10 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..4fc21a642 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)?; |