-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend users to enable windows/docs
feature when building their crate for docs.rs
#3380
Comments
Thanks for sharing! |
Is this something we should document in the readme, the library docs, or some other place where the |
Yes, I think searching on GitHub is probably the most effective way of finding stuff like this. |
I'd like for folks to preempt this but it's an obscure feature. Is this only done because docs.rs builds with all features are slow? In that case you might want to flip the |
Eventually I'd like to move the mdbook over at kennykerr.ca to github and then it will be easier to add documentation for stuff like this. |
@kennykerr okay, so this used to be a "feature" request for If it's not because of docs.rs but because of local builds being slow, that is unfortunate and breaking local doc builds if users forget to turn on the non-default Note that your second link doesn't work but it appears to be intended to link to the homepage of this repository. |
Suggestion
Our intradoc links into the
windows
crate don't seem to resolve on for example https://docs.rs/gpu-allocator/0.27.0/x86_64-pc-windows-msvc/gpu_allocator/d3d12/struct.Allocation.html. While I'm not exactly confident that these links are very useful, it would be nice if they resolved.With some debugging it turns out
rustdoc
omits these links because it knows they are beinghidden
:windows-rs/crates/libs/windows/src/lib.rs
Line 12 in f8124e8
As such, I managed to make the links resolve again locally by building with
cargo doc (--no-deps) -F windows/docs
Side-note: I thought that
cargo doc --no-deps
would use thedocumentation
URL fromCargo.toml
for target crates, but they are ignored 1 unless I explicitly tellrustdoc
where to find thewindows
crate withRUSTDOCFLAGS="-Zunstable-options --extern-html-root-url=windows=https://microsoft.github.io/windows-docs-rs/doc/" cargo +nightly doc --no-deps
.In the end, to solve this when building our crate for docs.rs, I think the following should suffice in our
Cargo.toml
:Footnotes
This appears to be a known limitation described in https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html#linking-to-external-documentation. ↩
The text was updated successfully, but these errors were encountered: