blob: 86e759f088a549e7d4aa8f87577810e28b8bb1c7 [file] [log] [blame]
// Test that closures cannot subvert aliasing restrictions
fn main() {
// Unboxed closure case
{
let mut x = 0;
let mut f = || &mut x; //~ ERROR captured variable cannot escape `FnMut` closure body
let x = f();
let y = f();
}
}