fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.2 KiB44 linesraw
1warning: this arithmetic operation will overflow
2  --> $DIR/promoted_errors.rs:15:5
3   |
4LL |     0 - 1
5   |     ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
6   |
7note: the lint level is defined here
8  --> $DIR/promoted_errors.rs:11:9
9   |
10LL | #![warn(arithmetic_overflow, unconditional_panic)]
11   |         ^^^^^^^^^^^^^^^^^^^
12
13warning: this operation will panic at runtime
14  --> $DIR/promoted_errors.rs:19:5
15   |
16LL |     1 / 0
17   |     ^^^^^ attempt to divide `1_i32` by zero
18   |
19note: the lint level is defined here
20  --> $DIR/promoted_errors.rs:11:30
21   |
22LL | #![warn(arithmetic_overflow, unconditional_panic)]
23   |                              ^^^^^^^^^^^^^^^^^^^
24
25warning: this operation will panic at runtime
26  --> $DIR/promoted_errors.rs:23:5
27   |
28LL |     1 / (1 - 1)
29   |     ^^^^^^^^^^^ attempt to divide `1_i32` by zero
30
31warning: this operation will panic at runtime
32  --> $DIR/promoted_errors.rs:27:5
33   |
34LL |     1 / (false as i32)
35   |     ^^^^^^^^^^^^^^^^^^ attempt to divide `1_i32` by zero
36
37warning: this operation will panic at runtime
38  --> $DIR/promoted_errors.rs:31:5
39   |
40LL |     [1, 2, 3][4]
41   |     ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
42
43warning: 5 warnings emitted
44