mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
55 lines
1.4 KiB
Text
55 lines
1.4 KiB
Text
error: this operation will panic at runtime
|
|
--> tests/ui/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
|
|
--> tests/ui/modulo_one.rs:33:5
|
|
|
|
|
LL | INT_MIN % NEG_ONE;
|
|
| ^^^^^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
|
|
|
|
error: any number modulo 1 will be 0
|
|
--> tests/ui/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
|
|
--> tests/ui/modulo_one.rs:11:5
|
|
|
|
|
LL | 10 % -1;
|
|
| ^^^^^^^
|
|
|
|
error: any number modulo -1 will panic/overflow or result in 0
|
|
--> tests/ui/modulo_one.rs:15:5
|
|
|
|
|
LL | i32::MIN % (-1);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: any number modulo 1 will be 0
|
|
--> tests/ui/modulo_one.rs:24:5
|
|
|
|
|
LL | 2 % ONE;
|
|
| ^^^^^^^
|
|
|
|
error: any number modulo -1 will panic/overflow or result in 0
|
|
--> tests/ui/modulo_one.rs:28:5
|
|
|
|
|
LL | 2 % NEG_ONE;
|
|
| ^^^^^^^^^^^
|
|
|
|
error: any number modulo -1 will panic/overflow or result in 0
|
|
--> tests/ui/modulo_one.rs:33:5
|
|
|
|
|
LL | INT_MIN % NEG_ONE;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 8 previous errors
|
|
|