blob: cc211ab6cd34529d76d6579f6a6526c2845396ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
error: this operation will panic at runtime
--> $DIR/modulo_one.rs:15:5
|
LL | i32::MIN % (-1);
| ^^^^^^^^^^^^^^^ attempt to compute `i32::MIN % -1_i32`, which would overflow
|
= note: `#[deny(unconditional_panic)]` on by default
error: this operation will panic at runtime
--> $DIR/modulo_one.rs:33:5
|
LL | INT_MIN % NEG_ONE;
| ^^^^^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
--> $DIR/modulo_one.rs:37:5
|
LL | INT_MIN % STATIC_NEG_ONE;
| ^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
error: any number modulo 1 will be 0
--> $DIR/modulo_one.rs:8:5
|
LL | 10 % 1;
| ^^^^^^
|
= note: `-D clippy::modulo-one` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::modulo_one)]`
error: any number modulo -1 will panic/overflow or result in 0
--> $DIR/modulo_one.rs:11:5
|
LL | 10 % -1;
| ^^^^^^^
error: any number modulo -1 will panic/overflow or result in 0
--> $DIR/modulo_one.rs:15:5
|
LL | i32::MIN % (-1);
| ^^^^^^^^^^^^^^^
error: any number modulo 1 will be 0
--> $DIR/modulo_one.rs:24:5
|
LL | 2 % ONE;
| ^^^^^^^
error: any number modulo -1 will panic/overflow or result in 0
--> $DIR/modulo_one.rs:28:5
|
LL | 2 % NEG_ONE;
| ^^^^^^^^^^^
error: any number modulo -1 will panic/overflow or result in 0
--> $DIR/modulo_one.rs:33:5
|
LL | INT_MIN % NEG_ONE;
| ^^^^^^^^^^^^^^^^^
error: aborting due to 9 previous errors
|