about summary refs log tree commit diff
path: root/tests/ui/issues/issue-24357.rs
blob: 63c061594d87e32d00d26fc34da004657b6b6147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
struct NoCopy; //~ NOTE if `NoCopy` implemented `Clone`, you could clone the value
//~^ NOTE consider implementing `Clone` for this type
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
   //~| NOTE you could clone this value
   let z = x;
   //~^ ERROR use of moved value: `x`
   //~| NOTE value used here after move
}