]>
Commit | Line | Data |
---|---|---|
ee023bcb FG |
1 | warning: this arithmetic operation will overflow |
2 | --> $DIR/promoted_errors.rs:15:5 | |
3 | | | |
4 | LL | 0 - 1 | |
5 | | ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | |
6 | | | |
7 | note: the lint level is defined here | |
8 | --> $DIR/promoted_errors.rs:11:20 | |
9 | | | |
10 | LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] | |
11 | | ^^^^^^^^^^^^^^^^^^^ | |
12 | ||
13 | warning: this operation will panic at runtime | |
14 | --> $DIR/promoted_errors.rs:21:5 | |
15 | | | |
16 | LL | 1 / 0 | |
17 | | ^^^^^ attempt to divide `1_i32` by zero | |
18 | | | |
19 | note: the lint level is defined here | |
20 | --> $DIR/promoted_errors.rs:11:41 | |
21 | | | |
22 | LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] | |
23 | | ^^^^^^^^^^^^^^^^^^^ | |
24 | ||
25 | warning: this operation will panic at runtime | |
26 | --> $DIR/promoted_errors.rs:27:5 | |
27 | | | |
28 | LL | 1 / (1 - 1) | |
29 | | ^^^^^^^^^^^ attempt to divide `1_i32` by zero | |
30 | ||
31 | warning: this operation will panic at runtime | |
32 | --> $DIR/promoted_errors.rs:31:5 | |
33 | | | |
34 | LL | 1 / (false as i32) | |
35 | | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_i32` by zero | |
36 | ||
37 | warning: this operation will panic at runtime | |
38 | --> $DIR/promoted_errors.rs:35:5 | |
39 | | | |
40 | LL | [1, 2, 3][4] | |
41 | | ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4 | |
42 | ||
5869c6ff | 43 | warning: any use of this value will cause an error |
ee023bcb | 44 | --> $DIR/promoted_errors.rs:21:5 |
5869c6ff XL |
45 | | |
46 | LL | 1 / 0 | |
47 | | ^^^^^ | |
48 | | | | |
49 | | attempt to divide `1_i32` by zero | |
ee023bcb FG |
50 | | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5 |
51 | | inside `X` at $DIR/promoted_errors.rs:46:29 | |
5869c6ff XL |
52 | ... |
53 | LL | / const X: () = { | |
54 | LL | | let _x: &'static u32 = &overflow(); | |
55 | LL | | | |
56 | LL | | | |
57 | ... | | |
58 | LL | | let _x: &'static i32 = &oob(); | |
59 | LL | | }; | |
60 | | |__- | |
74b04a01 XL |
61 | | |
62 | note: the lint level is defined here | |
17df50a5 | 63 | --> $DIR/promoted_errors.rs:11:9 |
74b04a01 XL |
64 | | |
65 | LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] | |
66 | | ^^^^^^^^^ | |
5869c6ff XL |
67 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
68 | = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> | |
69 | ||
70 | warning: any use of this value will cause an error | |
ee023bcb | 71 | --> $DIR/promoted_errors.rs:46:28 |
5869c6ff XL |
72 | | |
73 | LL | / const X: () = { | |
74 | LL | | let _x: &'static u32 = &overflow(); | |
75 | LL | | | |
76 | LL | | | |
77 | LL | | let _x: &'static i32 = &div_by_zero1(); | |
78 | | | ^^^^^^^^^^^^^^^ referenced constant has errors | |
79 | ... | | |
80 | LL | | let _x: &'static i32 = &oob(); | |
81 | LL | | }; | |
82 | | |__- | |
83 | | | |
84 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
85 | = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> | |
86 | ||
ee023bcb | 87 | warning: 7 warnings emitted |
ba9703b0 | 88 |