about summary refs log tree commit diff
path: root/src/test/ui/unique/unique-decl-init-copy.rs
blob: 6ae95949e84da428a2c040ad9b185dab2dab8bae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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);
}