aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/autoderef1.rs
blob: 0cf070f1f37e2b8f3e6dc266e862c6c4f55276c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct Foo(i32, bool);
struct Bar {
    a: i32,
    b: bool,
}

fn main() {
    let a = &Foo(123, false);
    let _b: i32 = a.0;
    let _c: bool = a.1;

    let a = &Bar { a: 456, b: false };
    let _b: i32 = a.a;
    let _c: bool = a.b;
}