1 use std::fmt::Write as _;
4 const NEG_ONE: i64 = -1;
9 impl std::ops::Shl<i32> for A {
11 fn shl(mut self, other: i32) -> Self {
12 let _ = write!(self.0, "{}", other);
20 impl core::ops::Mul<Meter> for u8 {
22 fn mul(self, _: Meter) -> Length {
30 clippy::unnecessary_operation,
34 #[warn(clippy::identity_op)]
44 x - ZERO; //no error, as we skip lookups (for now)
46 ((ZERO)) | x; //no error, as we skip lookups (for now)
50 x / ONE; //no error, as we skip lookups (for now)
52 x / 2; //no false positive
54 x & NEG_ONE; //no error, as we skip lookups (for now)
60 1 << 0; // no error, this case is allowed, see issue 3430
67 let mut a = A("".into());
68 let b = a << 0; // no error: non-integer
70 1 * Meter; // no error: non-integer
77 (x + 1) % 3; // no error