summaryrefslogtreecommitdiffstats
path: root/tests/ui/box/unit/unique-assign-copy.rs
blob: b742973ce327d856d309a56819a3e5ec1ab28e15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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);
}