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>
This commit is contained in:
bors[bot] 2019-04-30 14:04:04 +00:00
commit 43524a39cd

View File

@ -522,9 +522,10 @@ where
if let Some(macro_id) =
mac.path.as_ident().and_then(|name| self.def_collector.global_macro_scope.get(&name))
{
let macro_call_id = MacroCallLoc { def: *macro_id, ast_id }.id(self.def_collector.db);
let def = *macro_id;
let macro_call_id = MacroCallLoc { def, ast_id }.id(self.def_collector.db);
self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, *macro_id);
self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, def);
return;
}