@@ -131,6 +131,7 @@ macro_rules! wrapping_impl {
131131 Wrapping ( self . 0 . wrapping_add( other. 0 ) )
132132 }
133133 }
134+ forward_ref_binop! { impl Add , add for Wrapping <$t>, Wrapping <$t> }
134135
135136 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
136137 impl AddAssign for Wrapping <$t> {
@@ -149,6 +150,7 @@ macro_rules! wrapping_impl {
149150 Wrapping ( self . 0 . wrapping_sub( other. 0 ) )
150151 }
151152 }
153+ forward_ref_binop! { impl Sub , sub for Wrapping <$t>, Wrapping <$t> }
152154
153155 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
154156 impl SubAssign for Wrapping <$t> {
@@ -167,6 +169,7 @@ macro_rules! wrapping_impl {
167169 Wrapping ( self . 0 . wrapping_mul( other. 0 ) )
168170 }
169171 }
172+ forward_ref_binop! { impl Mul , mul for Wrapping <$t>, Wrapping <$t> }
170173
171174 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
172175 impl MulAssign for Wrapping <$t> {
@@ -185,6 +188,7 @@ macro_rules! wrapping_impl {
185188 Wrapping ( self . 0 . wrapping_div( other. 0 ) )
186189 }
187190 }
191+ forward_ref_binop! { impl Div , div for Wrapping <$t>, Wrapping <$t> }
188192
189193 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
190194 impl DivAssign for Wrapping <$t> {
@@ -203,6 +207,7 @@ macro_rules! wrapping_impl {
203207 Wrapping ( self . 0 . wrapping_rem( other. 0 ) )
204208 }
205209 }
210+ forward_ref_binop! { impl Rem , rem for Wrapping <$t>, Wrapping <$t> }
206211
207212 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
208213 impl RemAssign for Wrapping <$t> {
@@ -221,6 +226,7 @@ macro_rules! wrapping_impl {
221226 Wrapping ( !self . 0 )
222227 }
223228 }
229+ forward_ref_unop! { impl Not , not for Wrapping <$t> }
224230
225231 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
226232 impl BitXor for Wrapping <$t> {
@@ -231,6 +237,7 @@ macro_rules! wrapping_impl {
231237 Wrapping ( self . 0 ^ other. 0 )
232238 }
233239 }
240+ forward_ref_binop! { impl BitXor , bitxor for Wrapping <$t>, Wrapping <$t> }
234241
235242 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
236243 impl BitXorAssign for Wrapping <$t> {
@@ -249,6 +256,7 @@ macro_rules! wrapping_impl {
249256 Wrapping ( self . 0 | other. 0 )
250257 }
251258 }
259+ forward_ref_binop! { impl BitOr , bitor for Wrapping <$t>, Wrapping <$t> }
252260
253261 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
254262 impl BitOrAssign for Wrapping <$t> {
@@ -267,6 +275,7 @@ macro_rules! wrapping_impl {
267275 Wrapping ( self . 0 & other. 0 )
268276 }
269277 }
278+ forward_ref_binop! { impl BitAnd , bitand for Wrapping <$t>, Wrapping <$t> }
270279
271280 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
272281 impl BitAndAssign for Wrapping <$t> {
@@ -284,6 +293,7 @@ macro_rules! wrapping_impl {
284293 Wrapping ( 0 ) - self
285294 }
286295 }
296+ forward_ref_unop! { impl Neg , neg for Wrapping <$t> }
287297 ) * )
288298}
289299
0 commit comments