1 // Test that moving on both sides of an `@` pattern is not allowed.
3 #![feature(bindings_after_at)]
12 //~^ ERROR cannot bind by-move with sub-bindings
13 //~| ERROR use of moved value
15 let a @ (b, c) = (U, U);
16 //~^ ERROR cannot bind by-move with sub-bindings
17 //~| ERROR use of moved value
19 let a @ (b, c) = (u(), u());
20 //~^ ERROR cannot bind by-move with sub-bindings
21 //~| ERROR use of moved value
24 a @ Ok(b) | a @ Err(b) => {}
25 //~^ ERROR cannot bind by-move with sub-bindings
26 //~| ERROR use of moved value
27 //~| ERROR cannot bind by-move with sub-bindings
28 //~| ERROR use of moved value
32 //~^ ERROR cannot bind by-move with sub-bindings
33 //~| ERROR use of moved value
35 match [u(), u(), u(), u()] {
37 //~^ ERROR cannot bind by-move with sub-bindings
38 //~| ERROR use of moved value
41 match [u(), u(), u(), u()] {
42 xs @ [_, ys @ .., _] => {}
43 //~^ ERROR cannot bind by-move with sub-bindings
44 //~| ERROR use of moved value