1
- warning: attempt to subtract with overflow
2
- --> $DIR/conditional_array_execution.rs:15:19
1
+ warning: this constant cannot be used
2
+ --> $DIR/conditional_array_execution.rs:15:1
3
3
|
4
4
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5
- | ^^^^^
5
+ | ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ | |
7
+ | attempt to subtract with overflow
6
8
|
7
9
note: lint level defined here
8
10
--> $DIR/conditional_array_execution.rs:11:9
9
11
|
10
12
LL | #![warn(const_err)]
11
13
| ^^^^^^^^^
12
14
13
- warning: this constant cannot be used
14
- --> $DIR/conditional_array_execution.rs:15:1
15
- |
16
- LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
17
- | ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
- | |
19
- | attempt to subtract with overflow
20
-
21
15
warning: referenced constant
22
- --> $DIR/conditional_array_execution.rs:20 :20
16
+ --> $DIR/conditional_array_execution.rs:19 :20
23
17
|
24
18
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
25
19
| ----- attempt to subtract with overflow
@@ -28,13 +22,13 @@ LL | println!("{}", FOO);
28
22
| ^^^
29
23
30
24
warning: this expression will panic at runtime
31
- --> $DIR/conditional_array_execution.rs:20 :20
25
+ --> $DIR/conditional_array_execution.rs:19 :20
32
26
|
33
27
LL | println!("{}", FOO);
34
28
| ^^^ referenced constant has errors
35
29
36
30
error[E0080]: referenced constant
37
- --> $DIR/conditional_array_execution.rs:20 :5
31
+ --> $DIR/conditional_array_execution.rs:19 :5
38
32
|
39
33
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
40
34
| ----- attempt to subtract with overflow
@@ -45,7 +39,7 @@ LL | println!("{}", FOO);
45
39
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
46
40
47
41
error[E0080]: erroneous constant used
48
- --> $DIR/conditional_array_execution.rs:20 :5
42
+ --> $DIR/conditional_array_execution.rs:19 :5
49
43
|
50
44
LL | println!("{}", FOO);
51
45
| ^^^^^^^^^^^^^^^---^^
@@ -55,7 +49,7 @@ LL | println!("{}", FOO);
55
49
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
56
50
57
51
error[E0080]: referenced constant
58
- --> $DIR/conditional_array_execution.rs:20 :20
52
+ --> $DIR/conditional_array_execution.rs:19 :20
59
53
|
60
54
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
61
55
| ----- attempt to subtract with overflow
@@ -64,7 +58,7 @@ LL | println!("{}", FOO);
64
58
| ^^^
65
59
66
60
error[E0080]: erroneous constant used
67
- --> $DIR/conditional_array_execution.rs:20 :20
61
+ --> $DIR/conditional_array_execution.rs:19 :20
68
62
|
69
63
LL | println!("{}", FOO);
70
64
| ^^^ referenced constant has errors
0 commit comments