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