This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +11
-0
lines changed Expand file tree Collapse file tree 6 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 154154/// [`String`]: ../../std/string/struct.String.html
155155#[ stable( feature = "rust1" , since = "1.0.0" ) ]
156156#[ rustc_diagnostic_item = "Borrow" ]
157+ #[ const_trait]
157158pub trait Borrow < Borrowed : ?Sized > {
158159 /// Immutably borrows from an owned value.
159160 ///
@@ -184,6 +185,7 @@ pub trait Borrow<Borrowed: ?Sized> {
184185/// an underlying type by providing a mutable reference. See [`Borrow<T>`]
185186/// for more information on borrowing as another type.
186187#[ stable( feature = "rust1" , since = "1.0.0" ) ]
188+ #[ const_trait]
187189pub trait BorrowMut < Borrowed : ?Sized > : Borrow < Borrowed > {
188190 /// Mutably borrows from an owned value.
189191 ///
Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ pub trait FromIterator<A>: Sized {
228228#[ rustc_diagnostic_item = "IntoIterator" ]
229229#[ rustc_skip_array_during_method_dispatch]
230230#[ stable( feature = "rust1" , since = "1.0.0" ) ]
231+ #[ const_trait]
231232pub trait IntoIterator {
232233 /// The type of the elements being iterated over.
233234 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -938,6 +938,7 @@ mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
938938) ]
939939#[ doc( alias = "/" ) ]
940940#[ doc( alias = "/=" ) ]
941+ #[ const_trait]
941942pub trait DivAssign < Rhs = Self > {
942943 /// Performs the `/=` operation.
943944 ///
@@ -999,6 +1000,7 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
9991000) ]
10001001#[ doc( alias = "%" ) ]
10011002#[ doc( alias = "%=" ) ]
1003+ #[ const_trait]
10021004pub trait RemAssign < Rhs = Self > {
10031005 /// Performs the `%=` operation.
10041006 ///
Original file line number Diff line number Diff line change 3131#[ lang = "not" ]
3232#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3333#[ doc( alias = "!" ) ]
34+ #[ const_trait]
3435pub trait Not {
3536 /// The resulting type after applying the `!` operator.
3637 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -906,6 +907,7 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
906907 message = "no implementation for `{Self} <<= {Rhs}`" ,
907908 label = "no implementation for `{Self} <<= {Rhs}`"
908909) ]
910+ #[ const_trait]
909911pub trait ShlAssign < Rhs = Self > {
910912 /// Performs the `<<=` operation.
911913 ///
@@ -989,6 +991,7 @@ shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
989991 message = "no implementation for `{Self} >>= {Rhs}`" ,
990992 label = "no implementation for `{Self} >>= {Rhs}`"
991993) ]
994+ #[ const_trait]
992995pub trait ShrAssign < Rhs = Self > {
993996 /// Performs the `>>=` operation.
994997 ///
Original file line number Diff line number Diff line change 6161#[ doc( alias = "&*" ) ]
6262#[ stable( feature = "rust1" , since = "1.0.0" ) ]
6363#[ rustc_diagnostic_item = "Deref" ]
64+ #[ const_trait]
6465pub trait Deref {
6566 /// The resulting type after dereferencing.
6667 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ use crate::ops::ControlFlow;
128128) ]
129129#[ doc( alias = "?" ) ]
130130#[ lang = "Try" ]
131+ #[ const_trait]
131132pub trait Try : FromResidual {
132133 /// The type of the value produced by `?` when *not* short-circuiting.
133134 #[ unstable( feature = "try_trait_v2" , issue = "84277" ) ]
@@ -384,6 +385,7 @@ pub trait Try: FromResidual {
384385) ) ]
385386#[ rustc_diagnostic_item = "FromResidual" ]
386387#[ unstable( feature = "try_trait_v2" , issue = "84277" ) ]
388+ #[ const_trait]
387389pub trait FromResidual < R = <Self as Try >:: Residual > {
388390 /// Constructs the type from a compatible `Residual` type.
389391 ///
You can’t perform that action at this time.
0 commit comments