-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Move to intra doc links for ascii.rs and panic.rs #75464
Move to intra doc links for ascii.rs and panic.rs #75464
Conversation
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
I tried the following with
EDIT: some precisions: I rebased from a minutes-old pull of |
Well I'm still not sure why it's failing, but I figured out why |
Found the issue: rust/src/librustdoc/passes/collect_intra_doc_links.rs Lines 1230 to 1252 in cd53760
Note it doesn't have everything from rust/src/librustdoc/passes/collect_trait_impls.rs Lines 38 to 67 in cd53760
|
and they're in a third place, ugh. Going to clean this up as part of the fix. rust/src/librustdoc/clean/utils.rs Lines 372 to 398 in cd53760
|
@poliorcetics I have a fix for the issue in #75649. For now let's just keep it as a normal link. |
@bors r+ rollup And thanks for the bug report! |
📌 Commit 0e010a6 has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#75389 (attempt to improve span_label docs) - rust-lang#75392 (Add `as_uninit`-like methods to pointer types and unify documentation of `as_ref` methods) - rust-lang#75464 (Move to intra doc links for ascii.rs and panic.rs) - rust-lang#75578 (Allowing raw ptr dereference in const fn) - rust-lang#75613 (Add explanation for `&mut self` method call when expecting `-> Self`) - rust-lang#75626 (Clean up E0754 explanation) - rust-lang#75629 (Use intra-doc links in `std::env`, `std::alloc` and `std::error`) - rust-lang#75634 (Mark x86_64-linux-kernel as *) Failed merges: r? @ghost
…aumeGomez Fix intra-doc links for inherent impls that are both lang items and not the default impl I found in rust-lang#75464 (comment) that `str::to_uppercase()` doesn't resolve while `str::trim()` does. The only real difference is that `to_uppercase` is defined in `alloc`, while trim is defined in `core`. It turns out that rustdoc was ignoring `lang_items.str_alloc_impl()` - it saw them in `collect_trait_impls`, but not for intra-doc links. This uses the same `impls` for all parts of rustdoc, so that there can be no more inconsistency. It does have the slight downside that the matches are no longer exhaustive but it will be very clear if a new lang item is missed because it will panic when you try to document it (and if you don't document it, does rustdoc really need to know about it?). ~~This needs a test case (probably just `str::to_uppercase`).~~ Added. This is best reviewed commit-by-commit. r? @GuillaumeGomez
…aumeGomez Fix intra-doc links for inherent impls that are both lang items and not the default impl I found in rust-lang#75464 (comment) that `str::to_uppercase()` doesn't resolve while `str::trim()` does. The only real difference is that `to_uppercase` is defined in `alloc`, while trim is defined in `core`. It turns out that rustdoc was ignoring `lang_items.str_alloc_impl()` - it saw them in `collect_trait_impls`, but not for intra-doc links. This uses the same `impls` for all parts of rustdoc, so that there can be no more inconsistency. It does have the slight downside that the matches are no longer exhaustive but it will be very clear if a new lang item is missed because it will panic when you try to document it (and if you don't document it, does rustdoc really need to know about it?). ~~This needs a test case (probably just `str::to_uppercase`).~~ Added. This is best reviewed commit-by-commit. r? @GuillaumeGomez
…aumeGomez Fix intra-doc links for inherent impls that are both lang items and not the default impl I found in rust-lang#75464 (comment) that `str::to_uppercase()` doesn't resolve while `str::trim()` does. The only real difference is that `to_uppercase` is defined in `alloc`, while trim is defined in `core`. It turns out that rustdoc was ignoring `lang_items.str_alloc_impl()` - it saw them in `collect_trait_impls`, but not for intra-doc links. This uses the same `impls` for all parts of rustdoc, so that there can be no more inconsistency. It does have the slight downside that the matches are no longer exhaustive but it will be very clear if a new lang item is missed because it will panic when you try to document it (and if you don't document it, does rustdoc really need to know about it?). ~~This needs a test case (probably just `str::to_uppercase`).~~ Added. This is best reviewed commit-by-commit. r? @GuillaumeGomez
…aumegomez Fix intra-doc links for inherent impls that are both lang items and not the default impl I found in rust-lang#75464 (comment) that `str::to_uppercase()` doesn't resolve while `str::trim()` does. The only real difference is that `to_uppercase` is defined in `alloc`, while trim is defined in `core`. It turns out that rustdoc was ignoring `lang_items.str_alloc_impl()` - it saw them in `collect_trait_impls`, but not for intra-doc links. This uses the same `impls` for all parts of rustdoc, so that there can be no more inconsistency. It does have the slight downside that the matches are no longer exhaustive but it will be very clear if a new lang item is missed because it will panic when you try to document it (and if you don't document it, does rustdoc really need to know about it?). ~~This needs a test case (probably just `str::to_uppercase`).~~ Added. This is best reviewed commit-by-commit. r? @GuillaumeGomez
…aumegomez Fix intra-doc links for inherent impls that are both lang items and not the default impl I found in rust-lang#75464 (comment) that `str::to_uppercase()` doesn't resolve while `str::trim()` does. The only real difference is that `to_uppercase` is defined in `alloc`, while trim is defined in `core`. It turns out that rustdoc was ignoring `lang_items.str_alloc_impl()` - it saw them in `collect_trait_impls`, but not for intra-doc links. This uses the same `impls` for all parts of rustdoc, so that there can be no more inconsistency. It does have the slight downside that the matches are no longer exhaustive but it will be very clear if a new lang item is missed because it will panic when you try to document it (and if you don't document it, does rustdoc really need to know about it?). ~~This needs a test case (probably just `str::to_uppercase`).~~ Added. This is best reviewed commit-by-commit. r? @GuillaumeGomez
Helps with #75080.
@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
I also updated the doc to fix the wording in
AsciiExt
since it is now deprecated.The two file are small changes so I bundled them together.
Some links could not be changed to make them work, I believe those are known issues with primitive types.