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