rust/tests/ui/moves/move-out-of-tuple-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
251 B
Rust
Raw Normal View History

struct Foo(Box<isize>);
fn main() {
let x: (Box<_>,) = (Box::new(1),);
let y = x.0;
let z = x.0; //~ ERROR use of moved value: `x.0`
let x = Foo(Box::new(1));
let y = x.0;
let z = x.0; //~ ERROR use of moved value: `x.0`
}