@@ -379,7 +379,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
379379// This is a lang item only so that `BinOp::Cmp` in MIR can return it.
380380// It has no special behaviour, but does require that the three variants
381381// `Less`/`Equal`/`Greater` remain `-1_i8`/`0_i8`/`+1_i8` respectively.
382- #[ cfg_attr ( not ( bootstrap ) , lang = "Ordering" ) ]
382+ #[ lang = "Ordering" ]
383383#[ repr( i8 ) ]
384384pub enum Ordering {
385385 /// An ordering where a compared value is less than another.
@@ -852,7 +852,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
852852 #[ stable( feature = "ord_max_min" , since = "1.21.0" ) ]
853853 #[ inline]
854854 #[ must_use]
855- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_ord_max" ) ]
855+ #[ rustc_diagnostic_item = "cmp_ord_max" ]
856856 fn max ( self , other : Self ) -> Self
857857 where
858858 Self : Sized ,
@@ -873,7 +873,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
873873 #[ stable( feature = "ord_max_min" , since = "1.21.0" ) ]
874874 #[ inline]
875875 #[ must_use]
876- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_ord_min" ) ]
876+ #[ rustc_diagnostic_item = "cmp_ord_min" ]
877877 fn min ( self , other : Self ) -> Self
878878 where
879879 Self : Sized ,
@@ -1160,7 +1160,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11601160 /// ```
11611161 #[ must_use]
11621162 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1163- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_partialord_cmp" ) ]
1163+ #[ rustc_diagnostic_item = "cmp_partialord_cmp" ]
11641164 fn partial_cmp ( & self , other : & Rhs ) -> Option < Ordering > ;
11651165
11661166 /// This method tests less than (for `self` and `other`) and is used by the `<` operator.
@@ -1175,7 +1175,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11751175 #[ inline]
11761176 #[ must_use]
11771177 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1178- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_partialord_lt" ) ]
1178+ #[ rustc_diagnostic_item = "cmp_partialord_lt" ]
11791179 fn lt ( & self , other : & Rhs ) -> bool {
11801180 matches ! ( self . partial_cmp( other) , Some ( Less ) )
11811181 }
@@ -1193,7 +1193,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11931193 #[ inline]
11941194 #[ must_use]
11951195 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1196- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_partialord_le" ) ]
1196+ #[ rustc_diagnostic_item = "cmp_partialord_le" ]
11971197 fn le ( & self , other : & Rhs ) -> bool {
11981198 matches ! ( self . partial_cmp( other) , Some ( Less | Equal ) )
11991199 }
@@ -1210,7 +1210,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
12101210 #[ inline]
12111211 #[ must_use]
12121212 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1213- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_partialord_gt" ) ]
1213+ #[ rustc_diagnostic_item = "cmp_partialord_gt" ]
12141214 fn gt ( & self , other : & Rhs ) -> bool {
12151215 matches ! ( self . partial_cmp( other) , Some ( Greater ) )
12161216 }
@@ -1228,7 +1228,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
12281228 #[ inline]
12291229 #[ must_use]
12301230 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1231- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_partialord_ge" ) ]
1231+ #[ rustc_diagnostic_item = "cmp_partialord_ge" ]
12321232 fn ge ( & self , other : & Rhs ) -> bool {
12331233 matches ! ( self . partial_cmp( other) , Some ( Greater | Equal ) )
12341234 }
@@ -1558,14 +1558,7 @@ mod impls {
15581558 impl PartialOrd for $t {
15591559 #[ inline]
15601560 fn partial_cmp( & self , other: & $t) -> Option <Ordering > {
1561- #[ cfg( bootstrap) ]
1562- {
1563- Some ( self . cmp( other) )
1564- }
1565- #[ cfg( not( bootstrap) ) ]
1566- {
1567- Some ( crate :: intrinsics:: three_way_compare( * self , * other) )
1568- }
1561+ Some ( crate :: intrinsics:: three_way_compare( * self , * other) )
15691562 }
15701563 #[ inline( always) ]
15711564 fn lt( & self , other: & $t) -> bool { ( * self ) < ( * other) }
@@ -1581,18 +1574,7 @@ mod impls {
15811574 impl Ord for $t {
15821575 #[ inline]
15831576 fn cmp( & self , other: & $t) -> Ordering {
1584- #[ cfg( bootstrap) ]
1585- {
1586- // The order here is important to generate more optimal assembly.
1587- // See <https://github.com/rust-lang/rust/issues/63758> for more info.
1588- if * self < * other { Less }
1589- else if * self == * other { Equal }
1590- else { Greater }
1591- }
1592- #[ cfg( not( bootstrap) ) ]
1593- {
1594- crate :: intrinsics:: three_way_compare( * self , * other)
1595- }
1577+ crate :: intrinsics:: three_way_compare( * self , * other)
15961578 }
15971579 }
15981580 ) * )
0 commit comments