mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
13 lines
196 B
Rust
13 lines
196 B
Rust
// run-pass
|
|
|
|
pub fn main() {
|
|
let mut i: Box<_> = Box::new(1);
|
|
// Should be a copy
|
|
let mut j;
|
|
j = i.clone();
|
|
*i = 2;
|
|
*j = 3;
|
|
assert_eq!(*i, 2);
|
|
assert_eq!(*j, 3);
|
|
}
|