fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.8 KiB66 linesraw
1warning: attempt to subtract with overflow
2  --> $DIR/promoted_errors2.rs:8:20
3   |
4LL |     println!("{}", 0u32 - 1);
5   |                    ^^^^^^^^
6   |
7note: lint level defined here
8  --> $DIR/promoted_errors2.rs:5:9
9   |
10LL | #![warn(const_err)]
11   |         ^^^^^^^^^
12
13warning: attempt to subtract with overflow
14  --> $DIR/promoted_errors2.rs:10:14
15   |
16LL |     let _x = 0u32 - 1;
17   |              ^^^^^^^^
18
19warning: attempt to divide by zero
20  --> $DIR/promoted_errors2.rs:12:20
21   |
22LL |     println!("{}", 1 / (1 - 1));
23   |                    ^^^^^^^^^^^
24
25warning: reaching this expression at runtime will panic or abort
26  --> $DIR/promoted_errors2.rs:12:20
27   |
28LL |     println!("{}", 1 / (1 - 1));
29   |                    ^^^^^^^^^^^ dividing by zero
30
31warning: erroneous constant used
32  --> $DIR/promoted_errors2.rs:12:20
33   |
34LL |     println!("{}", 1 / (1 - 1));
35   |                    ^^^^^^^^^^^ referenced constant has errors
36
37warning: attempt to divide by zero
38  --> $DIR/promoted_errors2.rs:16:14
39   |
40LL |     let _x = 1 / (1 - 1);
41   |              ^^^^^^^^^^^
42
43warning: attempt to divide by zero
44  --> $DIR/promoted_errors2.rs:18:20
45   |
46LL |     println!("{}", 1 / (false as u32));
47   |                    ^^^^^^^^^^^^^^^^^^
48
49warning: reaching this expression at runtime will panic or abort
50  --> $DIR/promoted_errors2.rs:18:20
51   |
52LL |     println!("{}", 1 / (false as u32));
53   |                    ^^^^^^^^^^^^^^^^^^ dividing by zero
54
55warning: erroneous constant used
56  --> $DIR/promoted_errors2.rs:18:20
57   |
58LL |     println!("{}", 1 / (false as u32));
59   |                    ^^^^^^^^^^^^^^^^^^ referenced constant has errors
60
61warning: attempt to divide by zero
62  --> $DIR/promoted_errors2.rs:22:14
63   |
64LL |     let _x = 1 / (false as u32);
65   |              ^^^^^^^^^^^^^^^^^^
66