rust/src/test/ui/issues/issue-24357.rs

11 lines
275 B
Rust
Raw Normal View History

struct NoCopy;
fn main() {
let x = NoCopy;
let f = move || { let y = x; };
//~^ NOTE value moved (into closure) here
let z = x;
//~^ ERROR use of moved value: `x`
2017-09-05 23:36:34 -07:00
//~| NOTE value used here after move
//~| NOTE move occurs because `x` has type `NoCopy`
}