about summary refs log tree commit diff
path: root/tests/ui/moves/move-arg-2.rs
blob: 77839c11c074e79702ef2d8123a986aadd3d2dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ run-pass

fn test(foo: Box<Vec<isize>>) { assert_eq!((*foo)[0], 10); }

pub fn main() {
    let x = Box::new(vec![10]);
    // Test forgetting a local by move-in
    test(x);

    // Test forgetting a temporary by move-in.
    test(Box::new(vec![10]));
}