rust/src/test/ui/borrowck/issue-41962.rs

14 lines
376 B
Rust
Raw Normal View History

2018-01-03 15:55:40 -06:00
// compile-flags: -Z borrowck=compare
2017-09-06 01:36:34 -05:00
pub fn main(){
let maybe = Some(vec![true, true]);
loop {
if let Some(thing) = maybe {
}
//~^^ ERROR use of partially moved value: `maybe` (Ast) [E0382]
2018-01-03 15:55:40 -06:00
//~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382]
//~| ERROR use of moved value (Mir) [E0382]
2017-09-06 01:36:34 -05:00
}
}