1 #![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
5 clippy::shadow_unrelated,
7 clippy::unnecessary_operation,
9 clippy::trivially_copy_pass_by_ref
18 i / 2; // no error, this is part of the expression in the preceding line
22 // no error, overflows are checked by `overflowing_literals`
45 // No errors for the following items because they are constant expressions
49 struct Baz([i32; 1 + 1]);
53 type Alias = [i32; 1 + 1];
58 let _: [i32; 1 + 1] = [0, 0];
60 let _: [i32; 1 + 1] = {
61 let a: [i32; 1 + 1] = [0, 0];
66 const ASSOC: i32 = 1 + 1;
80 // warn on references as well! (#5328)
81 pub fn int_arith_ref() {
87 pub fn foo(x: &i32) -> i32 {
92 pub fn bar(x: &i32, y: &i32) -> i32 {
96 pub fn baz(x: i32, y: &i32) -> i32 {
100 pub fn qux(x: i32, y: i32) -> i32 {