1#[lang = "not"]
32#[stable(feature = "rust1", since = "1.0.0")]
33#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
34#[doc(alias = "!")]
35pub const trait Not {
36 #[stable(feature = "rust1", since = "1.0.0")]
38 type Output;
39
40 #[must_use]
51 #[stable(feature = "rust1", since = "1.0.0")]
52 fn not(self) -> Self::Output;
53}
54
55macro_rules! not_impl {
56 ($($t:ty)*) => ($(
57 #[stable(feature = "rust1", since = "1.0.0")]
58 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
59 impl const Not for $t {
60 type Output = $t;
61
62 #[inline]
63 fn not(self) -> $t { !self }
64 }
65
66 forward_ref_unop! { impl Not, not for $t,
67 #[stable(feature = "rust1", since = "1.0.0")]
68 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
69 )*)
70}
71
72#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Not for &i128 {
type Output = <i128 as Not>::Output;
#[inline]
fn not(self) -> <i128 as Not>::Output { Not::not(*self) }
}not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
73
74#[stable(feature = "not_never", since = "1.60.0")]
75#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
76impl const Not for ! {
77 type Output = !;
78
79 #[inline]
80 fn not(self) -> ! {
81 match self {}
82 }
83}
84
85#[lang = "bitand"]
143#[doc(alias = "&")]
144#[stable(feature = "rust1", since = "1.0.0")]
145#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
146#[diagnostic::on_unimplemented(
147 message = "no implementation for `{Self} & {Rhs}`",
148 label = "no implementation for `{Self} & {Rhs}`"
149)]
150pub const trait BitAnd<Rhs = Self> {
151 #[stable(feature = "rust1", since = "1.0.0")]
153 type Output;
154
155 #[must_use]
166 #[stable(feature = "rust1", since = "1.0.0")]
167 fn bitand(self, rhs: Rhs) -> Self::Output;
168}
169
170macro_rules! bitand_impl {
171 ($($t:ty)*) => ($(
172 #[stable(feature = "rust1", since = "1.0.0")]
173 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
174 impl const BitAnd for $t {
175 type Output = $t;
176
177 #[inline]
178 fn bitand(self, rhs: $t) -> $t { self & rhs }
179 }
180
181 forward_ref_binop! { impl BitAnd, bitand for $t, $t,
182 #[stable(feature = "rust1", since = "1.0.0")]
183 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
184 )*)
185}
186
187#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitAnd<i128> for &i128 {
type Output = <i128 as BitAnd<i128>>::Output;
#[inline]
#[track_caller]
fn bitand(self, other: i128) -> <i128 as BitAnd<i128>>::Output {
BitAnd::bitand(*self, other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitAnd<&i128> for i128 {
type Output = <i128 as BitAnd<i128>>::Output;
#[inline]
#[track_caller]
fn bitand(self, other: &i128) -> <i128 as BitAnd<i128>>::Output {
BitAnd::bitand(self, *other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitAnd<&i128> for &i128 {
type Output = <i128 as BitAnd<i128>>::Output;
#[inline]
#[track_caller]
fn bitand(self, other: &i128) -> <i128 as BitAnd<i128>>::Output {
BitAnd::bitand(*self, *other)
}
}bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
188
189#[lang = "bitor"]
247#[doc(alias = "|")]
248#[stable(feature = "rust1", since = "1.0.0")]
249#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
250#[diagnostic::on_unimplemented(
251 message = "no implementation for `{Self} | {Rhs}`",
252 label = "no implementation for `{Self} | {Rhs}`"
253)]
254pub const trait BitOr<Rhs = Self> {
255 #[stable(feature = "rust1", since = "1.0.0")]
257 type Output;
258
259 #[must_use]
270 #[stable(feature = "rust1", since = "1.0.0")]
271 fn bitor(self, rhs: Rhs) -> Self::Output;
272}
273
274macro_rules! bitor_impl {
275 ($($t:ty)*) => ($(
276 #[stable(feature = "rust1", since = "1.0.0")]
277 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
278 impl const BitOr for $t {
279 type Output = $t;
280
281 #[inline]
282 fn bitor(self, rhs: $t) -> $t { self | rhs }
283 }
284
285 forward_ref_binop! { impl BitOr, bitor for $t, $t,
286 #[stable(feature = "rust1", since = "1.0.0")]
287 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
288 )*)
289}
290
291#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitOr<i128> for &i128 {
type Output = <i128 as BitOr<i128>>::Output;
#[inline]
#[track_caller]
fn bitor(self, other: i128) -> <i128 as BitOr<i128>>::Output {
BitOr::bitor(*self, other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitOr<&i128> for i128 {
type Output = <i128 as BitOr<i128>>::Output;
#[inline]
#[track_caller]
fn bitor(self, other: &i128) -> <i128 as BitOr<i128>>::Output {
BitOr::bitor(self, *other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitOr<&i128> for &i128 {
type Output = <i128 as BitOr<i128>>::Output;
#[inline]
#[track_caller]
fn bitor(self, other: &i128) -> <i128 as BitOr<i128>>::Output {
BitOr::bitor(*self, *other)
}
}bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
292
293#[lang = "bitxor"]
351#[doc(alias = "^")]
352#[stable(feature = "rust1", since = "1.0.0")]
353#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
354#[diagnostic::on_unimplemented(
355 message = "no implementation for `{Self} ^ {Rhs}`",
356 label = "no implementation for `{Self} ^ {Rhs}`"
357)]
358pub const trait BitXor<Rhs = Self> {
359 #[stable(feature = "rust1", since = "1.0.0")]
361 type Output;
362
363 #[must_use]
374 #[stable(feature = "rust1", since = "1.0.0")]
375 fn bitxor(self, rhs: Rhs) -> Self::Output;
376}
377
378macro_rules! bitxor_impl {
379 ($($t:ty)*) => ($(
380 #[stable(feature = "rust1", since = "1.0.0")]
381 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
382 impl const BitXor for $t {
383 type Output = $t;
384
385 #[inline]
386 fn bitxor(self, other: $t) -> $t { self ^ other }
387 }
388
389 forward_ref_binop! { impl BitXor, bitxor for $t, $t,
390 #[stable(feature = "rust1", since = "1.0.0")]
391 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
392 )*)
393}
394
395#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitXor<i128> for &i128 {
type Output = <i128 as BitXor<i128>>::Output;
#[inline]
#[track_caller]
fn bitxor(self, other: i128) -> <i128 as BitXor<i128>>::Output {
BitXor::bitxor(*self, other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitXor<&i128> for i128 {
type Output = <i128 as BitXor<i128>>::Output;
#[inline]
#[track_caller]
fn bitxor(self, other: &i128) -> <i128 as BitXor<i128>>::Output {
BitXor::bitxor(self, *other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitXor<&i128> for &i128 {
type Output = <i128 as BitXor<i128>>::Output;
#[inline]
#[track_caller]
fn bitxor(self, other: &i128) -> <i128 as BitXor<i128>>::Output {
BitXor::bitxor(*self, *other)
}
}bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
396
397#[lang = "shl"]
454#[doc(alias = "<<")]
455#[stable(feature = "rust1", since = "1.0.0")]
456#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
457#[diagnostic::on_unimplemented(
458 message = "no implementation for `{Self} << {Rhs}`",
459 label = "no implementation for `{Self} << {Rhs}`"
460)]
461pub const trait Shl<Rhs = Self> {
462 #[stable(feature = "rust1", since = "1.0.0")]
464 type Output;
465
466 #[must_use]
475 #[stable(feature = "rust1", since = "1.0.0")]
476 fn shl(self, rhs: Rhs) -> Self::Output;
477}
478
479macro_rules! shl_impl {
480 ($t:ty, $f:ty) => {
481 #[stable(feature = "rust1", since = "1.0.0")]
482 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
483 impl const Shl<$f> for $t {
484 type Output = $t;
485
486 #[inline]
487 #[track_caller]
488 #[rustc_inherit_overflow_checks]
489 fn shl(self, other: $f) -> $t {
490 self << other
491 }
492 }
493
494 forward_ref_binop! { impl Shl, shl for $t, $f,
495 #[stable(feature = "rust1", since = "1.0.0")]
496 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
497 };
498}
499
500macro_rules! shl_impl_all {
501 ($($t:ty)*) => ($(
502 shl_impl! { $t, u8 }
503 shl_impl! { $t, u16 }
504 shl_impl! { $t, u32 }
505 shl_impl! { $t, u64 }
506 shl_impl! { $t, u128 }
507 shl_impl! { $t, usize }
508
509 shl_impl! { $t, i8 }
510 shl_impl! { $t, i16 }
511 shl_impl! { $t, i32 }
512 shl_impl! { $t, i64 }
513 shl_impl! { $t, i128 }
514 shl_impl! { $t, isize }
515 )*)
516}
517
518#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Shl<isize> for &isize {
type Output = <isize as Shl<isize>>::Output;
#[inline]
#[track_caller]
fn shl(self, other: isize) -> <isize as Shl<isize>>::Output {
Shl::shl(*self, other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Shl<&isize> for isize {
type Output = <isize as Shl<isize>>::Output;
#[inline]
#[track_caller]
fn shl(self, other: &isize) -> <isize as Shl<isize>>::Output {
Shl::shl(self, *other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Shl<&isize> for &isize {
type Output = <isize as Shl<isize>>::Output;
#[inline]
#[track_caller]
fn shl(self, other: &isize) -> <isize as Shl<isize>>::Output {
Shl::shl(*self, *other)
}
}shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
519
520#[lang = "shr"]
577#[doc(alias = ">>")]
578#[stable(feature = "rust1", since = "1.0.0")]
579#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
580#[diagnostic::on_unimplemented(
581 message = "no implementation for `{Self} >> {Rhs}`",
582 label = "no implementation for `{Self} >> {Rhs}`"
583)]
584pub const trait Shr<Rhs = Self> {
585 #[stable(feature = "rust1", since = "1.0.0")]
587 type Output;
588
589 #[must_use]
598 #[stable(feature = "rust1", since = "1.0.0")]
599 fn shr(self, rhs: Rhs) -> Self::Output;
600}
601
602macro_rules! shr_impl {
603 ($t:ty, $f:ty) => {
604 #[stable(feature = "rust1", since = "1.0.0")]
605 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
606 impl const Shr<$f> for $t {
607 type Output = $t;
608
609 #[inline]
610 #[track_caller]
611 #[rustc_inherit_overflow_checks]
612 fn shr(self, other: $f) -> $t {
613 self >> other
614 }
615 }
616
617 forward_ref_binop! { impl Shr, shr for $t, $f,
618 #[stable(feature = "rust1", since = "1.0.0")]
619 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
620 };
621}
622
623macro_rules! shr_impl_all {
624 ($($t:ty)*) => ($(
625 shr_impl! { $t, u8 }
626 shr_impl! { $t, u16 }
627 shr_impl! { $t, u32 }
628 shr_impl! { $t, u64 }
629 shr_impl! { $t, u128 }
630 shr_impl! { $t, usize }
631
632 shr_impl! { $t, i8 }
633 shr_impl! { $t, i16 }
634 shr_impl! { $t, i32 }
635 shr_impl! { $t, i64 }
636 shr_impl! { $t, i128 }
637 shr_impl! { $t, isize }
638 )*)
639}
640
641#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Shr<isize> for &isize {
type Output = <isize as Shr<isize>>::Output;
#[inline]
#[track_caller]
fn shr(self, other: isize) -> <isize as Shr<isize>>::Output {
Shr::shr(*self, other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Shr<&isize> for isize {
type Output = <isize as Shr<isize>>::Output;
#[inline]
#[track_caller]
fn shr(self, other: &isize) -> <isize as Shr<isize>>::Output {
Shr::shr(self, *other)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const Shr<&isize> for &isize {
type Output = <isize as Shr<isize>>::Output;
#[inline]
#[track_caller]
fn shr(self, other: &isize) -> <isize as Shr<isize>>::Output {
Shr::shr(*self, *other)
}
}shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
642
643#[lang = "bitand_assign"]
709#[doc(alias = "&=")]
710#[stable(feature = "op_assign_traits", since = "1.8.0")]
711#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
712#[diagnostic::on_unimplemented(
713 message = "no implementation for `{Self} &= {Rhs}`",
714 label = "no implementation for `{Self} &= {Rhs}`"
715)]
716pub const trait BitAndAssign<Rhs = Self> {
717 #[stable(feature = "op_assign_traits", since = "1.8.0")]
739 fn bitand_assign(&mut self, rhs: Rhs);
740}
741
742macro_rules! bitand_assign_impl {
743 ($($t:ty)+) => ($(
744 #[stable(feature = "op_assign_traits", since = "1.8.0")]
745 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
746 impl const BitAndAssign for $t {
747 #[inline]
748 fn bitand_assign(&mut self, other: $t) { *self &= other }
749 }
750
751 forward_ref_op_assign! { impl BitAndAssign, bitand_assign for $t, $t,
752 #[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
753 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
754 )+)
755}
756
757#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitAndAssign<&i128> for i128 {
#[inline]
#[track_caller]
fn bitand_assign(&mut self, other: &i128) {
BitAndAssign::bitand_assign(self, *other);
}
}bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
758
759#[lang = "bitor_assign"]
784#[doc(alias = "|=")]
785#[stable(feature = "op_assign_traits", since = "1.8.0")]
786#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
787#[diagnostic::on_unimplemented(
788 message = "no implementation for `{Self} |= {Rhs}`",
789 label = "no implementation for `{Self} |= {Rhs}`"
790)]
791pub const trait BitOrAssign<Rhs = Self> {
792 #[stable(feature = "op_assign_traits", since = "1.8.0")]
814 fn bitor_assign(&mut self, rhs: Rhs);
815}
816
817macro_rules! bitor_assign_impl {
818 ($($t:ty)+) => ($(
819 #[stable(feature = "op_assign_traits", since = "1.8.0")]
820 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
821 impl const BitOrAssign for $t {
822 #[inline]
823 fn bitor_assign(&mut self, other: $t) { *self |= other }
824 }
825
826 forward_ref_op_assign! { impl BitOrAssign, bitor_assign for $t, $t,
827 #[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
828 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
829 )+)
830}
831
832#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitOrAssign<&i128> for i128 {
#[inline]
#[track_caller]
fn bitor_assign(&mut self, other: &i128) {
BitOrAssign::bitor_assign(self, *other);
}
}bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
833
834#[lang = "bitxor_assign"]
859#[doc(alias = "^=")]
860#[stable(feature = "op_assign_traits", since = "1.8.0")]
861#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
862#[diagnostic::on_unimplemented(
863 message = "no implementation for `{Self} ^= {Rhs}`",
864 label = "no implementation for `{Self} ^= {Rhs}`"
865)]
866pub const trait BitXorAssign<Rhs = Self> {
867 #[stable(feature = "op_assign_traits", since = "1.8.0")]
889 fn bitxor_assign(&mut self, rhs: Rhs);
890}
891
892macro_rules! bitxor_assign_impl {
893 ($($t:ty)+) => ($(
894 #[stable(feature = "op_assign_traits", since = "1.8.0")]
895 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
896 impl const BitXorAssign for $t {
897 #[inline]
898 fn bitxor_assign(&mut self, other: $t) { *self ^= other }
899 }
900
901 forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for $t, $t,
902 #[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
903 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
904 )+)
905}
906
907#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const BitXorAssign<&i128> for i128 {
#[inline]
#[track_caller]
fn bitxor_assign(&mut self, other: &i128) {
BitXorAssign::bitxor_assign(self, *other);
}
}bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
908
909#[lang = "shl_assign"]
932#[doc(alias = "<<=")]
933#[stable(feature = "op_assign_traits", since = "1.8.0")]
934#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
935#[diagnostic::on_unimplemented(
936 message = "no implementation for `{Self} <<= {Rhs}`",
937 label = "no implementation for `{Self} <<= {Rhs}`"
938)]
939pub const trait ShlAssign<Rhs = Self> {
940 #[stable(feature = "op_assign_traits", since = "1.8.0")]
954 fn shl_assign(&mut self, rhs: Rhs);
955}
956
957macro_rules! shl_assign_impl {
958 ($t:ty, $f:ty) => {
959 #[stable(feature = "op_assign_traits", since = "1.8.0")]
960 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
961 impl const ShlAssign<$f> for $t {
962 #[inline]
963 #[track_caller]
964 #[rustc_inherit_overflow_checks]
965 fn shl_assign(&mut self, other: $f) {
966 *self <<= other
967 }
968 }
969
970 forward_ref_op_assign! { impl ShlAssign, shl_assign for $t, $f,
971 #[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
972 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
973 };
974}
975
976macro_rules! shl_assign_impl_all {
977 ($($t:ty)*) => ($(
978 shl_assign_impl! { $t, u8 }
979 shl_assign_impl! { $t, u16 }
980 shl_assign_impl! { $t, u32 }
981 shl_assign_impl! { $t, u64 }
982 shl_assign_impl! { $t, u128 }
983 shl_assign_impl! { $t, usize }
984
985 shl_assign_impl! { $t, i8 }
986 shl_assign_impl! { $t, i16 }
987 shl_assign_impl! { $t, i32 }
988 shl_assign_impl! { $t, i64 }
989 shl_assign_impl! { $t, i128 }
990 shl_assign_impl! { $t, isize }
991 )*)
992}
993
994#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const ShlAssign<&isize> for isize {
#[inline]
#[track_caller]
fn shl_assign(&mut self, other: &isize) {
ShlAssign::shl_assign(self, *other);
}
}shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
995
996#[lang = "shr_assign"]
1019#[doc(alias = ">>=")]
1020#[stable(feature = "op_assign_traits", since = "1.8.0")]
1021#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
1022#[diagnostic::on_unimplemented(
1023 message = "no implementation for `{Self} >>= {Rhs}`",
1024 label = "no implementation for `{Self} >>= {Rhs}`"
1025)]
1026pub const trait ShrAssign<Rhs = Self> {
1027 #[stable(feature = "op_assign_traits", since = "1.8.0")]
1041 fn shr_assign(&mut self, rhs: Rhs);
1042}
1043
1044macro_rules! shr_assign_impl {
1045 ($t:ty, $f:ty) => {
1046 #[stable(feature = "op_assign_traits", since = "1.8.0")]
1047 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
1048 impl const ShrAssign<$f> for $t {
1049 #[inline]
1050 #[track_caller]
1051 #[rustc_inherit_overflow_checks]
1052 fn shr_assign(&mut self, other: $f) {
1053 *self >>= other
1054 }
1055 }
1056
1057 forward_ref_op_assign! { impl ShrAssign, shr_assign for $t, $f,
1058 #[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
1059 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
1060 };
1061}
1062
1063macro_rules! shr_assign_impl_all {
1064 ($($t:ty)*) => ($(
1065 shr_assign_impl! { $t, u8 }
1066 shr_assign_impl! { $t, u16 }
1067 shr_assign_impl! { $t, u32 }
1068 shr_assign_impl! { $t, u64 }
1069 shr_assign_impl! { $t, u128 }
1070 shr_assign_impl! { $t, usize }
1071
1072 shr_assign_impl! { $t, i8 }
1073 shr_assign_impl! { $t, i16 }
1074 shr_assign_impl! { $t, i32 }
1075 shr_assign_impl! { $t, i64 }
1076 shr_assign_impl! { $t, i128 }
1077 shr_assign_impl! { $t, isize }
1078 )*)
1079}
1080
1081#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
impl const ShrAssign<&isize> for isize {
#[inline]
#[track_caller]
fn shr_assign(&mut self, other: &isize) {
ShrAssign::shr_assign(self, *other);
}
}shr_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }