rust/src/test/ui/issues/issue-49824.rs
2019-04-22 08:40:08 +01:00

17 lines
454 B
Rust

#![feature(rustc_attrs)]
// This test checks that a warning occurs with migrate mode.
#[rustc_error]
fn main() {
//~^ ERROR compilation successful
let mut x = 0;
|| {
|| {
//~^ WARNING captured variable cannot escape `FnMut` closure body
//~| WARNING this error has been downgraded to a warning
//~| WARNING this warning will become a hard error in the future
let _y = &mut x;
}
};
}