@@ -747,7 +747,14 @@ impl TraitAliasPart {
747747 path. push ( format ! ( "{remote_item_type}.{}.js" , remote_path[ remote_path. len( ) - 1 ] ) ) ;
748748
749749 let mut implementors = implementors. collect :: < Vec < _ > > ( ) ;
750- implementors. sort_unstable ( ) ;
750+ implementors. sort_unstable_by ( |a, b| {
751+ // We sort negative impls first.
752+ match ( a. is_negative , b. is_negative ) {
753+ ( false , true ) => Ordering :: Greater ,
754+ ( true , false ) => Ordering :: Less ,
755+ _ => compare_names ( & a. text , & b. text ) ,
756+ }
757+ } ) ;
751758
752759 let part = OrderedJson :: array_unsorted (
753760 implementors
@@ -762,7 +769,6 @@ impl TraitAliasPart {
762769 }
763770}
764771
765- #[ derive( Eq ) ]
766772struct Implementor {
767773 text : String ,
768774 synthetic : bool ,
@@ -786,29 +792,6 @@ impl Serialize for Implementor {
786792 }
787793}
788794
789- impl PartialEq for Implementor {
790- fn eq ( & self , other : & Self ) -> bool {
791- self . cmp ( other) == Ordering :: Equal
792- }
793- }
794-
795- impl PartialOrd for Implementor {
796- fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
797- Some ( Ord :: cmp ( self , other) )
798- }
799- }
800-
801- impl Ord for Implementor {
802- fn cmp ( & self , other : & Self ) -> Ordering {
803- // We sort negative impls first.
804- match ( self . is_negative , other. is_negative ) {
805- ( false , true ) => Ordering :: Greater ,
806- ( true , false ) => Ordering :: Less ,
807- _ => compare_names ( & self . text , & other. text ) ,
808- }
809- }
810- }
811-
812795/// Collect the list of aliased types and their aliases.
813796/// <https://github.com/search?q=repo%3Arust-lang%2Frust+[RUSTDOCIMPL]+type.impl&type=code>
814797///
0 commit comments