2019-11-11 11:39:52 +01: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 17:14:51 +05:30
|
|
|
// this compiles
|
|
|
|
let a @ NC(b, c) = NC(C, C);
|
|
|
|
|
2019-11-11 11:39:52 +01:00
|
|
|
let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
|
2020-11-02 00:05:55 +05:30
|
|
|
//~^ ERROR use of partially moved value
|
2019-11-11 11:39:52 +01:00
|
|
|
}
|