@@ -379,7 +379,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
379
379
// This is a lang item only so that `BinOp::Cmp` in MIR can return it.
380
380
// It has no special behaviour, but does require that the three variants
381
381
// `Less`/`Equal`/`Greater` remain `-1_i8`/`0_i8`/`+1_i8` respectively.
382
- #[ cfg_attr ( not ( bootstrap ) , lang = "Ordering" ) ]
382
+ #[ lang = "Ordering" ]
383
383
#[ repr( i8 ) ]
384
384
pub enum Ordering {
385
385
/// An ordering where a compared value is less than another.
@@ -852,7 +852,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
852
852
#[ stable( feature = "ord_max_min" , since = "1.21.0" ) ]
853
853
#[ inline]
854
854
#[ must_use]
855
- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_ord_max" ) ]
855
+ #[ rustc_diagnostic_item = "cmp_ord_max" ]
856
856
fn max ( self , other : Self ) -> Self
857
857
where
858
858
Self : Sized ,
@@ -873,7 +873,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
873
873
#[ stable( feature = "ord_max_min" , since = "1.21.0" ) ]
874
874
#[ inline]
875
875
#[ must_use]
876
- #[ cfg_attr ( not ( bootstrap ) , rustc_diagnostic_item = "cmp_ord_min" ) ]
876
+ #[ rustc_diagnostic_item = "cmp_ord_min" ]
877
877
fn min ( self , other : Self ) -> Self
878
878
where
879
879
Self : Sized ,
@@ -1160,7 +1160,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1160
1160
/// ```
1161
1161
#[ must_use]
1162
1162
#[ 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" ]
1164
1164
fn partial_cmp ( & self , other : & Rhs ) -> Option < Ordering > ;
1165
1165
1166
1166
/// 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> {
1175
1175
#[ inline]
1176
1176
#[ must_use]
1177
1177
#[ 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" ]
1179
1179
fn lt ( & self , other : & Rhs ) -> bool {
1180
1180
matches ! ( self . partial_cmp( other) , Some ( Less ) )
1181
1181
}
@@ -1193,7 +1193,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1193
1193
#[ inline]
1194
1194
#[ must_use]
1195
1195
#[ 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" ]
1197
1197
fn le ( & self , other : & Rhs ) -> bool {
1198
1198
matches ! ( self . partial_cmp( other) , Some ( Less | Equal ) )
1199
1199
}
@@ -1210,7 +1210,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1210
1210
#[ inline]
1211
1211
#[ must_use]
1212
1212
#[ 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" ]
1214
1214
fn gt ( & self , other : & Rhs ) -> bool {
1215
1215
matches ! ( self . partial_cmp( other) , Some ( Greater ) )
1216
1216
}
@@ -1228,7 +1228,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1228
1228
#[ inline]
1229
1229
#[ must_use]
1230
1230
#[ 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" ]
1232
1232
fn ge ( & self , other : & Rhs ) -> bool {
1233
1233
matches ! ( self . partial_cmp( other) , Some ( Greater | Equal ) )
1234
1234
}
@@ -1558,14 +1558,7 @@ mod impls {
1558
1558
impl PartialOrd for $t {
1559
1559
#[ inline]
1560
1560
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) )
1569
1562
}
1570
1563
#[ inline( always) ]
1571
1564
fn lt( & self , other: & $t) -> bool { ( * self ) < ( * other) }
@@ -1581,18 +1574,7 @@ mod impls {
1581
1574
impl Ord for $t {
1582
1575
#[ inline]
1583
1576
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)
1596
1578
}
1597
1579
}
1598
1580
) * )
0 commit comments