File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -580,7 +580,17 @@ impl RustwideBuilder {
580
580
// We know that `metadata` unconditionally passes `-Z rustdoc-map`.
581
581
// Don't copy paste this, since that fact is not stable and may change in the future.
582
582
"-Zunstable-options" . into( ) ,
583
- r#"--config=doc.extern-map.registries.crates-io="https://docs.rs""# . into( ) ,
583
+ // Add `target` so that if a dependency has target-specific docs, this links to them properly.
584
+ //
585
+ // Note that this includes the target even if this is the default, since the dependency
586
+ // may have a different default (and the web backend will take care of redirecting if
587
+ // necessary).
588
+ //
589
+ // FIXME: host-only crates like proc-macros should probably not have this passed? but #1417 should make it OK
590
+ format!(
591
+ r#"--config=doc.extern-map.registries.crates-io="https://docs.rs/{{pkg_name}}/{{version}}/{}""# ,
592
+ target
593
+ ) ,
584
594
] ;
585
595
if let Some ( cpu_limit) = self . config . build_cpu_limit {
586
596
cargo_args. push ( format ! ( "-j{}" , cpu_limit) ) ;
You can’t perform that action at this time.
0 commit comments