File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 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(
578578/// error message.
579579// FIXME(eddyb) This shouldn't be duplicated with `rustc::session`.
580580fn parse_externs ( matches : & getopts:: Matches ) -> Result < Externs , String > {
581- let mut externs: BTreeMap < _ , BTreeSet < _ > > = BTreeMap :: new ( ) ;
581+ let mut externs: BTreeMap < _ , ExternEntry > = BTreeMap :: new ( ) ;
582582 for arg in & matches. opt_strs ( "extern" ) {
583583 let mut parts = arg. splitn ( 2 , '=' ) ;
584584 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> {
589589 }
590590 let name = name. to_string ( ) ;
591591 // 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+ } ) ;
593599 }
594600 Ok ( Externs :: new ( externs) )
595601}
You can’t perform that action at this time.
0 commit comments