2019-11-11 11:39:52 +01:00
|
|
|
// Test that mixing `Copy` and non-`Copy` types in `@` patterns is forbidden.
|
|
|
|
|
|
|
|
|
|
#![feature(bindings_after_at)]
|
|
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
|
struct C;
|
|
|
|
|
|
|
|
|
|
struct NC<A, B>(A, B);
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let a @ NC(b, c) = NC(C, C);
|
2020-01-19 02:47:01 +01:00
|
|
|
//~^ ERROR use of moved value
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
|
2020-01-19 02:47:01 +01:00
|
|
|
//~^ ERROR use of moved value
|
2019-11-11 11:39:52 +01:00
|
|
|
//~| ERROR use of moved value
|
|
|
|
|
}
|