-
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
Use intra-doc-link to fix broken links #74061
Conversation
Just FYI, there is someone working on the string page in #73804. |
492be3e
to
e6864c0
Compare
r? @ehuss |
There seems to be some regressions, particularly with primitive links like |
Hmm, I thought we fixed this in #74077 ... does this happen in documentation for |
If it happens only in std, then it's because rustdoc assumes the docs for primitives aren't available if they aren't part of the current crate, I tried debugging this in #74077 (comment) without success. cc @sethp |
For this PR, the primitive links only seem to be incorrect on alloc and core. For example, the top of the page |
☔ The latest upstream changes (presumably #74388) made this pull request unmergeable. Please resolve the merge conflicts. |
|
/// [`bytes`]: #method.bytes | ||
/// [`chars`]: #method.chars | ||
/// [`bytes`]: str::bytes | ||
/// [`chars`]: str::chars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In alloc, this points to https://doc.rust-lang.org/nightly/std/primitive.str.html#method.bytes .
But in std, this points to absolute local link: http://0.0.0.0:8000/home/lzutao/fork/rust/compiler/src/liballoc/std/primitive.str.html#method.bytes
And yes, I run http server in doc directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file an issue for this bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is related to cross crate re-exports. So I bet the behavior will change when #73101 lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After stage1, the location in std is Ok http://0.0.0.0:8000/std/primitive.str.html#method.bytes .
That's the module, not the primitive type. That was recently fixed (last few days), have you rebased since? You will need to build with stage 1 rustdoc, not the beta compiler. |
Thanks for the tips. After stage1, type@char in std points to correct position at http://0.0.0.0:8000/std/primitive.char.html , |
Ok, if you want that to work in intra-doc links you'll have to wait for #73101 then. Hopefully it will land in the next week or so. |
This won't actually fix #32553 because it is about the missing |
Closing in favor of #74485 . |
This may fix broken links by missing
Deref<Target = str>
of String in #32553.