11use crate :: clean:: auto_trait:: AutoTraitFinder ;
22use crate :: clean:: blanket_impl:: BlanketImplFinder ;
33use crate :: clean:: {
4- inline, Clean , Crate , Generic , GenericArg , GenericArgs , ImportSource , Item , ItemKind , Lifetime ,
5- Path , PathSegment , PolyTrait , Primitive , PrimitiveType , ResolvedPath , Type , TypeBinding ,
6- Visibility ,
4+ inline, Clean , Crate , ExternalCrate , Generic , GenericArg , GenericArgs , ImportSource , Item ,
5+ ItemKind , Lifetime , Path , PathSegment , PolyTrait , Primitive , PrimitiveType , ResolvedPath , Type ,
6+ TypeBinding , Visibility ,
77} ;
88use crate :: core:: DocContext ;
99use crate :: formats:: item_type:: ItemType ;
@@ -35,11 +35,11 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
3535
3636 let mut externs = Vec :: new ( ) ;
3737 for & cnum in cx. tcx . crates ( ( ) ) . iter ( ) {
38- externs. push ( ( cnum , cnum. clean ( cx ) ) ) ;
38+ externs. push ( ExternalCrate { crate_num : cnum } ) ;
3939 // Analyze doc-reachability for extern items
4040 LibEmbargoVisitor :: new ( cx) . visit_lib ( cnum) ;
4141 }
42- externs. sort_by ( | & ( a , _ ) , & ( b , _ ) | a . cmp ( & b ) ) ;
42+ externs. sort_unstable_by_key ( |e| e . crate_num ) ;
4343
4444 // Clean the crate, translating the entire librustc_ast AST to one that is
4545 // understood by rustdoc.
@@ -61,7 +61,7 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
6161 _ => unreachable ! ( ) ,
6262 }
6363
64- let local_crate = LOCAL_CRATE . clean ( cx ) ;
64+ let local_crate = ExternalCrate { crate_num : LOCAL_CRATE } ;
6565 let src = local_crate. src ( cx. tcx ) ;
6666 let name = local_crate. name ( cx. tcx ) ;
6767 let primitives = local_crate. primitives ( cx. tcx ) ;
0 commit comments