1
1
use crate :: clean:: auto_trait:: AutoTraitFinder ;
2
2
use crate :: clean:: blanket_impl:: BlanketImplFinder ;
3
3
use 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 ,
7
7
} ;
8
8
use crate :: core:: DocContext ;
9
9
use crate :: formats:: item_type:: ItemType ;
@@ -35,11 +35,11 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
35
35
36
36
let mut externs = Vec :: new ( ) ;
37
37
for & cnum in cx. tcx . crates ( ( ) ) . iter ( ) {
38
- externs. push ( ( cnum , cnum. clean ( cx ) ) ) ;
38
+ externs. push ( ExternalCrate { crate_num : cnum } ) ;
39
39
// Analyze doc-reachability for extern items
40
40
LibEmbargoVisitor :: new ( cx) . visit_lib ( cnum) ;
41
41
}
42
- externs. sort_by ( | & ( a , _ ) , & ( b , _ ) | a . cmp ( & b ) ) ;
42
+ externs. sort_unstable_by_key ( |e| e . crate_num ) ;
43
43
44
44
// Clean the crate, translating the entire librustc_ast AST to one that is
45
45
// understood by rustdoc.
@@ -61,7 +61,7 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
61
61
_ => unreachable ! ( ) ,
62
62
}
63
63
64
- let local_crate = LOCAL_CRATE . clean ( cx ) ;
64
+ let local_crate = ExternalCrate { crate_num : LOCAL_CRATE } ;
65
65
let src = local_crate. src ( cx. tcx ) ;
66
66
let name = local_crate. name ( cx. tcx ) ;
67
67
let primitives = local_crate. primitives ( cx. tcx ) ;
0 commit comments