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 154
154
/// [`String`]: ../../std/string/struct.String.html
155
155
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
156
156
#[ rustc_diagnostic_item = "Borrow" ]
157
+ #[ const_trait]
157
158
pub trait Borrow < Borrowed : ?Sized > {
158
159
/// Immutably borrows from an owned value.
159
160
///
@@ -184,6 +185,7 @@ pub trait Borrow<Borrowed: ?Sized> {
184
185
/// an underlying type by providing a mutable reference. See [`Borrow<T>`]
185
186
/// for more information on borrowing as another type.
186
187
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
188
+ #[ const_trait]
187
189
pub trait BorrowMut < Borrowed : ?Sized > : Borrow < Borrowed > {
188
190
/// Mutably borrows from an owned value.
189
191
///
Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ pub trait FromIterator<A>: Sized {
228
228
#[ rustc_diagnostic_item = "IntoIterator" ]
229
229
#[ rustc_skip_array_during_method_dispatch]
230
230
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
231
+ #[ const_trait]
231
232
pub trait IntoIterator {
232
233
/// The type of the elements being iterated over.
233
234
#[ 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 }
938
938
) ]
939
939
#[ doc( alias = "/" ) ]
940
940
#[ doc( alias = "/=" ) ]
941
+ #[ const_trait]
941
942
pub trait DivAssign < Rhs = Self > {
942
943
/// Performs the `/=` operation.
943
944
///
@@ -999,6 +1000,7 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
999
1000
) ]
1000
1001
#[ doc( alias = "%" ) ]
1001
1002
#[ doc( alias = "%=" ) ]
1003
+ #[ const_trait]
1002
1004
pub trait RemAssign < Rhs = Self > {
1003
1005
/// Performs the `%=` operation.
1004
1006
///
Original file line number Diff line number Diff line change 31
31
#[ lang = "not" ]
32
32
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
33
33
#[ doc( alias = "!" ) ]
34
+ #[ const_trait]
34
35
pub trait Not {
35
36
/// The resulting type after applying the `!` operator.
36
37
#[ 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 }
906
907
message = "no implementation for `{Self} <<= {Rhs}`" ,
907
908
label = "no implementation for `{Self} <<= {Rhs}`"
908
909
) ]
910
+ #[ const_trait]
909
911
pub trait ShlAssign < Rhs = Self > {
910
912
/// Performs the `<<=` operation.
911
913
///
@@ -989,6 +991,7 @@ shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
989
991
message = "no implementation for `{Self} >>= {Rhs}`" ,
990
992
label = "no implementation for `{Self} >>= {Rhs}`"
991
993
) ]
994
+ #[ const_trait]
992
995
pub trait ShrAssign < Rhs = Self > {
993
996
/// Performs the `>>=` operation.
994
997
///
Original file line number Diff line number Diff line change 61
61
#[ doc( alias = "&*" ) ]
62
62
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
63
63
#[ rustc_diagnostic_item = "Deref" ]
64
+ #[ const_trait]
64
65
pub trait Deref {
65
66
/// The resulting type after dereferencing.
66
67
#[ 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;
128
128
) ]
129
129
#[ doc( alias = "?" ) ]
130
130
#[ lang = "Try" ]
131
+ #[ const_trait]
131
132
pub trait Try : FromResidual {
132
133
/// The type of the value produced by `?` when *not* short-circuiting.
133
134
#[ unstable( feature = "try_trait_v2" , issue = "84277" ) ]
@@ -384,6 +385,7 @@ pub trait Try: FromResidual {
384
385
) ) ]
385
386
#[ rustc_diagnostic_item = "FromResidual" ]
386
387
#[ unstable( feature = "try_trait_v2" , issue = "84277" ) ]
388
+ #[ const_trait]
387
389
pub trait FromResidual < R = <Self as Try >:: Residual > {
388
390
/// Constructs the type from a compatible `Residual` type.
389
391
///
You can’t perform that action at this time.
0 commit comments