mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 19:43:43 +00:00
15 lines
301 B
Rust
15 lines
301 B
Rust
// 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() {
|
|
// this compiles
|
|
let a @ NC(b, c) = NC(C, C);
|
|
|
|
let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
|
|
//~^ ERROR use of partially moved value
|
|
}
|