Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/db.rs')
-rw-r--r--crates/hir-expand/src/db.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/hir-expand/src/db.rs b/crates/hir-expand/src/db.rs
index 30042ca78a..ad25a1168c 100644
--- a/crates/hir-expand/src/db.rs
+++ b/crates/hir-expand/src/db.rs
@@ -146,13 +146,11 @@ pub fn expand_speculative(
token_to_map: SyntaxToken,
) -> Option<(SyntaxNode, SyntaxToken)> {
let loc = db.lookup_intern_macro_call(actual_macro_call);
+ let (_, _, span) = db.macro_arg_considering_derives(actual_macro_call, &loc.kind);
- // FIXME: This BOGUS here is dangerous once the proc-macro server can call back into the database!
- let span_map = RealSpanMap::absolute(FileId::BOGUS);
+ let span_map = RealSpanMap::absolute(span.anchor.file_id);
let span_map = SpanMapRef::RealSpanMap(&span_map);
- let (_, _, span) = db.macro_arg_considering_derives(actual_macro_call, &loc.kind);
-
// Build the subtree and token mapping for the speculative args
let (mut tt, undo_info) = match loc.kind {
MacroCallKind::FnLike { .. } => (