2424
2525use crate :: const_closure:: ConstFnMutClosure ;
2626use crate :: marker:: Destruct ;
27+ #[ cfg( bootstrap) ]
2728use crate :: marker:: StructuralPartialEq ;
2829
2930use self :: Ordering :: * ;
@@ -331,6 +332,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
331332/// assert_eq!(Ordering::Greater, result);
332333/// ```
333334#[ derive( Clone , Copy , Eq , Debug , Hash ) ]
335+ #[ cfg_attr( not( bootstrap) , derive_const( PartialOrd , Ord , PartialEq ) ) ]
334336#[ stable( feature = "rust1" , since = "1.0.0" ) ]
335337#[ repr( i8 ) ]
336338pub enum Ordering {
@@ -877,10 +879,12 @@ pub macro Ord($item:item) {
877879}
878880
879881#[ stable( feature = "rust1" , since = "1.0.0" ) ]
882+ #[ cfg( bootstrap) ]
880883impl StructuralPartialEq for Ordering { }
881884
882885#[ stable( feature = "rust1" , since = "1.0.0" ) ]
883886#[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
887+ #[ cfg( bootstrap) ]
884888impl const PartialEq for Ordering {
885889 #[ inline]
886890 fn eq ( & self , other : & Self ) -> bool {
@@ -890,6 +894,7 @@ impl const PartialEq for Ordering {
890894
891895#[ stable( feature = "rust1" , since = "1.0.0" ) ]
892896#[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
897+ #[ cfg( bootstrap) ]
893898impl const Ord for Ordering {
894899 #[ inline]
895900 fn cmp ( & self , other : & Ordering ) -> Ordering {
@@ -899,6 +904,7 @@ impl const Ord for Ordering {
899904
900905#[ stable( feature = "rust1" , since = "1.0.0" ) ]
901906#[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
907+ #[ cfg( bootstrap) ]
902908impl const PartialOrd for Ordering {
903909 #[ inline]
904910 fn partial_cmp ( & self , other : & Ordering ) -> Option < Ordering > {
0 commit comments