about summary refs log tree commit diff
path: root/tests/ui/static/duplicated-fields-issue-125842.rs
blob: 580b810232e04b1fd407fe9a42ab33b633fa845f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Do not try to evaluate static initalizers that reference
// ill-defined types. This used to be an ICE.
// See issues #125842 and #124464.
struct Struct {
    field: Option<u8>,
    field: u8,
//~^ ERROR field `field` is already declared
}

static STATIC_A: Struct = Struct {
    field: 1
};

static STATIC_B: Struct = {
    let field = 1;
    Struct {
        field,
    }
};

fn main() {}