1 #![warn(clippy::arithmetic_side_effects)]
3 use core::ops::{Add, Neg};
7 #[allow(clippy::arithmetic_side_effects)]
11 impl Add<$name> for $name {
13 fn add(self, other: $name) -> Self::Output {
18 impl Add<i32> for $name {
20 fn add(self, other: i32) -> Self::Output {
25 impl Add<$name> for i32 {
27 fn add(self, other: $name) -> Self::Output {
32 impl Add<i64> for $name {
34 fn add(self, other: i64) -> Self::Output {
39 impl Add<$name> for i64 {
41 fn add(self, other: $name) -> Self::Output {
48 fn neg(self) -> Self::Output {
60 fn lhs_and_rhs_are_equal() {
61 // is explicitly on the list
62 let _ = OutOfNames + OutOfNames;
63 // is explicitly on the list
65 // is implicitly on the list
71 fn lhs_is_different() {
72 // is explicitly on the list
73 let _ = 1i32 + OutOfNames;
74 // is explicitly on the list
76 // is implicitly on the list
83 // is implicitly on the list
89 fn rhs_is_different() {
90 // is explicitly on the list
91 let _ = OutOfNames + 1i32;
92 // is explicitly on the list
94 // is implicitly on the list
101 // is implicitly on the list
108 // is explicitly on the list
110 // is explicitly on the list