rust/tests/ui/issues/issue-24357.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
323 B
Rust
Raw Normal View History

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