rust-clippy/tests/ui/modulo_one.stderr

61 lines
1.5 KiB
Text
Raw Normal View History

2022-03-03 00:20:27 +00:00
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
|
2022-03-03 00:20:27 +00:00
= note: `#[deny(unconditional_panic)]` on by default
2022-03-03 00:20:27 +00:00
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
2022-03-03 00:20:27 +00:00
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
2018-10-06 16:18:06 +00:00
|
2018-12-27 15:57:55 +00:00
LL | 10 % 1;
2018-10-06 16:18:06 +00:00
| ^^^^^^
|
= note: `-D clippy::modulo-one` implied by `-D warnings`
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
2018-01-16 16:06:27 +00:00