2020-10-26 14:58:22 +01:00
|
|
|
error: this operation will panic at runtime
|
|
|
|
--> $DIR/integer_arithmetic.rs:37:5
|
|
|
|
|
|
|
|
|
LL | i /= 0;
|
|
|
|
| ^^^^^^ attempt to divide `_` by zero
|
|
|
|
|
|
|
|
|
= note: `#[deny(unconditional_panic)]` on by default
|
|
|
|
|
|
|
|
error: this operation will panic at runtime
|
|
|
|
--> $DIR/integer_arithmetic.rs:42:5
|
|
|
|
|
|
|
|
|
LL | i %= 0;
|
|
|
|
| ^^^^^^ attempt to calculate the remainder of `_` with a divisor of zero
|
|
|
|
|
2020-03-18 15:41:42 +01:00
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:16:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | 1 + i;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::integer-arithmetic` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:17:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | i * 2;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:18:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | / 1 %
|
|
|
|
LL | | i / 2; // no error, this is part of the expression in the preceding line
|
2020-10-26 14:58:22 +01:00
|
|
|
| |_____^
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:20:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | i - 2 + 2 - i;
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:21:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | -i;
|
|
|
|
| ^^
|
|
|
|
|
2020-04-13 05:11:19 +02:00
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:22:5
|
2020-04-13 05:11:19 +02:00
|
|
|
|
|
|
|
|
LL | i >> 1;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:23:5
|
2020-04-13 05:11:19 +02:00
|
|
|
|
|
|
|
|
LL | i << 1;
|
|
|
|
| ^^^^^^
|
|
|
|
|
2020-03-18 15:41:42 +01:00
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:33:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | i += 1;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:34:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | i -= 1;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:35:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | i *= 2;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:37:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
2020-10-26 14:58:22 +01:00
|
|
|
LL | i /= 0;
|
2020-03-18 15:41:42 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:38:11
|
|
|
|
|
|
|
|
|
LL | i /= -1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
|
|
|
--> $DIR/integer_arithmetic.rs:39:5
|
|
|
|
|
|
|
|
|
LL | i /= var1;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
|
|
|
--> $DIR/integer_arithmetic.rs:40:5
|
|
|
|
|
|
|
|
|
LL | i /= var2;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
|
|
|
--> $DIR/integer_arithmetic.rs:42:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
2020-10-26 14:58:22 +01:00
|
|
|
LL | i %= 0;
|
2020-03-18 15:41:42 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:43:11
|
|
|
|
|
|
|
|
|
LL | i %= -1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
|
|
|
--> $DIR/integer_arithmetic.rs:44:5
|
|
|
|
|
|
|
|
|
LL | i %= var1;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
|
|
|
--> $DIR/integer_arithmetic.rs:45:5
|
|
|
|
|
|
|
|
|
LL | i %= var2;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
|
|
|
--> $DIR/integer_arithmetic.rs:46:5
|
2020-04-13 05:11:19 +02:00
|
|
|
|
|
|
|
|
LL | i <<= 3;
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:47:5
|
2020-04-13 05:11:19 +02:00
|
|
|
|
|
|
|
|
LL | i >>= 2;
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:89:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | 3 + &1;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:90:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | &3 + 1;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:91:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | &3 + &1;
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:96:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | a + x
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:100:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | x + y
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:104:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | x + y
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: integer arithmetic detected
|
2020-10-26 14:58:22 +01:00
|
|
|
--> $DIR/integer_arithmetic.rs:108:5
|
2020-03-18 15:41:42 +01:00
|
|
|
|
|
|
|
|
LL | (&x + &y)
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2020-10-26 14:58:22 +01:00
|
|
|
error: aborting due to 29 previous errors
|
2020-03-18 15:41:42 +01:00
|
|
|
|