Skip to content

Commit d694b01

Browse files
committed
Sidestep two-phase borrow violation signaled by mutable_borrow_reservation_conflict.
See rust-lang/rust#59159 for further information/discussion.
1 parent 6618d1e commit d694b01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/ra_hir/src/nameres/collector.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,10 @@ where
522522
if let Some(macro_id) =
523523
mac.path.as_ident().and_then(|name| self.def_collector.global_macro_scope.get(&name))
524524
{
525-
let macro_call_id = MacroCallLoc { def: *macro_id, ast_id }.id(self.def_collector.db);
525+
let def = *macro_id;
526+
let macro_call_id = MacroCallLoc { def, ast_id }.id(self.def_collector.db);
526527

527-
self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, *macro_id);
528+
self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, def);
528529
return;
529530
}
530531

0 commit comments

Comments
 (0)