summary refs log tree commit diff
path: root/src/test/ui/unique/unique-assign-drop.rs
blob: 32068e79df49cf8939bb3ac3e95e3720680e70f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass
#![allow(unused_assignments)]

#![feature(box_syntax)]

pub fn main() {
    let i: Box<_> = box 1;
    let mut j: Box<_> = box 2;
    // Should drop the previous value of j
    j = i;
    assert_eq!(*j, 1);
}