summary refs log tree commit diff
path: root/src/test/ui/issues/issue-49824.rs
blob: b0d01b3d98d511a09f2afad1804ded362f417e7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![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;
        }
    };
}