]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/move-in-pattern-mut-in-loop.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / move-in-pattern-mut-in-loop.rs
1 // Regression test for #80913.
2
3 fn main() {
4     let mut x = 42_i32;
5     let mut opt = Some(&mut x);
6     for _ in 0..5 {
7         if let Some(mut _x) = opt {}
8         //~^ ERROR: use of moved value
9     }
10 }