]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-eval/issue-43197.stderr
Rollup merge of #51765 - jonas-schievink:patch-1, r=KodrAus
[rust.git] / src / test / ui / const-eval / issue-43197.stderr
1 warning: this constant cannot be used
2   --> $DIR/issue-43197.rs:20:5
3    |
4 LL |     const X: u32 = 0-1;
5    |     ^^^^^^^^^^^^^^^---^
6    |                    |
7    |                    attempt to subtract with overflow
8    |
9 note: lint level defined here
10   --> $DIR/issue-43197.rs:11:9
11    |
12 LL | #![warn(const_err)]
13    |         ^^^^^^^^^
14
15 warning: this constant cannot be used
16   --> $DIR/issue-43197.rs:22:5
17    |
18 LL |     const Y: u32 = foo(0-1);
19    |     ^^^^^^^^^^^^^^^^^^^---^^
20    |                        |
21    |                        attempt to subtract with overflow
22
23 warning: referenced constant has errors
24   --> $DIR/issue-43197.rs:24:23
25    |
26 LL |     const X: u32 = 0-1;
27    |                    --- attempt to subtract with overflow
28 ...
29 LL |     println!("{} {}", X, Y);
30    |                       ^
31
32 warning: this expression will panic at runtime
33   --> $DIR/issue-43197.rs:24:23
34    |
35 LL |     println!("{} {}", X, Y);
36    |                       ^ referenced constant has errors
37
38 warning: referenced constant has errors
39   --> $DIR/issue-43197.rs:24:26
40    |
41 LL |     const Y: u32 = foo(0-1);
42    |                        --- attempt to subtract with overflow
43 LL |     //~^ WARN this constant cannot be used
44 LL |     println!("{} {}", X, Y);
45    |                          ^
46
47 warning: this expression will panic at runtime
48   --> $DIR/issue-43197.rs:24:26
49    |
50 LL |     println!("{} {}", X, Y);
51    |                          ^ referenced constant has errors
52
53 error[E0080]: referenced constant has errors
54   --> $DIR/issue-43197.rs:24:26
55    |
56 LL |     const Y: u32 = foo(0-1);
57    |                        --- attempt to subtract with overflow
58 LL |     //~^ WARN this constant cannot be used
59 LL |     println!("{} {}", X, Y);
60    |                          ^
61
62 error[E0080]: erroneous constant used
63   --> $DIR/issue-43197.rs:24:26
64    |
65 LL |     println!("{} {}", X, Y);
66    |                          ^ referenced constant has errors
67
68 error[E0080]: referenced constant has errors
69   --> $DIR/issue-43197.rs:24:23
70    |
71 LL |     const X: u32 = 0-1;
72    |                    --- attempt to subtract with overflow
73 ...
74 LL |     println!("{} {}", X, Y);
75    |                       ^
76
77 error[E0080]: erroneous constant used
78   --> $DIR/issue-43197.rs:24:23
79    |
80 LL |     println!("{} {}", X, Y);
81    |                       ^ referenced constant has errors
82
83 error: aborting due to 4 previous errors
84
85 For more information about this error, try `rustc --explain E0080`.