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 a23fdf1b39..6e434addac 100644
--- a/crates/hir/src/attrs.rs
+++ b/crates/hir/src/attrs.rs
@@ -90,6 +90,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,