]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/capture-mut-ref.rs
fix merge conflicts
[rust.git] / src / test / ui / nll / capture-mut-ref.rs
1 // Check that capturing a mutable reference by move and assigning to its
2 // referent doesn't make the unused mut lint think that it is mutable.
3
4 #![deny(unused_mut)]
5
6 fn mutable_upvar() {
7     let mut x = &mut 0;
8     //~^ ERROR
9     move || {
10         *x = 1;
11     };
12 }
13
14 fn main() {}