summary refs log tree commit diff
path: root/tests/ui/closures/moved-upvar-mut-rebind-11958.rs
blob: 701dc1a2cefd22d7cff569fb1aa496754c6afc3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Regression test for https://github.com/rust-lang/rust/issues/11958

//@ run-pass

// We shouldn't need to rebind a moved upvar as mut if it's already
// marked as mut

pub fn main() {
    let mut x = 1;
    let _thunk = Box::new(move|| { x = 2; });
    //~^ WARN value assigned to `x` is never read
    //~| WARN unused variable: `x`
}