6565/// ```
6666#[ lang = "add" ]
6767#[ stable( feature = "rust1" , since = "1.0.0" ) ]
68- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
68+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
6969#[ rustc_on_unimplemented(
7070 on( all( Self = "{integer}" , Rhs = "{float}" ) , message = "cannot add a float to an integer" , ) ,
7171 on( all( Self = "{float}" , Rhs = "{integer}" ) , message = "cannot add an integer to a float" , ) ,
@@ -96,7 +96,7 @@ pub trait Add<Rhs = Self> {
9696macro_rules! add_impl {
9797 ( $( $t: ty) * ) => ( $(
9898 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
99- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
99+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
100100 impl const Add for $t {
101101 type Output = $t;
102102
@@ -180,7 +180,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
180180/// ```
181181#[ lang = "sub" ]
182182#[ stable( feature = "rust1" , since = "1.0.0" ) ]
183- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
183+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
184184#[ rustc_on_unimplemented(
185185 message = "cannot subtract `{Rhs}` from `{Self}`" ,
186186 label = "no implementation for `{Self} - {Rhs}`" ,
@@ -209,7 +209,7 @@ pub trait Sub<Rhs = Self> {
209209macro_rules! sub_impl {
210210 ( $( $t: ty) * ) => ( $(
211211 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
212- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
212+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
213213 impl const Sub for $t {
214214 type Output = $t;
215215
@@ -315,7 +315,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
315315/// ```
316316#[ lang = "mul" ]
317317#[ stable( feature = "rust1" , since = "1.0.0" ) ]
318- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
318+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
319319#[ diagnostic:: on_unimplemented(
320320 message = "cannot multiply `{Self}` by `{Rhs}`" ,
321321 label = "no implementation for `{Self} * {Rhs}`"
@@ -343,7 +343,7 @@ pub trait Mul<Rhs = Self> {
343343macro_rules! mul_impl {
344344 ( $( $t: ty) * ) => ( $(
345345 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
346- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
346+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
347347 impl const Mul for $t {
348348 type Output = $t;
349349
@@ -453,7 +453,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
453453/// ```
454454#[ lang = "div" ]
455455#[ stable( feature = "rust1" , since = "1.0.0" ) ]
456- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
456+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
457457#[ diagnostic:: on_unimplemented(
458458 message = "cannot divide `{Self}` by `{Rhs}`" ,
459459 label = "no implementation for `{Self} / {Rhs}`"
@@ -487,7 +487,7 @@ macro_rules! div_impl_integer {
487487 ///
488488 #[ doc = $panic]
489489 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
490- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
490+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
491491 impl const Div for $t {
492492 type Output = $t;
493493
@@ -509,7 +509,7 @@ div_impl_integer! {
509509macro_rules! div_impl_float {
510510 ( $( $t: ty) * ) => ( $(
511511 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
512- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
512+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
513513 impl const Div for $t {
514514 type Output = $t;
515515
@@ -561,7 +561,7 @@ div_impl_float! { f16 f32 f64 f128 }
561561/// ```
562562#[ lang = "rem" ]
563563#[ stable( feature = "rust1" , since = "1.0.0" ) ]
564- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
564+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
565565#[ diagnostic:: on_unimplemented(
566566 message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`" ,
567567 label = "no implementation for `{Self} % {Rhs}`"
@@ -595,7 +595,7 @@ macro_rules! rem_impl_integer {
595595 ///
596596 #[ doc = $panic]
597597 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
598- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
598+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
599599 impl const Rem for $t {
600600 type Output = $t;
601601
@@ -632,7 +632,7 @@ macro_rules! rem_impl_float {
632632 /// assert_eq!(x % y, remainder);
633633 /// ```
634634 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
635- #[ rustc_const_unstable( feature = "const_ops " , issue = "143802" ) ]
635+ #[ rustc_const_unstable( feature = "const_arith_ops " , issue = "143802" ) ]
636636 impl const Rem for $t {
637637 type Output = $t;
638638
@@ -685,7 +685,9 @@ rem_impl_float! { f16 f32 f64 f128 }
685685/// ```
686686#[ lang = "neg" ]
687687#[ stable( feature = "rust1" , since = "1.0.0" ) ]
688+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
688689#[ doc( alias = "-" ) ]
690+ #[ const_trait]
689691pub trait Neg {
690692 /// The resulting type after applying the `-` operator.
691693 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -708,7 +710,8 @@ pub trait Neg {
708710macro_rules! neg_impl {
709711 ( $( $t: ty) * ) => ( $(
710712 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
711- impl Neg for $t {
713+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
714+ impl const Neg for $t {
712715 type Output = $t;
713716
714717 #[ inline]
@@ -754,12 +757,14 @@ neg_impl! { isize i8 i16 i32 i64 i128 f16 f32 f64 f128 }
754757/// ```
755758#[ lang = "add_assign" ]
756759#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
760+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
757761#[ diagnostic:: on_unimplemented(
758762 message = "cannot add-assign `{Rhs}` to `{Self}`" ,
759763 label = "no implementation for `{Self} += {Rhs}`"
760764) ]
761765#[ doc( alias = "+" ) ]
762766#[ doc( alias = "+=" ) ]
767+ #[ const_trait]
763768pub trait AddAssign < Rhs = Self > {
764769 /// Performs the `+=` operation.
765770 ///
@@ -777,7 +782,8 @@ pub trait AddAssign<Rhs = Self> {
777782macro_rules! add_assign_impl {
778783 ( $( $t: ty) +) => ( $(
779784 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
780- impl AddAssign for $t {
785+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
786+ impl const AddAssign for $t {
781787 #[ inline]
782788 #[ track_caller]
783789 #[ rustc_inherit_overflow_checks]
@@ -822,12 +828,14 @@ add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f
822828/// ```
823829#[ lang = "sub_assign" ]
824830#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
831+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
825832#[ diagnostic:: on_unimplemented(
826833 message = "cannot subtract-assign `{Rhs}` from `{Self}`" ,
827834 label = "no implementation for `{Self} -= {Rhs}`"
828835) ]
829836#[ doc( alias = "-" ) ]
830837#[ doc( alias = "-=" ) ]
838+ #[ const_trait]
831839pub trait SubAssign < Rhs = Self > {
832840 /// Performs the `-=` operation.
833841 ///
@@ -845,7 +853,8 @@ pub trait SubAssign<Rhs = Self> {
845853macro_rules! sub_assign_impl {
846854 ( $( $t: ty) +) => ( $(
847855 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
848- impl SubAssign for $t {
856+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
857+ impl const SubAssign for $t {
849858 #[ inline]
850859 #[ track_caller]
851860 #[ rustc_inherit_overflow_checks]
@@ -881,12 +890,14 @@ sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f
881890/// ```
882891#[ lang = "mul_assign" ]
883892#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
893+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
884894#[ diagnostic:: on_unimplemented(
885895 message = "cannot multiply-assign `{Self}` by `{Rhs}`" ,
886896 label = "no implementation for `{Self} *= {Rhs}`"
887897) ]
888898#[ doc( alias = "*" ) ]
889899#[ doc( alias = "*=" ) ]
900+ #[ const_trait]
890901pub trait MulAssign < Rhs = Self > {
891902 /// Performs the `*=` operation.
892903 ///
@@ -904,7 +915,8 @@ pub trait MulAssign<Rhs = Self> {
904915macro_rules! mul_assign_impl {
905916 ( $( $t: ty) +) => ( $(
906917 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
907- impl MulAssign for $t {
918+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
919+ impl const MulAssign for $t {
908920 #[ inline]
909921 #[ track_caller]
910922 #[ rustc_inherit_overflow_checks]
@@ -940,12 +952,14 @@ mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f
940952/// ```
941953#[ lang = "div_assign" ]
942954#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
955+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
943956#[ diagnostic:: on_unimplemented(
944957 message = "cannot divide-assign `{Self}` by `{Rhs}`" ,
945958 label = "no implementation for `{Self} /= {Rhs}`"
946959) ]
947960#[ doc( alias = "/" ) ]
948961#[ doc( alias = "/=" ) ]
962+ #[ const_trait]
949963pub trait DivAssign < Rhs = Self > {
950964 /// Performs the `/=` operation.
951965 ///
@@ -963,7 +977,8 @@ pub trait DivAssign<Rhs = Self> {
963977macro_rules! div_assign_impl {
964978 ( $( $t: ty) +) => ( $(
965979 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
966- impl DivAssign for $t {
980+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
981+ impl const DivAssign for $t {
967982 #[ inline]
968983 #[ track_caller]
969984 fn div_assign( & mut self , other: $t) { * self /= other }
@@ -1002,12 +1017,14 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f
10021017/// ```
10031018#[ lang = "rem_assign" ]
10041019#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
1020+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
10051021#[ diagnostic:: on_unimplemented(
10061022 message = "cannot calculate and assign the remainder of `{Self}` divided by `{Rhs}`" ,
10071023 label = "no implementation for `{Self} %= {Rhs}`"
10081024) ]
10091025#[ doc( alias = "%" ) ]
10101026#[ doc( alias = "%=" ) ]
1027+ #[ const_trait]
10111028pub trait RemAssign < Rhs = Self > {
10121029 /// Performs the `%=` operation.
10131030 ///
@@ -1025,7 +1042,8 @@ pub trait RemAssign<Rhs = Self> {
10251042macro_rules! rem_assign_impl {
10261043 ( $( $t: ty) +) => ( $(
10271044 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
1028- impl RemAssign for $t {
1045+ #[ rustc_const_unstable( feature = "const_arith_ops" , issue = "143802" ) ]
1046+ impl const RemAssign for $t {
10291047 #[ inline]
10301048 #[ track_caller]
10311049 fn rem_assign( & mut self , other: $t) { * self %= other }
0 commit comments