Open
Description
Describe the problem you are trying to solve
docs.rs would like to link to builds for specific targets, since not all targets have the same documentation: rust-lang/docs.rs#1397 (comment). However, this requires more flexibility in the URL than cargo currently allows. It would be great if -Zrustdoc-map
added support for this so we don't have to go back to adding --extern-html-root-url by hand (which was quite buggy).
Describe the solution you'd like
Add support for {target}
to doc.extern-map.registries
. It should have the following behavior:
- When using
cargo doc --target x
, replace{target}
withx
in the remapping. - When using
cargo doc
alone, without--target
, remove{target}
altogether.
I don't have strong opinions on 2 (docs.rs will work even if it's replaced with the host target) but it seems like a reasonable behavior.
Notes
I am interested in implementing this myself.