-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustdoc's treatment of cross-crate ("imported") files is suboptimal. #70757
Comments
It is possible to document a single crate. |
@bjorn3 I think then they get generated at the same paths but by the current |
#70642 may have fixed the compiler docs but it didn't fix the underlying regression caused by #66364. rustdoc is now trying to load files belonging to external crates which even without
Yeah, that look like it's the easiest way to actually fix the regression. I've submitted #70828 to fix this. |
… r=eddyb rustdoc: Don't try to load source files from external crates Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead. Part of rust-lang#70757 r? @GuillaumeGomez cc @eddyb
For future readers: this is mostly fixed but was left open to track the edge case in #70828 (comment). |
@bjorn3 noted in #70025 (comment) that single files missing disables
[src]
links for the entire crate.That's not ideal UX, we should render as many source files as we can possible load.
And there's also the paths
rustdoc
uses (see #70025 (comment)), e.g.:If we use the
CrateNum
of the original source file and reuse the existingrustdoc
logic to get the relative path of that file in that crate, I believe we can even support linking to the source correctly even when the absolute paths are not usable (e.g./rustc/$hash/src/libstd/thread/local.rs
when usingthread_local!
and therust-src
rustup
component isn't installed)Because the downstream crate uses an exported macro from the original crate, the rendered source file should always have been generated, so we should never really need to re-generate it.
cc @rust-lang/rustdoc @Aaron1011
The text was updated successfully, but these errors were encountered: