-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add experimental feature to link against local copy of std from cargo doc --open
#7071
Conversation
r? @ehuss (rust_highfive has picked a reviewer for you, use r? to override) |
The interaction with rustdoc seems fine to me. I'll leave the proper review to Cargo-team people, though. |
Thanks for helping to move this along! This isn't quite the direction I was thinking of though, and doesn't close 6279. I'd prefer to lay out a plan for how it will work overall before jumping into adding new flags. There are a variety of cases that I'd like to see cargo cover for mapping dependencies:
I haven't thought about it much (hence the "needs design" part). I'm not sure if this is the kind of thing that should be defined in |
☔ The latest upstream changes (presumably #7185) made this pull request unmergeable. Please resolve the merge conflicts. |
Dumping some relevant info here from a recent twitter convo (https://twitter.com/yaahc_/status/1159014222031806465?s=20) https://deterministic.space/serve-archived-static-files-over-http.html from @killercup |
Even with this part I don't feel like this PR fully addresses the problems. It makes crosslinking work but the two docs still act like otherwise unrelated webpages. I'd really like to see the search bar resolve items from both the locally generated crate / dependency docs and the std / core docs, not just have local items searchable but have clickable links to std/core items in the local doc pages. I don't know how best to accomplish this though, particularly when you start tossing in other dependency mappings like to docs.rs. My expectation is that this would have to be accomplished via changes to rustdoc and even then I'm not sure all the information is there without having a local copy of std/core to look at. @QuietMisdreavus lmk what you think
I don't think this is the current behavior, my understanding is that we always set std / core links to the nightly docs on rust-lang.org https://doc.rust-lang.org/nightly/ |
I don't see a way to make this feasible without somehow embedding the search index from std and friends into everyone's search index, every time we ever generate docs. This would also severely clutter up the search index for regular crates who wouldn't want std to be searchable from their crate. I could see it with a new flag to rustdoc, but making people add that manually seems like it would make it get less use. @rust-lang/rustdoc What do you think? |
Seems like a bad idea (to add into the search-index). However, linking to local std types seems like a nice thing. |
@GuillaumeGomez when you say linking to local std types do you basically mean what's accomplished by this change? This already makes the std links in the docs point to the local copy of the std docs. @QuietMisdreavus new flag sounds fine to me, I'm okay with it not being the default if most people wouldn't want it, who knows, maybe after using it I'll realize it was really a bad idea and not like the clutter either. |
@yaahc: Yep and I approve it. |
ooh. cool 😅 |
I'm gonna close this because I doubt I'll be able to get around to this any time soon, but if someone else wants to come along and pick up where I left off they're more than welcome to. |
related to #6279