Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/attrs.rs')
-rw-r--r--crates/hir/src/attrs.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir/src/attrs.rs b/crates/hir/src/attrs.rs
index 01cb040bdf..4351a34e82 100644
--- a/crates/hir/src/attrs.rs
+++ b/crates/hir/src/attrs.rs
@@ -89,6 +89,16 @@ impl HasAttrs for AssocItem {
}
}
+impl HasAttrs for crate::Crate {
+ fn attrs(self, db: &dyn HirDatabase) -> AttrsWithOwner {
+ let def = AttrDefId::ModuleId(self.root_module().id);
+ AttrsWithOwner::new(db.upcast(), def)
+ }
+ fn attr_id(self) -> AttrDefId {
+ AttrDefId::ModuleId(self.root_module().id)
+ }
+}
+
/// Resolves the item `link` points to in the scope of `def`.
pub fn resolve_doc_path_on(
db: &dyn HirDatabase,