summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/issue-32829-2.rs
blob: d70b5a8c4e13af3e93a90c00e65c03b0a00b49e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const bad : u32 = {
    {
        5;
        0
    }
};

const bad_two : u32 = {
    {
        invalid();
        //~^ ERROR: cannot call non-const fn `invalid`
        0
    }
};

const bad_three : u32 = {
    {
        valid();
        0
    }
};

static bad_four : u32 = {
    {
        5;
        0
    }
};

static bad_five : u32 = {
    {
        invalid();
        //~^ ERROR: cannot call non-const fn `invalid`
        0
    }
};

static bad_six : u32 = {
    {
        valid();
        0
    }
};

static mut bad_seven : u32 = {
    {
        5;
        0
    }
};

static mut bad_eight : u32 = {
    {
        invalid();
        //~^ ERROR: cannot call non-const fn `invalid`
        0
    }
};

static mut bad_nine : u32 = {
    {
        valid();
        0
    }
};


fn invalid() {}
const fn valid() {}

fn main() {}