Open jyn514 opened 1 year ago
Just curious, which of these behaviors would you expect to be the default, and which would you like the option of using?
https://doc.rust-lang.org/<channel>/
I'd expect docs.rs to use (1), I'm not sure about local docs. Maybe I'd still expect (1) by default?
Hmm. docs.rs uses --no-deps, so it needs 1 to at least be an option - i would be ok with manually passing --extern-html-root-url there if you don't want to support it in cargo.
I'd expect 3. to be the behavior without --no-deps. I think with no-deps I'd expect 2. to be the default with a fallback to 1. if rust-docs isn't installed.
Since this is specifically for build-std, rust-src will always be installed (edit: or if someone is silly enough to try and doc a crate they couldn't build on that same machine, it seems fine to just error out)
I think with no-deps I'd expect 2. to be the default with a fallback to 1. if rust-src isn't installed.
I assume this was meant to be rust-docs
not rust-src
.
See for example https://docs.rs/gba/latest/gba/macro.include_aligned_bytes.html.
@nemo157 and I think this is because
std
doesn't havehtml_root_url
set and cargo doesn't treat it as coming from crates.io, so-Zrustdoc-map
doesn't help. The fix is for cargo to internally pass-Zcrate-attr=doc(html_root_url=https://doc.rust-lang.org/stable/std)
, like bootstrap does: https://github.com/rust-lang/rust/blob/871b5952023139738f72eba235063575062bc2e9/src/bootstrap/compile.rs#L416-L419