diff options
Diffstat (limited to 'crates/ra_hir_def/src/attr.rs')
-rw-r--r-- | crates/ra_hir_def/src/attr.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs index 12d4e777a..5bf82e191 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/ra_hir_def/src/attr.rs | |||
@@ -12,8 +12,7 @@ use ra_syntax::{ | |||
12 | use tt::Subtree; | 12 | use tt::Subtree; |
13 | 13 | ||
14 | use crate::{ | 14 | use crate::{ |
15 | db::DefDatabase, path::Path, src::HasChildSource, src::HasSource, AdtId, AstItemDef, AttrDefId, | 15 | db::DefDatabase, path::Path, src::HasChildSource, src::HasSource, AdtId, AttrDefId, Lookup, |
16 | Lookup, | ||
17 | }; | 16 | }; |
18 | 17 | ||
19 | #[derive(Default, Debug, Clone, PartialEq, Eq)] | 18 | #[derive(Default, Debug, Clone, PartialEq, Eq)] |
@@ -56,11 +55,11 @@ impl Attrs { | |||
56 | Attrs::from_attrs_owner(db, src.map(|it| it as &dyn AttrsOwner)) | 55 | Attrs::from_attrs_owner(db, src.map(|it| it as &dyn AttrsOwner)) |
57 | } | 56 | } |
58 | AttrDefId::AdtId(it) => match it { | 57 | AttrDefId::AdtId(it) => match it { |
59 | AdtId::StructId(it) => attrs_from_ast(it.lookup_intern(db).ast_id, db), | 58 | AdtId::StructId(it) => attrs_from_loc(it.lookup(db), db), |
60 | AdtId::EnumId(it) => attrs_from_ast(it.lookup_intern(db).ast_id, db), | 59 | AdtId::EnumId(it) => attrs_from_loc(it.lookup(db), db), |
61 | AdtId::UnionId(it) => attrs_from_ast(it.lookup_intern(db).ast_id, db), | 60 | AdtId::UnionId(it) => attrs_from_loc(it.lookup(db), db), |
62 | }, | 61 | }, |
63 | AttrDefId::TraitId(it) => attrs_from_ast(it.lookup_intern(db).ast_id, db), | 62 | AttrDefId::TraitId(it) => attrs_from_loc(it.lookup(db), db), |
64 | AttrDefId::MacroDefId(it) => { | 63 | AttrDefId::MacroDefId(it) => { |
65 | it.ast_id.map_or_else(Default::default, |ast_id| attrs_from_ast(ast_id, db)) | 64 | it.ast_id.map_or_else(Default::default, |ast_id| attrs_from_ast(ast_id, db)) |
66 | } | 65 | } |