]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/move-in-pattern-mut-in-loop.stderr
Auto merge of #95474 - oli-obk:tait_ub, r=jackh726
[rust.git] / src / test / ui / borrowck / move-in-pattern-mut-in-loop.stderr
1 error[E0382]: use of moved value
2   --> $DIR/move-in-pattern-mut-in-loop.rs:7:21
3    |
4 LL |         if let Some(mut _x) = opt {}
5    |                     ^^^^^^ value moved here, in previous iteration of loop
6    |
7    = note: move occurs because value has type `&mut i32`, which does not implement the `Copy` trait
8 help: borrow this field in the pattern to avoid moving `opt.0`
9    |
10 LL |         if let Some(ref mut _x) = opt {}
11    |                     +++
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0382`.