-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix intra-doc links for inherent impls that are both lang items and not the default impl #75649
Conversation
Some changes occurred in intra-doc-links. cc @jyn514 |
This comment has been minimized.
This comment has been minimized.
af913c5
to
1b74f04
Compare
This does keep one small change from #74489, which is to use |
3aae334
to
7be824e
Compare
Nice work! @bors: r+ |
📌 Commit 7be824e has been approved by |
…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
Failed in #75688 (comment) due to Cargo.lock being out of date |
☔ The latest upstream changes (presumably #75692) made this pull request unmergeable. Please resolve the merge conflicts. |
7be824e
to
570b0d9
Compare
@bors r=GuilluameGomez |
📌 Commit 570b0d9 has been approved by |
@bors r- I want to add a test for f32 and f64 methods. |
2fa9719
to
aff01f8
Compare
Tagging you so you can look at the changes if you want :) but it's only adding a new test. |
📌 Commit aff01f8 has been approved by |
…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
Rollup of 7 pull requests Successful merges: - rust-lang#75069 (move const param structural match checks to wfcheck) - rust-lang#75587 (mir building: fix some comments) - rust-lang#75593 (Adjust installation place for compiler docs) - rust-lang#75648 (Make OnceCell<T> transparent to dropck) - rust-lang#75649 (Fix intra-doc links for inherent impls that are both lang items and not the default impl) - rust-lang#75674 (Move to intra doc links for std::io) - rust-lang#75696 (Remove `#[cfg(miri)]` from OnceCell tests) Failed merges: r? @ghost
I found in #75464 (comment) that
str::to_uppercase()
doesn't resolve whilestr::trim()
does. The only real difference is thatto_uppercase
is defined inalloc
, while trim is defined incore
. It turns out that rustdoc was ignoringlang_items.str_alloc_impl()
- it saw them incollect_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 justAdded.str::to_uppercase
).This is best reviewed commit-by-commit.
r? @GuillaumeGomez