Change:
ICE with the borrow checker on nightly. Tried on stable/beta and it correctly errors with in nightly, I get : Backtrace:
Reduced: cc
Bisected this one to and , that is, PR . cc

Discussion:
let expr_exit = self.add_ast_node(id, &[]); // Keep track of the previous guard expressions <del> let mut prev_guards = Vec::new(); </del> <ins> let mut prev_guard = None; let match_scope = region::Scope { id, data: region::ScopeData::Node }; </ins> for arm in arms { // Add an exit node for when we've visited all the

let guard_start = self.add_dummy_node(&[pat_exit]); // Visit the guard expression let guard_exit = match guard { <del> hir::Guard::If(ref e) => self.expr(e, guard_start), </del> <ins> hir::Guard::If(ref e) => (&**e, self.expr(e, guard_start)), </ins> }; // #47295: We used to have very special case code // here for when a pair of arms are both formed

// edges.  But this was not actually sound without // other constraints that we stopped enforcing at // some point. <del> while let Some(prev) = prev_guards.pop() { self.add_contained_edge(prev, guard_start); </del> <ins> if let Some((prev_guard, prev_index)) = prev_guard.take() { self.add_exiting_edge(prev_guard, prev_index, match_scope, guard_start); </ins> } // Push the guard onto the list of previous guards <del> prev_guards.push(guard_exit); </del> <ins> prev_guard = Some(guard_exit); </ins> // Update the exit node for the pattern <del> pat_exit = guard_exit; </del> <ins> pat_exit = guard_exit.1; </ins> } // Add an edge from the exit of this pattern to the

SubItem(hir::HirId), Expr(&'a hir::Expr), Pat(&'a hir::Pat), <ins> Arm(&'a hir::Arm), </ins> } pub enum Nested {

self.s.space(); } self.cbox(indent_unit); <ins> self.ann.pre(self, AnnNode::Arm(arm)); </ins> self.ibox(0); self.print_outer_attributes(&arm.attrs); let mut first = true;

self.s.word(","); } } <ins> self.ann.post(self, AnnNode::Arm(arm)); </ins> self.end() // close enclosing cbox }

pprust::AnnNode::Block(blk) => blk.hir_id.local_id, pprust::AnnNode::Item(_) | pprust::AnnNode::SubItem(_) => return, <del> pprust::AnnNode::Pat(pat) => pat.hir_id.local_id </del> <ins> pprust::AnnNode::Pat(pat) => pat.hir_id.local_id, pprust::AnnNode::Arm(arm) => arm.hir_id.local_id, </ins> }; if !self.has_bitset_for_local_id(id) {

pprust_hir::AnnNode::Name(_) => {}, pprust_hir::AnnNode::Item(item) => { s.s.space(); <del> s.synth_comment(format!("hir_id: {} hir local_id: {}", item.hir_id, item.hir_id.local_id.as_u32())) </del> <ins> s.synth_comment(format!("hir_id: {}", item.hir_id)); </ins> } pprust_hir::AnnNode::SubItem(id) => { s.s.space(); <del> s.synth_comment(id.to_string()) </del> <ins> s.synth_comment(id.to_string()); </ins> } pprust_hir::AnnNode::Block(blk) => { s.s.space(); <del> s.synth_comment(format!("block hir_id: {} hir local_id: {}", blk.hir_id, blk.hir_id.local_id.as_u32())) </del> <ins> s.synth_comment(format!("block hir_id: {}", blk.hir_id)); </ins> } pprust_hir::AnnNode::Expr(expr) => { s.s.space(); <del> s.synth_comment(format!("expr hir_id: {} hir local_id: {}", expr.hir_id, expr.hir_id.local_id.as_u32())); s.pclose() </del> <ins> s.synth_comment(format!("expr hir_id: {}", expr.hir_id)); s.pclose(); </ins> } pprust_hir::AnnNode::Pat(pat) => { s.s.space(); <del> s.synth_comment(format!("pat hir_id: {} hir local_id: {}", pat.hir_id, pat.hir_id.local_id.as_u32())) </del> <ins> s.synth_comment(format!("pat hir_id: {}", pat.hir_id)); } pprust_hir::AnnNode::Arm(arm) => { s.s.space(); s.synth_comment(format!("arm hir_id: {}", arm.hir_id)); </ins> } } }

<ins> fn main() { let e: i32; match e { //~^ ERROR use of possibly uninitialized variable ref u if true => {} ref v if true => { let tx = 0; &tx; } _ => (), } } </ins>

<ins> error[E0381]: use of possibly uninitialized variable: `e` --> $DIR/issue-62107-match-arm-scopes.rs:3:11 | LL |     match e { |           ^ use of possibly uninitialized `e` error: aborting due to previous error For more information about this error, try `rustc --explain E0381`. </ins>