Uh oh!
There was an error while loading. Please reload this page.
Fix intra-doc links for inherent impls that are both lang items and not the default impl - #75649
Conversation
rust-highfive
commented
Aug 17, 2020
Some changes occurred in intra-doc-links. cc @jyn514 |
This comment has been minimized.
This comment has been minimized.
af913c5 to
1b74f04Comparejyn514
commented
Aug 17, 2020
This does keep one small change from #74489, which is to use |
3aae334 to
7be824eCompareUh oh!
There was an error while loading. Please reload this page.
GuillaumeGomez
commented
Aug 18, 2020
Nice work! @bors: r+ |
bors
commented
Aug 18, 2020
📌 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
tmandry
commented
Aug 19, 2020
Failed in #75688 (comment) due to Cargo.lock being out of date |
bors
commented
Aug 19, 2020
☔ The latest upstream changes (presumably #75692) made this pull request unmergeable. Please resolve the merge conflicts. |
7be824e to
570b0d9Comparejyn514
commented
Aug 19, 2020
@bors r=GuilluameGomez |
bors
commented
Aug 19, 2020
📌 Commit 570b0d9 has been approved by |
jyn514
commented
Aug 19, 2020
@bors r- I want to add a test for f32 and f64 methods. |
2fa9719 to
aff01f8Comparejyn514
commented
Aug 19, 2020
Tagging you so you can look at the changes if you want :) but it's only adding a new test. |
bors
commented
Aug 19, 2020
📌 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_uppercaseis 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
implsfor 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