diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 17:17:28 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 17:17:28 +0100 |
commit | c83467796b6c7365ea4f41900d74444384a9e618 (patch) | |
tree | 6eb770e4c9751813cc0530e7c645fed8914eed12 /crates/ra_hir_def/src/item_tree/lower.rs | |
parent | b2cdb0b22631a66a00be25ba4b2e9c0b34ff426a (diff) |
Finalize Trait grammar
Diffstat (limited to 'crates/ra_hir_def/src/item_tree/lower.rs')
-rw-r--r-- | crates/ra_hir_def/src/item_tree/lower.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index a94548e5d..aaf3cfd3a 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -95,7 +95,7 @@ impl Ctx { | |||
95 | 95 | ||
96 | // These are handled in their respective `lower_X` method (since we can't just blindly | 96 | // These are handled in their respective `lower_X` method (since we can't just blindly |
97 | // walk them). | 97 | // walk them). |
98 | ast::Item::TraitDef(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {} | 98 | ast::Item::Trait(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {} |
99 | 99 | ||
100 | // These don't have inner items. | 100 | // These don't have inner items. |
101 | ast::Item::Module(_) | ast::Item::ExternCrate(_) | ast::Item::Use(_) => {} | 101 | ast::Item::Module(_) | ast::Item::ExternCrate(_) | ast::Item::Use(_) => {} |
@@ -111,7 +111,7 @@ impl Ctx { | |||
111 | ast::Item::Static(ast) => self.lower_static(ast).map(Into::into), | 111 | ast::Item::Static(ast) => self.lower_static(ast).map(Into::into), |
112 | ast::Item::Const(ast) => Some(self.lower_const(ast).into()), | 112 | ast::Item::Const(ast) => Some(self.lower_const(ast).into()), |
113 | ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), | 113 | ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), |
114 | ast::Item::TraitDef(ast) => self.lower_trait(ast).map(Into::into), | 114 | ast::Item::Trait(ast) => self.lower_trait(ast).map(Into::into), |
115 | ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into), | 115 | ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into), |
116 | ast::Item::Use(ast) => Some(ModItems( | 116 | ast::Item::Use(ast) => Some(ModItems( |
117 | self.lower_use(ast).into_iter().map(Into::into).collect::<SmallVec<_>>(), | 117 | self.lower_use(ast).into_iter().map(Into::into).collect::<SmallVec<_>>(), |
@@ -413,7 +413,7 @@ impl Ctx { | |||
413 | Some(id(self.data().mods.alloc(res))) | 413 | Some(id(self.data().mods.alloc(res))) |
414 | } | 414 | } |
415 | 415 | ||
416 | fn lower_trait(&mut self, trait_def: &ast::TraitDef) -> Option<FileItemTreeId<Trait>> { | 416 | fn lower_trait(&mut self, trait_def: &ast::Trait) -> Option<FileItemTreeId<Trait>> { |
417 | let name = trait_def.name()?.as_name(); | 417 | let name = trait_def.name()?.as_name(); |
418 | let visibility = self.lower_visibility(trait_def); | 418 | let visibility = self.lower_visibility(trait_def); |
419 | let generic_params = | 419 | let generic_params = |
@@ -698,7 +698,7 @@ enum GenericsOwner<'a> { | |||
698 | Enum, | 698 | Enum, |
699 | Union, | 699 | Union, |
700 | /// The `TraitDef` is needed to fill the source map for the implicit `Self` parameter. | 700 | /// The `TraitDef` is needed to fill the source map for the implicit `Self` parameter. |
701 | Trait(&'a ast::TraitDef), | 701 | Trait(&'a ast::Trait), |
702 | TypeAlias, | 702 | TypeAlias, |
703 | Impl, | 703 | Impl, |
704 | } | 704 | } |