fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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