rust/tests/ui/moves/move-2-unique.rs

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

11 lines
187 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
struct X { x: isize, y: isize, z: isize }
pub fn main() {
let x: Box<_> = Box::new(X {x: 1, y: 2, z: 3});
let y = x;
assert_eq!(y.y, 2);
}