1 #![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
5 clippy::shadow_unrelated,
7 clippy::unnecessary_operation,
19 i / 2; // no error, this is part of the expression in the preceding line
25 // no error, overflows are checked by `overflowing_literals`
54 // No errors for the following items because they are constant expressions
58 struct Baz([i32; 1 + 1]);
62 type Alias = [i32; 1 + 1];
67 let _: [i32; 1 + 1] = [0, 0];
69 let _: [i32; 1 + 1] = {
70 let a: [i32; 1 + 1] = [0, 0];
75 const ASSOC: i32 = 1 + 1;
87 // warn on references as well! (#5328)
88 pub fn int_arith_ref() {
94 pub fn foo(x: &i32) -> i32 {
99 pub fn bar(x: &i32, y: &i32) -> i32 {
103 pub fn baz(x: i32, y: &i32) -> i32 {
107 pub fn qux(x: i32, y: i32) -> i32 {