Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/item_tree.rs')
-rw-r--r--crates/hir-def/src/item_tree.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir-def/src/item_tree.rs b/crates/hir-def/src/item_tree.rs
index 70b96b2573..3bea91ee61 100644
--- a/crates/hir-def/src/item_tree.rs
+++ b/crates/hir-def/src/item_tree.rs
@@ -43,7 +43,10 @@ use std::{
};
use ast::{AstNode, HasName, StructKind};
-use base_db::CrateId;
+use base_db::{
+ span::{SpanAnchor, ROOT_ERASED_FILE_AST_ID},
+ CrateId,
+};
use either::Either;
use hir_expand::{
ast_id_map::{AstIdNode, FileAstId},
@@ -119,7 +122,7 @@ impl ItemTree {
let mut item_tree = match_ast! {
match syntax {
ast::SourceFile(file) => {
- top_attrs = Some(RawAttrs::new(db.upcast(), &file, ctx.hygiene()));
+ top_attrs = Some(RawAttrs::new(db.upcast(), SpanAnchor { file_id, ast_id: ROOT_ERASED_FILE_AST_ID }, &file, ctx.hygiene()));
ctx.lower_module_items(&file)
},
ast::MacroItems(items) => {