Closed
Description
Note from @pnkfelix for people looking at this bug: See important soundness issue in ariel's issue.
In the following code the borrow error in the z
arm isn't reported with MIR borrowck, but it is reported with AST borrowck:
fn main() {
let mut x = 1;
let _x = &mut x;
match x {
y => println!("y: {}", y), // Error in AST and MIR
z => println!("z: {}", z), // Error only in AST
}
}
(compile with -Z emit-end-regions -Z borrowck-mir
to use the MIR borrowck)