aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/has_source.rs4
-rw-r--r--crates/ra_hir/src/semantics.rs2
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs9
3 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs
index f32b8cbb9..1557b7c83 100644
--- a/crates/ra_hir/src/has_source.rs
+++ b/crates/ra_hir/src/has_source.rs
@@ -105,8 +105,8 @@ impl HasSource for Trait {
105 } 105 }
106} 106}
107impl HasSource for TypeAlias { 107impl HasSource for TypeAlias {
108 type Ast = ast::TypeAliasDef; 108 type Ast = ast::TypeAlias;
109 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAliasDef> { 109 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAlias> {
110 self.id.lookup(db.upcast()).source(db.upcast()) 110 self.id.lookup(db.upcast()).source(db.upcast())
111 } 111 }
112} 112}
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 0b634f23e..054405966 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -582,7 +582,7 @@ to_def_impls![
582 (crate::Union, ast::UnionDef, union_to_def), 582 (crate::Union, ast::UnionDef, union_to_def),
583 (crate::Trait, ast::TraitDef, trait_to_def), 583 (crate::Trait, ast::TraitDef, trait_to_def),
584 (crate::ImplDef, ast::ImplDef, impl_to_def), 584 (crate::ImplDef, ast::ImplDef, impl_to_def),
585 (crate::TypeAlias, ast::TypeAliasDef, type_alias_to_def), 585 (crate::TypeAlias, ast::TypeAlias, type_alias_to_def),
586 (crate::Const, ast::ConstDef, const_to_def), 586 (crate::Const, ast::ConstDef, const_to_def),
587 (crate::Static, ast::StaticDef, static_to_def), 587 (crate::Static, ast::StaticDef, static_to_def),
588 (crate::Function, ast::Fn, fn_to_def), 588 (crate::Function, ast::Fn, fn_to_def),
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 }