1 #![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
2 #![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::op_ref)]
12 i / 2; // no error, this is part of the expression in the preceding line
18 // no error, overflows are checked by `overflowing_literals`
47 // No errors for the following items because they are constant expressions
51 struct Baz([i32; 1 + 1]);
55 type Alias = [i32; 1 + 1];
60 let _: [i32; 1 + 1] = [0, 0];
62 let _: [i32; 1 + 1] = {
63 let a: [i32; 1 + 1] = [0, 0];
68 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 {