File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use crate::sources::CRATES_IO_REGISTRY;
7
7
use crate :: util:: errors:: { internal, CargoResult } ;
8
8
use cargo_util:: ProcessBuilder ;
9
9
use std:: collections:: HashMap ;
10
+ use std:: collections:: HashSet ;
10
11
use std:: fmt;
11
12
use std:: hash;
12
13
use url:: Url ;
@@ -113,8 +114,12 @@ fn build_all_urls(
113
114
name2url : & HashMap < & String , Url > ,
114
115
map : & RustdocExternMap ,
115
116
unstable_opts : & mut bool ,
117
+ seen : & mut HashSet < Unit > ,
116
118
) {
117
119
for dep in build_runner. unit_deps ( unit) {
120
+ if !seen. insert ( dep. unit . clone ( ) ) {
121
+ continue ;
122
+ }
118
123
if !dep. unit . target . is_linkable ( ) || dep. unit . mode . is_doc ( ) {
119
124
continue ;
120
125
}
@@ -155,6 +160,7 @@ fn build_all_urls(
155
160
name2url,
156
161
map,
157
162
unstable_opts,
163
+ seen,
158
164
) ;
159
165
}
160
166
}
@@ -199,6 +205,7 @@ pub fn add_root_urls(
199
205
& name2url,
200
206
map,
201
207
& mut unstable_opts,
208
+ & mut HashSet :: new ( ) ,
202
209
) ;
203
210
let std_url = match & map. std {
204
211
None | Some ( RustdocExternMode :: Remote ) => None ,
Original file line number Diff line number Diff line change @@ -452,10 +452,14 @@ fn same_deps_multi_occurrence_in_dep_tree() {
452
452
. build ( ) ;
453
453
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
454
454
. masquerade_as_nightly_cargo ( & [ "rustdoc-map" ] )
455
- . with_stderr_contains (
455
+ . with_stderr_does_not_contain (
456
456
"[..]--extern-html-root-url[..]bar=https://docs.rs\
457
457
[..]--extern-html-root-url[..]baz=https://docs.rs\
458
458
[..]--extern-html-root-url[..]baz=https://docs.rs[..]",
459
459
)
460
+ . with_stderr_contains (
461
+ "[..]--extern-html-root-url[..]bar=https://docs.rs\
462
+ [..]--extern-html-root-url[..]baz=https://docs.rs[..]",
463
+ )
460
464
. run ( ) ;
461
465
}
You can’t perform that action at this time.
0 commit comments