summaryrefslogtreecommitdiffstats
path: root/tests/ui/moves/move-out-of-tuple-field.rs
blob: 66912fa4d099809b8c9901f7906f6c5552b6822e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
struct Foo(Box<isize>);



fn main() {
    let x: (Box<_>,) = (Box::new(1),);
    let y = x.0;
    let z = x.0; //~ ERROR use of moved value: `x.0`

    let x = Foo(Box::new(1));
    let y = x.0;
    let z = x.0; //~ ERROR use of moved value: `x.0`
}