]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
Remove unnecessary .as_ref().
[rust.git] / src / test / ui / consts / const-eval / promoted_errors.opt_with_overflow_checks.stderr
1 warning: any use of this value will cause an error
2   --> $DIR/promoted_errors.rs:15:5
3    |
4 LL |       0 - 1
5    |       ^^^^^
6    |       |
7    |       attempt to compute `0_u32 - 1_u32`, which would overflow
8    |       inside `overflow` at $DIR/promoted_errors.rs:15:5
9    |       inside `X` at $DIR/promoted_errors.rs:38:29
10 ...
11 LL | / const X: () = {
12 LL | |     let _x: &'static u32 = &overflow();
13 LL | |
14 LL | |
15 ...  |
16 LL | |     let _x: &'static i32 = &oob();
17 LL | | };
18    | |__-
19    |
20 note: the lint level is defined here
21   --> $DIR/promoted_errors.rs:11:9
22    |
23 LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
24    |         ^^^^^^^^^
25    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
26    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
27
28 warning: any use of this value will cause an error
29   --> $DIR/promoted_errors.rs:38:28
30    |
31 LL | / const X: () = {
32 LL | |     let _x: &'static u32 = &overflow();
33    | |                            ^^^^^^^^^^^ referenced constant has errors
34 LL | |
35 LL | |
36 ...  |
37 LL | |     let _x: &'static i32 = &oob();
38 LL | | };
39    | |__-
40    |
41    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
42    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
43
44 warning: 2 warnings emitted
45