Skip to content

Commit 43524a3

Browse files
bors[bot]pnkfelix
andcommitted
Merge #1217
1217: Sidestep two-phase borrow violation r=matklad a=pnkfelix Sidestep two-phase borrow violation signaled by mutable_borrow_reservation_conflict. See rust-lang/rust#59159 for further information/discussion. Co-authored-by: Felix S. Klock II <pnkfelix@pnkfx.org>
2 parents 6618d1e + d694b01 commit 43524a3

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)