@@ -239,6 +239,16 @@ macro_rules! wrapping_impl {
239
239
}
240
240
forward_ref_op_assign! { impl const AddAssign , add_assign for Wrapping <$t>, Wrapping <$t> }
241
241
242
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
243
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
244
+ impl const AddAssign <$t> for Wrapping <$t> {
245
+ #[ inline]
246
+ fn add_assign( & mut self , other: $t) {
247
+ * self = * self + Wrapping ( other) ;
248
+ }
249
+ }
250
+ forward_ref_op_assign! { impl const AddAssign , add_assign for Wrapping <$t>, $t }
251
+
242
252
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
243
253
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
244
254
impl const Sub for Wrapping <$t> {
@@ -262,6 +272,16 @@ macro_rules! wrapping_impl {
262
272
}
263
273
forward_ref_op_assign! { impl const SubAssign , sub_assign for Wrapping <$t>, Wrapping <$t> }
264
274
275
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
276
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
277
+ impl const SubAssign <$t> for Wrapping <$t> {
278
+ #[ inline]
279
+ fn sub_assign( & mut self , other: $t) {
280
+ * self = * self - Wrapping ( other) ;
281
+ }
282
+ }
283
+ forward_ref_op_assign! { impl const SubAssign , sub_assign for Wrapping <$t>, $t }
284
+
265
285
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
266
286
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
267
287
impl const Mul for Wrapping <$t> {
@@ -285,6 +305,16 @@ macro_rules! wrapping_impl {
285
305
}
286
306
forward_ref_op_assign! { impl const MulAssign , mul_assign for Wrapping <$t>, Wrapping <$t> }
287
307
308
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
309
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
310
+ impl const MulAssign <$t> for Wrapping <$t> {
311
+ #[ inline]
312
+ fn mul_assign( & mut self , other: $t) {
313
+ * self = * self * Wrapping ( other) ;
314
+ }
315
+ }
316
+ forward_ref_op_assign! { impl const MulAssign , mul_assign for Wrapping <$t>, $t }
317
+
288
318
#[ stable( feature = "wrapping_div" , since = "1.3.0" ) ]
289
319
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
290
320
impl const Div for Wrapping <$t> {
@@ -308,6 +338,16 @@ macro_rules! wrapping_impl {
308
338
}
309
339
forward_ref_op_assign! { impl const DivAssign , div_assign for Wrapping <$t>, Wrapping <$t> }
310
340
341
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
342
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
343
+ impl const DivAssign <$t> for Wrapping <$t> {
344
+ #[ inline]
345
+ fn div_assign( & mut self , other: $t) {
346
+ * self = * self / Wrapping ( other) ;
347
+ }
348
+ }
349
+ forward_ref_op_assign! { impl const DivAssign , div_assign for Wrapping <$t>, $t }
350
+
311
351
#[ stable( feature = "wrapping_impls" , since = "1.7.0" ) ]
312
352
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
313
353
impl const Rem for Wrapping <$t> {
@@ -331,6 +371,16 @@ macro_rules! wrapping_impl {
331
371
}
332
372
forward_ref_op_assign! { impl const RemAssign , rem_assign for Wrapping <$t>, Wrapping <$t> }
333
373
374
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
375
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
376
+ impl const RemAssign <$t> for Wrapping <$t> {
377
+ #[ inline]
378
+ fn rem_assign( & mut self , other: $t) {
379
+ * self = * self % Wrapping ( other) ;
380
+ }
381
+ }
382
+ forward_ref_op_assign! { impl const RemAssign , rem_assign for Wrapping <$t>, $t }
383
+
334
384
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
335
385
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
336
386
impl const Not for Wrapping <$t> {
@@ -367,6 +417,16 @@ macro_rules! wrapping_impl {
367
417
}
368
418
forward_ref_op_assign! { impl const BitXorAssign , bitxor_assign for Wrapping <$t>, Wrapping <$t> }
369
419
420
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
421
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
422
+ impl const BitXorAssign <$t> for Wrapping <$t> {
423
+ #[ inline]
424
+ fn bitxor_assign( & mut self , other: $t) {
425
+ * self = * self ^ Wrapping ( other) ;
426
+ }
427
+ }
428
+ forward_ref_op_assign! { impl const BitXorAssign , bitxor_assign for Wrapping <$t>, $t }
429
+
370
430
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
371
431
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
372
432
impl const BitOr for Wrapping <$t> {
@@ -390,6 +450,16 @@ macro_rules! wrapping_impl {
390
450
}
391
451
forward_ref_op_assign! { impl const BitOrAssign , bitor_assign for Wrapping <$t>, Wrapping <$t> }
392
452
453
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
454
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
455
+ impl const BitOrAssign <$t> for Wrapping <$t> {
456
+ #[ inline]
457
+ fn bitor_assign( & mut self , other: $t) {
458
+ * self = * self | Wrapping ( other) ;
459
+ }
460
+ }
461
+ forward_ref_op_assign! { impl const BitOrAssign , bitor_assign for Wrapping <$t>, $t }
462
+
393
463
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
394
464
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
395
465
impl const BitAnd for Wrapping <$t> {
@@ -413,6 +483,16 @@ macro_rules! wrapping_impl {
413
483
}
414
484
forward_ref_op_assign! { impl const BitAndAssign , bitand_assign for Wrapping <$t>, Wrapping <$t> }
415
485
486
+ #[ stable( feature = "wrapping_int_assign_impl" , since = "1.60.0" ) ]
487
+ #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
488
+ impl const BitAndAssign <$t> for Wrapping <$t> {
489
+ #[ inline]
490
+ fn bitand_assign( & mut self , other: $t) {
491
+ * self = * self & Wrapping ( other) ;
492
+ }
493
+ }
494
+ forward_ref_op_assign! { impl const BitAndAssign , bitand_assign for Wrapping <$t>, $t }
495
+
416
496
#[ stable( feature = "wrapping_neg" , since = "1.10.0" ) ]
417
497
#[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
418
498
impl const Neg for Wrapping <$t> {
0 commit comments