Closed
Description
pub fn main(){
let maybe = Some(vec![true, true]);
loop {
if let Some(thing) = maybe {
}
}
}
(playpen)
gives the error
error[E0382]: use of partially moved value: `maybe`
--> test.rs:7:30
|
7 | if let Some(thing) = maybe {
| ----- ^^^^^ value used here after move
| |
| value moved here
|
= note: move occurs because `(maybe:std::prelude::v1::Some).0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `(maybe:std::prelude::v1::Some).0`
--> test.rs:7:21
|
7 | if let Some(thing) = maybe {
| ^^^^^ value moved here in previous iteration of loop
|
= note: move occurs because `(maybe:std::prelude::v1::Some).0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error: aborting due to 2 previous errors
(maybe:std::prelude::v1::Some).0
seems to be MIR leaking into the UI