]> git.proxmox.com Git - rustc.git/blob - tests/ui/box/unit/unique-assign-copy.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / box / unit / unique-assign-copy.rs
1 // run-pass
2
3 pub fn main() {
4 let mut i: Box<_> = Box::new(1);
5 // Should be a copy
6 let mut j;
7 j = i.clone();
8 *i = 2;
9 *j = 3;
10 assert_eq!(*i, 2);
11 assert_eq!(*j, 3);
12 }