summaryrefslogtreecommitdiffstats
path: root/tests/ui/attributes/issue-115264-pat-field.rs
blob: 8c6bbe167264cda8cf6b611bb14243a3d24f78c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Regression test for issue 115264
// Tests that retrieving the ident of 'foo' variable in
// the pattern inside main() does not cause an ICE

// check-pass

struct X {
    foo: i32,
}

#[allow(unused_variables)]
fn main() {
    let X {
        #[doc(alias = "StructItem")]
        foo
    } = X {
        foo: 123
    };
}