Rollup merge of #5430 - michaelsproul:integer-arithmetic, r=flip1995

Disallow bit-shifting in integer_arithmetic

Make the `integer_arithmetic` lint detect all the operations that are defined as being capable of overflow in the [Rust Reference](https://doc.rust-lang.org/reference/expressions/operator-expr.html#overflow), by also linting for bit-shifting operations (`<<`, `>>`).

changelog: Disallow bit-shifting in `integer_arithmetic`
This commit is contained in:
Philipp Krones
2020-04-15 20:12:29 +02:00
committed by GitHub
4 changed files with 48 additions and 22 deletions
+1 -1
View File
@@ -853,7 +853,7 @@
Lint {
name: "integer_arithmetic",
group: "restriction",
desc: "any integer arithmetic statement",
desc: "any integer arithmetic expression which could overflow or panic",
deprecation: None,
module: "arithmetic",
},