Skip to content

Commit

Permalink
Sidestep two-phase borrow violation signaled by mutable_borrow_reserv…
Browse files Browse the repository at this point in the history
…ation_conflict.

See rust-lang/rust#59159 for further information/discussion.
  • Loading branch information
pnkfelix committed Apr 29, 2019
1 parent 6618d1e commit d694b01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/ra_hir/src/nameres/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d694b01

Please sign in to comment.