-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
1307 broken links in the Rust documentation #14515
Comments
What was the tool you used to generate this information? This may make a good regression test for rustdoc. |
Much of this is now covered by #14513, I will likely break this into separate issues once that PR lands. |
Cross crate links can target items which are not rendered in the documentation. If the item is reexported at a higher level, the destination of the link (a concatenation of the fully qualified name) may actually lead to nowhere. This fixes this problem by altering rustdoc to emit pages which redirect to the local copy of the reexported structure. cc rust-lang#14515 Closes rust-lang#14137
Cross crate links can target items which are not rendered in the documentation. If the item is reexported at a higher level, the destination of the link (a concatenation of the fully qualified name) may actually lead to nowhere. This fixes this problem by altering rustdoc to emit pages which redirect to the local copy of the reexported structure. cc rust-lang#14515 Closes rust-lang#14137
Many of these have now been dealt with, the remaining ones are left unchecked. |
I was using linkchecker. It’s not perfect, but until I write such a tool in Rust (I do intend to, eventually), it’s the best I know of. |
Re-ran linkchecker:
|
Oh, a lot of these broke due to not re-exporting the core docs and such. |
err, not core, but stuff like |
I've submitted fixes for a few things, and also opened individual issues for the rustdoc bugs causing the other issues. Gonna give this one a close! |
…pplicative-editing-assoc-items, r=Veykril fix: restrict applicable range of `reorder-impl-trait-items` This PR should complete the need for restricting the applicable range of `reorder-impl-trait-items`. When the cursor is in the associated items of the `impl` range, the assist will be disabled. Fix: rust-lang#14515 ## Showcases Note: If there is any available `code-action` (`ide-assist`) available, a lightbulb icon from `lspsaga` will show in the left. - cursor in `impl` headers ![code action available](https://user-images.githubusercontent.com/44747719/230756854-7b236018-cfa8-4005-b589-2996ec42917f.png) Code action is available. And it is reordering impl items. ![code action detail](https://user-images.githubusercontent.com/44747719/230756971-341c7fbc-f2ba-4715-a1e5-b1add984d4dd.png) - cursor in `impl` associated items ![code action unavailable]( https://user-images.githubusercontent.com/44747719/230756906-bee7784e-bd9d-49b2-801b-743c94b4af54.png)
(Sorry, I couldn’t invent 30 more.)
I have a massive list of bad links from crawling doc.rust-lang.org (1307 of them). Most of them arise from bugs in rustdoc, though a few are bad from other manual causes.
Here are the some patterns that I have identified that cause them and which I have omitted from the data set below:
Some(…)
are being produced inrustdoc::html::render::item_module
, whereitem.href()
(anOption<String>
) is being written directly without unwrapping. rustdoc: Create anchor pages for primitive types #14513implementors/….js
pattern accounts for 247 404s, because there is no stub JS file if nothing implements the trait. I am not fond of the technique being used, but given it in its current state, we should produce stub JS files that simply do nothing, to avoid a 404.?gotosrc=…
in them, omitted as I am informed that it has been fixed, just that the online docs haven’t been updated yet. rustdoc: cross-crate source links are one level lower. #14458Some other observations:
serialize::serialize::Encodable
rather than its canonical public path,serialize::Encodable
; I have omitted 771 (!) broken links forserialize::serialize
, 8 forstd::io::mem::MemWriter
, and probably more of the remaining ones are from this same thing); rustdoc: Create anchor pages for primitive types #14513HomingIO
which is in a private module) and/or#[doc(hidden)]
(e.g.RcBoxPtr
) traits in the “traits this type implements” section;enum.Result.html
, now all enums aretype.Result.html
. This has broken manual links both inside the documentation (15, by the looks of it) and outside the documentation, and should be reverted.Anyway, here’s the list of ones that I haven’t removed for reasons mentioned above:
The text was updated successfully, but these errors were encountered: