@@ -214,6 +214,7 @@ use self::Ordering::*;
214
214
append_const_msg,
215
215
)
216
216
) ]
217
+ #[ cfg_attr( not( bootstrap) , const_trait) ]
217
218
#[ rustc_diagnostic_item = "PartialEq" ]
218
219
pub trait PartialEq < Rhs : ?Sized = Self > {
219
220
/// This method tests for `self` and `other` values to be equal, and is used
@@ -226,7 +227,7 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
226
227
#[ inline]
227
228
#[ must_use]
228
229
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
229
- #[ default_method_body_is_const]
230
+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
230
231
fn ne ( & self , other : & Rhs ) -> bool {
231
232
!self . eq ( other)
232
233
}
@@ -1053,6 +1054,7 @@ impl PartialOrd for Ordering {
1053
1054
append_const_msg,
1054
1055
)
1055
1056
) ]
1057
+ #[ cfg_attr( not( bootstrap) , const_trait) ]
1056
1058
#[ rustc_diagnostic_item = "PartialOrd" ]
1057
1059
pub trait PartialOrd < Rhs : ?Sized = Self > : PartialEq < Rhs > {
1058
1060
/// This method returns an ordering between `self` and `other` values if one exists.
@@ -1096,7 +1098,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1096
1098
#[ inline]
1097
1099
#[ must_use]
1098
1100
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1099
- #[ default_method_body_is_const]
1101
+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
1100
1102
fn lt ( & self , other : & Rhs ) -> bool {
1101
1103
matches ! ( self . partial_cmp( other) , Some ( Less ) )
1102
1104
}
@@ -1116,7 +1118,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1116
1118
#[ inline]
1117
1119
#[ must_use]
1118
1120
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1119
- #[ default_method_body_is_const]
1121
+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
1120
1122
fn le ( & self , other : & Rhs ) -> bool {
1121
1123
// Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`.
1122
1124
// FIXME: The root cause was fixed upstream in LLVM with:
@@ -1139,7 +1141,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1139
1141
#[ inline]
1140
1142
#[ must_use]
1141
1143
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1142
- #[ default_method_body_is_const]
1144
+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
1143
1145
fn gt ( & self , other : & Rhs ) -> bool {
1144
1146
matches ! ( self . partial_cmp( other) , Some ( Greater ) )
1145
1147
}
@@ -1159,7 +1161,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1159
1161
#[ inline]
1160
1162
#[ must_use]
1161
1163
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1162
- #[ default_method_body_is_const]
1164
+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
1163
1165
fn ge ( & self , other : & Rhs ) -> bool {
1164
1166
matches ! ( self . partial_cmp( other) , Some ( Greater | Equal ) )
1165
1167
}
0 commit comments