blob: dd3eaa4c47b9d3c41e722e6b22f8a2186f54c868 (
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
|
error: this constant cannot be used
--> $DIR/const-err-multi.rs:13:1
|
LL | pub const A: i8 = -std::i8::MIN;
| ^^^^^^^^^^^^^^^^^^-------------^
| |
| attempt to negate with overflow
|
note: lint level defined here
--> $DIR/const-err-multi.rs:11:9
|
LL | #![deny(const_err)]
| ^^^^^^^^^
error: referenced constant has errors
--> $DIR/const-err-multi.rs:15:1
|
LL | pub const A: i8 = -std::i8::MIN;
| ------------- attempt to negate with overflow
LL | //~^ ERROR this constant cannot be used
LL | pub const B: i8 = A;
| ^^^^^^^^^^^^^^^^^^^^
error: this constant cannot be used
--> $DIR/const-err-multi.rs:15:1
|
LL | pub const B: i8 = A;
| ^^^^^^^^^^^^^^^^^^-^
| |
| referenced constant has errors
error: referenced constant has errors
--> $DIR/const-err-multi.rs:18:1
|
LL | pub const A: i8 = -std::i8::MIN;
| ------------- attempt to negate with overflow
...
LL | pub const C: u8 = A as u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this constant cannot be used
--> $DIR/const-err-multi.rs:18:1
|
LL | pub const C: u8 = A as u8;
| ^^^^^^^^^^^^^^^^^^-------^
| |
| referenced constant has errors
error: referenced constant has errors
--> $DIR/const-err-multi.rs:21:1
|
LL | pub const A: i8 = -std::i8::MIN;
| ------------- attempt to negate with overflow
...
LL | pub const D: i8 = 50 - A;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: this constant cannot be used
--> $DIR/const-err-multi.rs:21:1
|
LL | pub const D: i8 = 50 - A;
| ^^^^^^^^^^^^^^^^^^------^
| |
| referenced constant has errors
error: aborting due to 7 previous errors
|