File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -594,18 +594,20 @@ fn doc_std(
594
594
595
595
// HACK: because we use `--manifest-path library/sysroot/Cargo.toml`, cargo thinks we only want to document that specific crate, not its dependencies.
596
596
// Override its default.
597
- let built_crates = if requested_crates. is_empty ( ) {
598
- builder
599
- . in_tree_crates ( "sysroot" , None )
600
- . into_iter ( )
601
- . map ( |krate| krate . name . to_string ( ) )
602
- . collect ( )
597
+ if requested_crates. is_empty ( ) {
598
+ for krate in
599
+ builder . in_tree_crates ( "sysroot" , None ) . into_iter ( ) . map ( |krate| krate . name . to_string ( ) )
600
+ {
601
+ cargo . arg ( "-p" ) . arg ( krate ) ;
602
+ }
603
603
} else {
604
- requested_crates. to_vec ( )
605
- } ;
606
-
607
- for krate in built_crates {
608
- cargo. arg ( "-p" ) . arg ( krate) ;
604
+ for krate in STD_PUBLIC_CRATES {
605
+ cargo. arg ( "-p" ) . arg ( krate) ;
606
+ if requested_crates. iter ( ) . any ( |p| p == krate) {
607
+ // No need to document more of the libraries if we have the one we want.
608
+ break ;
609
+ }
610
+ }
609
611
}
610
612
611
613
builder. run ( & mut cargo. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments