rust/src/test/ui/unique/unique-decl-init-copy.rs
2019-07-27 18:56:16 +03:00

12 lines
207 B
Rust

// run-pass
#![feature(box_syntax)]
pub fn main() {
let mut i: Box<_> = box 1;
// Should be a copy
let mut j = i.clone();
*i = 2;
*j = 3;
assert_eq!(*i, 2);
assert_eq!(*j, 3);
}