File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -578,7 +578,7 @@ fn parse_extern_html_roots(
578
578
/// error message.
579
579
// FIXME(eddyb) This shouldn't be duplicated with `rustc::session`.
580
580
fn parse_externs ( matches : & getopts:: Matches ) -> Result < Externs , String > {
581
- let mut externs: BTreeMap < _ , BTreeSet < _ > > = BTreeMap :: new ( ) ;
581
+ let mut externs: BTreeMap < _ , ExternEntry > = BTreeMap :: new ( ) ;
582
582
for arg in & matches. opt_strs ( "extern" ) {
583
583
let mut parts = arg. splitn ( 2 , '=' ) ;
584
584
let name = parts. next ( ) . ok_or ( "--extern value must not be empty" . to_string ( ) ) ?;
@@ -589,7 +589,13 @@ fn parse_externs(matches: &getopts::Matches) -> Result<Externs, String> {
589
589
}
590
590
let name = name. to_string ( ) ;
591
591
// For Rustdoc purposes, we can treat all externs as public
592
- externs. entry ( name) . or_default ( ) . insert ( ExternEntry { location, public : true } ) ;
592
+ externs. entry ( name)
593
+ . and_modify ( |e| { e. locations . insert ( location. clone ( ) ) ; } )
594
+ . or_insert_with ( || {
595
+ let mut locations = BTreeSet :: new ( ) ;
596
+ locations. insert ( location) ;
597
+ ExternEntry { locations, is_private_dep : false }
598
+ } ) ;
593
599
}
594
600
Ok ( Externs :: new ( externs) )
595
601
}
You can’t perform that action at this time.
0 commit comments