Skip to content
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

Don't generate "Impls on Foreign Types" for std #97735

Merged
merged 1 commit into from
Jun 5, 2022

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Jun 4, 2022

Hack: many traits and types in std are re-exported from core or alloc. In general, rustdoc is capable of recognizing these implementations as being on local types. However, in at least one case, rustdoc gets confused and labels an implementation as being on a foreign type. To make sure that confusion doesn't pass on to the reader, consider all implementations in std, core, and alloc to be on local types.

Demo: https://rustdoc.crud.net/jsha/no-foreign-std/std/clone/trait.Clone.html

Hack: many traits and types in std are re-exported from core or alloc. In
general, rustdoc is capable of recognizing these implementations as being
on local types. However, in at least one case, rustdoc gets confused and
labels an implementation as being on a foreign type. To make sure that
confusion doesn't pass on to the reader, consider all implementations in
std, core, and alloc to be on local types.
@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Jun 4, 2022
@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 4, 2022
@GuillaumeGomez
Copy link
Member

Looks good to me, thanks! In this case, I don't really know how we could test the change so it's fine as is (but if you find a way, I'm very interested!). r=me once CI pass

@jsha
Copy link
Contributor Author

jsha commented Jun 4, 2022

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Jun 4, 2022

📌 Commit 784eebc has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 4, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 2022
…askrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#97609 (Iterate over `maybe_unused_trait_imports` when checking dead trait imports)
 - rust-lang#97688 (test const_copy to make sure bytewise pointer copies are working)
 - rust-lang#97707 (Improve soundness of rustc_data_structures)
 - rust-lang#97731 (Add regresion test for rust-lang#87142)
 - rust-lang#97735 (Don't generate "Impls on Foreign Types" for std)
 - rust-lang#97737 (Fix pretty printing named bound regions under -Zverbose)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8d0de3a into rust-lang:master Jun 5, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants