rust/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs

14 lines
278 B
Rust
Raw Normal View History

// 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(d, e)) = NC(C, NC(C, C));
//~^ ERROR use of partially moved value
}