@@ -214,6 +214,7 @@ use self::Ordering::*;
214214 append_const_msg,
215215 )
216216) ]
217+ #[ cfg_attr( not( bootstrap) , const_trait) ]
217218#[ rustc_diagnostic_item = "PartialEq" ]
218219pub trait PartialEq < Rhs : ?Sized = Self > {
219220 /// This method tests for `self` and `other` values to be equal, and is used
@@ -226,7 +227,7 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
226227 #[ inline]
227228 #[ must_use]
228229 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
229- #[ default_method_body_is_const]
230+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
230231 fn ne ( & self , other : & Rhs ) -> bool {
231232 !self . eq ( other)
232233 }
@@ -1053,6 +1054,7 @@ impl PartialOrd for Ordering {
10531054 append_const_msg,
10541055 )
10551056) ]
1057+ #[ cfg_attr( not( bootstrap) , const_trait) ]
10561058#[ rustc_diagnostic_item = "PartialOrd" ]
10571059pub trait PartialOrd < Rhs : ?Sized = Self > : PartialEq < Rhs > {
10581060 /// 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> {
10961098 #[ inline]
10971099 #[ must_use]
10981100 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1099- #[ default_method_body_is_const]
1101+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
11001102 fn lt ( & self , other : & Rhs ) -> bool {
11011103 matches ! ( self . partial_cmp( other) , Some ( Less ) )
11021104 }
@@ -1116,7 +1118,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11161118 #[ inline]
11171119 #[ must_use]
11181120 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1119- #[ default_method_body_is_const]
1121+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
11201122 fn le ( & self , other : & Rhs ) -> bool {
11211123 // Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`.
11221124 // FIXME: The root cause was fixed upstream in LLVM with:
@@ -1139,7 +1141,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11391141 #[ inline]
11401142 #[ must_use]
11411143 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1142- #[ default_method_body_is_const]
1144+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
11431145 fn gt ( & self , other : & Rhs ) -> bool {
11441146 matches ! ( self . partial_cmp( other) , Some ( Greater ) )
11451147 }
@@ -1159,7 +1161,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11591161 #[ inline]
11601162 #[ must_use]
11611163 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1162- #[ default_method_body_is_const]
1164+ #[ cfg_attr ( bootstrap , default_method_body_is_const) ]
11631165 fn ge ( & self , other : & Rhs ) -> bool {
11641166 matches ! ( self . partial_cmp( other) , Some ( Greater | Equal ) )
11651167 }
0 commit comments