31
31
#[ lang = "not" ]
32
32
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
33
33
#[ doc( alias = "!" ) ]
34
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
35
+ #[ const_trait]
34
36
pub trait Not {
35
37
/// The resulting type after applying the `!` operator.
36
38
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -54,7 +56,8 @@ pub trait Not {
54
56
macro_rules! not_impl {
55
57
( $( $t: ty) * ) => ( $(
56
58
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
57
- impl Not for $t {
59
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
60
+ impl const Not for $t {
58
61
type Output = $t;
59
62
60
63
#[ inline]
@@ -68,7 +71,8 @@ macro_rules! not_impl {
68
71
not_impl ! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
69
72
70
73
#[ stable( feature = "not_never" , since = "1.60.0" ) ]
71
- impl Not for ! {
74
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
75
+ impl const Not for ! {
72
76
type Output = !;
73
77
74
78
#[ inline]
@@ -141,6 +145,8 @@ impl Not for ! {
141
145
message = "no implementation for `{Self} & {Rhs}`" ,
142
146
label = "no implementation for `{Self} & {Rhs}`"
143
147
) ]
148
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
149
+ #[ const_trait]
144
150
pub trait BitAnd < Rhs = Self > {
145
151
/// The resulting type after applying the `&` operator.
146
152
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -164,7 +170,8 @@ pub trait BitAnd<Rhs = Self> {
164
170
macro_rules! bitand_impl {
165
171
( $( $t: ty) * ) => ( $(
166
172
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
167
- impl BitAnd for $t {
173
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
174
+ impl const BitAnd for $t {
168
175
type Output = $t;
169
176
170
177
#[ inline]
@@ -241,6 +248,8 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
241
248
message = "no implementation for `{Self} | {Rhs}`" ,
242
249
label = "no implementation for `{Self} | {Rhs}`"
243
250
) ]
251
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
252
+ #[ const_trait]
244
253
pub trait BitOr < Rhs = Self > {
245
254
/// The resulting type after applying the `|` operator.
246
255
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -264,7 +273,8 @@ pub trait BitOr<Rhs = Self> {
264
273
macro_rules! bitor_impl {
265
274
( $( $t: ty) * ) => ( $(
266
275
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
267
- impl BitOr for $t {
276
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
277
+ impl const BitOr for $t {
268
278
type Output = $t;
269
279
270
280
#[ inline]
@@ -341,6 +351,8 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
341
351
message = "no implementation for `{Self} ^ {Rhs}`" ,
342
352
label = "no implementation for `{Self} ^ {Rhs}`"
343
353
) ]
354
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
355
+ #[ const_trait]
344
356
pub trait BitXor < Rhs = Self > {
345
357
/// The resulting type after applying the `^` operator.
346
358
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -364,7 +376,8 @@ pub trait BitXor<Rhs = Self> {
364
376
macro_rules! bitxor_impl {
365
377
( $( $t: ty) * ) => ( $(
366
378
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
367
- impl BitXor for $t {
379
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
380
+ impl const BitXor for $t {
368
381
type Output = $t;
369
382
370
383
#[ inline]
@@ -440,6 +453,8 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
440
453
message = "no implementation for `{Self} << {Rhs}`" ,
441
454
label = "no implementation for `{Self} << {Rhs}`"
442
455
) ]
456
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
457
+ #[ const_trait]
443
458
pub trait Shl < Rhs = Self > {
444
459
/// The resulting type after applying the `<<` operator.
445
460
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -461,7 +476,8 @@ pub trait Shl<Rhs = Self> {
461
476
macro_rules! shl_impl {
462
477
( $t: ty, $f: ty) => {
463
478
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
464
- impl Shl <$f> for $t {
479
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
480
+ impl const Shl <$f> for $t {
465
481
type Output = $t;
466
482
467
483
#[ inline]
@@ -558,6 +574,8 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
558
574
message = "no implementation for `{Self} >> {Rhs}`" ,
559
575
label = "no implementation for `{Self} >> {Rhs}`"
560
576
) ]
577
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
578
+ #[ const_trait]
561
579
pub trait Shr < Rhs = Self > {
562
580
/// The resulting type after applying the `>>` operator.
563
581
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -579,7 +597,8 @@ pub trait Shr<Rhs = Self> {
579
597
macro_rules! shr_impl {
580
598
( $t: ty, $f: ty) => {
581
599
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
582
- impl Shr <$f> for $t {
600
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
601
+ impl const Shr <$f> for $t {
583
602
type Output = $t;
584
603
585
604
#[ inline]
@@ -685,6 +704,8 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
685
704
message = "no implementation for `{Self} &= {Rhs}`" ,
686
705
label = "no implementation for `{Self} &= {Rhs}`"
687
706
) ]
707
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
708
+ #[ const_trait]
688
709
pub trait BitAndAssign < Rhs = Self > {
689
710
/// Performs the `&=` operation.
690
711
///
@@ -714,7 +735,8 @@ pub trait BitAndAssign<Rhs = Self> {
714
735
macro_rules! bitand_assign_impl {
715
736
( $( $t: ty) +) => ( $(
716
737
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
717
- impl BitAndAssign for $t {
738
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
739
+ impl const BitAndAssign for $t {
718
740
#[ inline]
719
741
fn bitand_assign( & mut self , other: $t) { * self &= other }
720
742
}
@@ -756,6 +778,8 @@ bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
756
778
message = "no implementation for `{Self} |= {Rhs}`" ,
757
779
label = "no implementation for `{Self} |= {Rhs}`"
758
780
) ]
781
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
782
+ #[ const_trait]
759
783
pub trait BitOrAssign < Rhs = Self > {
760
784
/// Performs the `|=` operation.
761
785
///
@@ -785,7 +809,8 @@ pub trait BitOrAssign<Rhs = Self> {
785
809
macro_rules! bitor_assign_impl {
786
810
( $( $t: ty) +) => ( $(
787
811
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
788
- impl BitOrAssign for $t {
812
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
813
+ impl const BitOrAssign for $t {
789
814
#[ inline]
790
815
fn bitor_assign( & mut self , other: $t) { * self |= other }
791
816
}
@@ -827,6 +852,8 @@ bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
827
852
message = "no implementation for `{Self} ^= {Rhs}`" ,
828
853
label = "no implementation for `{Self} ^= {Rhs}`"
829
854
) ]
855
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
856
+ #[ const_trait]
830
857
pub trait BitXorAssign < Rhs = Self > {
831
858
/// Performs the `^=` operation.
832
859
///
@@ -856,7 +883,8 @@ pub trait BitXorAssign<Rhs = Self> {
856
883
macro_rules! bitxor_assign_impl {
857
884
( $( $t: ty) +) => ( $(
858
885
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
859
- impl BitXorAssign for $t {
886
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
887
+ impl const BitXorAssign for $t {
860
888
#[ inline]
861
889
fn bitxor_assign( & mut self , other: $t) { * self ^= other }
862
890
}
@@ -896,6 +924,8 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
896
924
message = "no implementation for `{Self} <<= {Rhs}`" ,
897
925
label = "no implementation for `{Self} <<= {Rhs}`"
898
926
) ]
927
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
928
+ #[ const_trait]
899
929
pub trait ShlAssign < Rhs = Self > {
900
930
/// Performs the `<<=` operation.
901
931
///
@@ -917,7 +947,8 @@ pub trait ShlAssign<Rhs = Self> {
917
947
macro_rules! shl_assign_impl {
918
948
( $t: ty, $f: ty) => {
919
949
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
920
- impl ShlAssign <$f> for $t {
950
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
951
+ impl const ShlAssign <$f> for $t {
921
952
#[ inline]
922
953
#[ rustc_inherit_overflow_checks]
923
954
fn shl_assign( & mut self , other: $f) {
@@ -978,6 +1009,8 @@ shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
978
1009
message = "no implementation for `{Self} >>= {Rhs}`" ,
979
1010
label = "no implementation for `{Self} >>= {Rhs}`"
980
1011
) ]
1012
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
1013
+ #[ const_trait]
981
1014
pub trait ShrAssign < Rhs = Self > {
982
1015
/// Performs the `>>=` operation.
983
1016
///
@@ -999,7 +1032,8 @@ pub trait ShrAssign<Rhs = Self> {
999
1032
macro_rules! shr_assign_impl {
1000
1033
( $t: ty, $f: ty) => {
1001
1034
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
1002
- impl ShrAssign <$f> for $t {
1035
+ #[ rustc_const_unstable( feature = "const_bitops" , issue = "144119" ) ]
1036
+ impl const ShrAssign <$f> for $t {
1003
1037
#[ inline]
1004
1038
#[ rustc_inherit_overflow_checks]
1005
1039
fn shr_assign( & mut self , other: $f) {
0 commit comments