@@ -131,6 +131,7 @@ macro_rules! wrapping_impl {
131
131
Wrapping ( self . 0 . wrapping_add( other. 0 ) )
132
132
}
133
133
}
134
+ forward_ref_binop! { impl Add , add for Wrapping <$t>, Wrapping <$t> }
134
135
135
136
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
136
137
impl AddAssign for Wrapping <$t> {
@@ -149,6 +150,7 @@ macro_rules! wrapping_impl {
149
150
Wrapping ( self . 0 . wrapping_sub( other. 0 ) )
150
151
}
151
152
}
153
+ forward_ref_binop! { impl Sub , sub for Wrapping <$t>, Wrapping <$t> }
152
154
153
155
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
154
156
impl SubAssign for Wrapping <$t> {
@@ -167,6 +169,7 @@ macro_rules! wrapping_impl {
167
169
Wrapping ( self . 0 . wrapping_mul( other. 0 ) )
168
170
}
169
171
}
172
+ forward_ref_binop! { impl Mul , mul for Wrapping <$t>, Wrapping <$t> }
170
173
171
174
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
172
175
impl MulAssign for Wrapping <$t> {
@@ -185,6 +188,7 @@ macro_rules! wrapping_impl {
185
188
Wrapping ( self . 0 . wrapping_div( other. 0 ) )
186
189
}
187
190
}
191
+ forward_ref_binop! { impl Div , div for Wrapping <$t>, Wrapping <$t> }
188
192
189
193
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
190
194
impl DivAssign for Wrapping <$t> {
@@ -203,6 +207,7 @@ macro_rules! wrapping_impl {
203
207
Wrapping ( self . 0 . wrapping_rem( other. 0 ) )
204
208
}
205
209
}
210
+ forward_ref_binop! { impl Rem , rem for Wrapping <$t>, Wrapping <$t> }
206
211
207
212
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
208
213
impl RemAssign for Wrapping <$t> {
@@ -221,6 +226,7 @@ macro_rules! wrapping_impl {
221
226
Wrapping ( !self . 0 )
222
227
}
223
228
}
229
+ forward_ref_unop! { impl Not , not for Wrapping <$t> }
224
230
225
231
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
226
232
impl BitXor for Wrapping <$t> {
@@ -231,6 +237,7 @@ macro_rules! wrapping_impl {
231
237
Wrapping ( self . 0 ^ other. 0 )
232
238
}
233
239
}
240
+ forward_ref_binop! { impl BitXor , bitxor for Wrapping <$t>, Wrapping <$t> }
234
241
235
242
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
236
243
impl BitXorAssign for Wrapping <$t> {
@@ -249,6 +256,7 @@ macro_rules! wrapping_impl {
249
256
Wrapping ( self . 0 | other. 0 )
250
257
}
251
258
}
259
+ forward_ref_binop! { impl BitOr , bitor for Wrapping <$t>, Wrapping <$t> }
252
260
253
261
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
254
262
impl BitOrAssign for Wrapping <$t> {
@@ -267,6 +275,7 @@ macro_rules! wrapping_impl {
267
275
Wrapping ( self . 0 & other. 0 )
268
276
}
269
277
}
278
+ forward_ref_binop! { impl BitAnd , bitand for Wrapping <$t>, Wrapping <$t> }
270
279
271
280
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
272
281
impl BitAndAssign for Wrapping <$t> {
@@ -284,6 +293,7 @@ macro_rules! wrapping_impl {
284
293
Wrapping ( 0 ) - self
285
294
}
286
295
}
296
+ forward_ref_unop! { impl Neg , neg for Wrapping <$t> }
287
297
) * )
288
298
}
289
299
0 commit comments