]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/capture-mut-ref.fixed
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / nll / capture-mut-ref.fixed
1 // run-rustfix
2
3 // Check that capturing a mutable reference by move and assigning to its
4 // referent doesn't make the unused mut lint think that it is mutable.
5
6 #![deny(unused_mut)]
7
8 pub fn mutable_upvar() {
9     let x = &mut 0;
10     //~^ ERROR
11     let _ = move || {
12         *x = 1;
13     };
14 }
15
16 fn main() {}