diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 5766cc3b8..839eb475e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -192,11 +192,11 @@ impl ModuleDef { | |||
192 | ModuleDef::Function(m) => Some(m.name(db)), | 192 | ModuleDef::Function(m) => Some(m.name(db)), |
193 | ModuleDef::Adt(m) => Some(m.name(db)), | 193 | ModuleDef::Adt(m) => Some(m.name(db)), |
194 | ModuleDef::EnumVariant(m) => Some(m.name(db)), | 194 | ModuleDef::EnumVariant(m) => Some(m.name(db)), |
195 | ModuleDef::Const(m) => {m.name(db)}, | 195 | ModuleDef::Const(m) => m.name(db), |
196 | ModuleDef::Static(m) => {m.name(db)}, | 196 | ModuleDef::Static(m) => m.name(db), |
197 | ModuleDef::Trait(m) => {Some(m.name(db))}, | 197 | ModuleDef::Trait(m) => Some(m.name(db)), |
198 | ModuleDef::TypeAlias(m) => {Some(m.name(db))}, | 198 | ModuleDef::TypeAlias(m) => Some(m.name(db)), |
199 | ModuleDef::BuiltinType(m) => {Some(m.as_name())} | 199 | ModuleDef::BuiltinType(m) => Some(m.as_name()), |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
@@ -205,13 +205,17 @@ impl ModuleDef { | |||
205 | ModuleDef::Module(m) => Into::<ModuleId>::into(m.clone()).resolver(db), | 205 | ModuleDef::Module(m) => Into::<ModuleId>::into(m.clone()).resolver(db), |
206 | ModuleDef::Function(f) => Into::<FunctionId>::into(f.clone()).resolver(db), | 206 | ModuleDef::Function(f) => Into::<FunctionId>::into(f.clone()).resolver(db), |
207 | ModuleDef::Adt(adt) => Into::<AdtId>::into(adt.clone()).resolver(db), | 207 | ModuleDef::Adt(adt) => Into::<AdtId>::into(adt.clone()).resolver(db), |
208 | ModuleDef::EnumVariant(ev) => Into::<GenericDefId>::into(Into::<GenericDef>::into(ev.clone())).resolver(db), | 208 | ModuleDef::EnumVariant(ev) => { |
209 | ModuleDef::Const(c) => Into::<GenericDefId>::into(Into::<GenericDef>::into(c.clone())).resolver(db), | 209 | Into::<GenericDefId>::into(Into::<GenericDef>::into(ev.clone())).resolver(db) |
210 | } | ||
211 | ModuleDef::Const(c) => { | ||
212 | Into::<GenericDefId>::into(Into::<GenericDef>::into(c.clone())).resolver(db) | ||
213 | } | ||
210 | ModuleDef::Static(s) => Into::<StaticId>::into(s.clone()).resolver(db), | 214 | ModuleDef::Static(s) => Into::<StaticId>::into(s.clone()).resolver(db), |
211 | ModuleDef::Trait(t) => Into::<TraitId>::into(t.clone()).resolver(db), | 215 | ModuleDef::Trait(t) => Into::<TraitId>::into(t.clone()).resolver(db), |
212 | ModuleDef::TypeAlias(t) => Into::<ModuleId>::into(t.module(db)).resolver(db), | 216 | ModuleDef::TypeAlias(t) => Into::<ModuleId>::into(t.module(db)).resolver(db), |
213 | // TODO: This should be a resolver relative to `std` | 217 | // FIXME: This should be a resolver relative to `std/core` |
214 | ModuleDef::BuiltinType(_t) => None? | 218 | ModuleDef::BuiltinType(_t) => None?, |
215 | }) | 219 | }) |
216 | } | 220 | } |
217 | } | 221 | } |