summary refs log tree commit diff
path: root/src/test/ui/issues/issue-32829-2.rs
blob: c93c84b5fb7732d342cb1b68597cdb0091aa845e (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
72
73
// ignore-tidy-linelength

const bad : u32 = {
    {
        5;
        0
    }
};

const bad_two : u32 = {
    {
        invalid();
        //~^ ERROR: calls in constants are limited to constant functions, tuple structs and tuple variants
        0
    }
};

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

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

static bad_five : u32 = {
    {
        invalid();
        //~^ ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
        0
    }
};

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

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

static mut bad_eight : u32 = {
    {
        invalid();
        //~^ ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
        0
    }
};

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


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

fn main() {}