diff options
Diffstat (limited to 'crates/ra_hir/src/semantics')
-rw-r--r-- | crates/ra_hir/src/semantics/source_to_def.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 4118de2e2..d23a1974b 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs | |||
@@ -89,10 +89,7 @@ impl SourceToDefCtx<'_, '_> { | |||
89 | pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> { | 89 | pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> { |
90 | self.to_def(src, keys::CONST) | 90 | self.to_def(src, keys::CONST) |
91 | } | 91 | } |
92 | pub(super) fn type_alias_to_def( | 92 | pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> { |
93 | &mut self, | ||
94 | src: InFile<ast::TypeAliasDef>, | ||
95 | ) -> Option<TypeAliasId> { | ||
96 | self.to_def(src, keys::TYPE_ALIAS) | 93 | self.to_def(src, keys::TYPE_ALIAS) |
97 | } | 94 | } |
98 | pub(super) fn record_field_to_def( | 95 | pub(super) fn record_field_to_def( |
@@ -195,7 +192,7 @@ impl SourceToDefCtx<'_, '_> { | |||
195 | let def = self.const_to_def(container.with_value(it))?; | 192 | let def = self.const_to_def(container.with_value(it))?; |
196 | DefWithBodyId::from(def).into() | 193 | DefWithBodyId::from(def).into() |
197 | }, | 194 | }, |
198 | ast::TypeAliasDef(it) => { | 195 | ast::TypeAlias(it) => { |
199 | let def = self.type_alias_to_def(container.with_value(it))?; | 196 | let def = self.type_alias_to_def(container.with_value(it))?; |
200 | def.into() | 197 | def.into() |
201 | }, | 198 | }, |
@@ -217,7 +214,7 @@ impl SourceToDefCtx<'_, '_> { | |||
217 | ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), | 214 | ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), |
218 | ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), | 215 | ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), |
219 | ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), | 216 | ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), |
220 | ast::TypeAliasDef(it) => self.type_alias_to_def(container.with_value(it))?.into(), | 217 | ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), |
221 | ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), | 218 | ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), |
222 | _ => continue, | 219 | _ => continue, |
223 | } | 220 | } |