1 #![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
5 clippy::shadow_unrelated,
7 clippy::unnecessary_operation,
17 i / 2; // no error, this is part of the expression in the preceding line
21 // no error, overflows are checked by `overflowing_literals`
44 // No errors for the following items because they are constant expressions
48 struct Baz([i32; 1 + 1]);
52 type Alias = [i32; 1 + 1];
57 let _: [i32; 1 + 1] = [0, 0];
59 let _: [i32; 1 + 1] = {
60 let a: [i32; 1 + 1] = [0, 0];
65 const ASSOC: i32 = 1 + 1;
79 // warn on references as well! (#5328)
80 pub fn int_arith_ref() {
86 pub fn foo(x: &i32) -> i32 {
91 pub fn bar(x: &i32, y: &i32) -> i32 {
95 pub fn baz(x: i32, y: &i32) -> i32 {
99 pub fn qux(x: i32, y: i32) -> i32 {