aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/semantics
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-30 17:02:20 +0100
committerAleksey Kladov <[email protected]>2020-07-30 17:02:20 +0100
commit3cd4112bdc924c132cb0eab9d064511a215421ec (patch)
treef651b475d9c799a772fd37e89405f80a04ea953e /crates/ra_hir/src/semantics
parent6b25f640a6ad8e2322b5cc0664223b742459336d (diff)
Finalize const&static grammar
Diffstat (limited to 'crates/ra_hir/src/semantics')
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs12
1 files changed, 6 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 b85a12680..782a03f9e 100644
--- a/crates/ra_hir/src/semantics/source_to_def.rs
+++ b/crates/ra_hir/src/semantics/source_to_def.rs
@@ -83,10 +83,10 @@ impl SourceToDefCtx<'_, '_> {
83 pub(super) fn union_to_def(&mut self, src: InFile<ast::Union>) -> Option<UnionId> { 83 pub(super) fn union_to_def(&mut self, src: InFile<ast::Union>) -> Option<UnionId> {
84 self.to_def(src, keys::UNION) 84 self.to_def(src, keys::UNION)
85 } 85 }
86 pub(super) fn static_to_def(&mut self, src: InFile<ast::StaticDef>) -> Option<StaticId> { 86 pub(super) fn static_to_def(&mut self, src: InFile<ast::Static>) -> Option<StaticId> {
87 self.to_def(src, keys::STATIC) 87 self.to_def(src, keys::STATIC)
88 } 88 }
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::Const>) -> 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(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> { 92 pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> {
@@ -178,11 +178,11 @@ impl SourceToDefCtx<'_, '_> {
178 let def = self.union_to_def(container.with_value(it))?; 178 let def = self.union_to_def(container.with_value(it))?;
179 VariantId::from(def).into() 179 VariantId::from(def).into()
180 }, 180 },
181 ast::StaticDef(it) => { 181 ast::Static(it) => {
182 let def = self.static_to_def(container.with_value(it))?; 182 let def = self.static_to_def(container.with_value(it))?;
183 DefWithBodyId::from(def).into() 183 DefWithBodyId::from(def).into()
184 }, 184 },
185 ast::ConstDef(it) => { 185 ast::Const(it) => {
186 let def = self.const_to_def(container.with_value(it))?; 186 let def = self.const_to_def(container.with_value(it))?;
187 DefWithBodyId::from(def).into() 187 DefWithBodyId::from(def).into()
188 }, 188 },
@@ -222,8 +222,8 @@ impl SourceToDefCtx<'_, '_> {
222 for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { 222 for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) {
223 let res: DefWithBodyId = match_ast! { 223 let res: DefWithBodyId = match_ast! {
224 match (container.value) { 224 match (container.value) {
225 ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), 225 ast::Const(it) => self.const_to_def(container.with_value(it))?.into(),
226 ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), 226 ast::Static(it) => self.static_to_def(container.with_value(it))?.into(),
227 ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), 227 ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(),
228 _ => continue, 228 _ => continue,
229 } 229 }