2019-11-11 04:39:52 -06:00
|
|
|
// Test that mixing `Copy` and non-`Copy` types in `@` patterns is forbidden.
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
struct C;
|
|
|
|
|
|
|
|
struct NC<A, B>(A, B);
|
|
|
|
|
|
|
|
fn main() {
|
2020-11-03 05:44:51 -06:00
|
|
|
// this compiles
|
|
|
|
let a @ NC(b, c) = NC(C, C);
|
|
|
|
|
2019-11-11 04:39:52 -06:00
|
|
|
let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
|
2020-11-01 12:35:55 -06:00
|
|
|
//~^ ERROR use of partially moved value
|
2019-11-11 04:39:52 -06:00
|
|
|
}
|