Skip to content

rustdoc: handle generics better when matching notable traits #108954

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Mar 23, 2023

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Mar 9, 2023

This commit makes the clean::Type::is_same non-commutative (renaming it is_doc_subtype_of), so that a generic impl matches a concrete return, but a generic return does not match a concrete impl. It makes slice and vector Write for u8 not match on every generic return value.

Fixes #100322

Fixes #55082

Preview:

This commit makes the `clean::Type::is_same` non-commutative, so
that a generic `impl` matches a concrete return, but a generic return
does not match a concrete `impl`. It makes slice and vector Write
for `u8` not match on every generic return value.
@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2023

r? @jsha

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 9, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2023

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this issue!

@camelid
Copy link
Member

camelid commented Mar 12, 2023

r? @camelid

@rustbot rustbot assigned camelid and unassigned jsha Mar 12, 2023
@notriddle notriddle requested a review from camelid March 13, 2023 16:54
@notriddle notriddle requested a review from camelid March 20, 2023 02:49
Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for fixing this!

@camelid
Copy link
Member

camelid commented Mar 22, 2023

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 22, 2023

📌 Commit 7f76084 has been approved by camelid

It is now in the queue for this repository.

@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 Mar 22, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 23, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#108954 (rustdoc: handle generics better when matching notable traits)
 - rust-lang#109203 (refactor/feat: refactor identifier parsing a bit)
 - rust-lang#109213 (Eagerly intern and check CrateNum/StableCrateId collisions)
 - rust-lang#109358 (rustc: Remove unused `Session` argument from some attribute functions)
 - rust-lang#109359 (Update stdarch)
 - rust-lang#109378 (Remove Ty::is_region_ptr)
 - rust-lang#109423 (Use region-erased self type during IAT selection)
 - rust-lang#109447 (new solver cleanup + implement coherence)
 - rust-lang#109501 (make link clickable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0392e29 into rust-lang:master Mar 23, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 23, 2023
@notriddle notriddle deleted the notriddle/notable-trait-generic branch March 23, 2023 15:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.

rustdoc: notable traits triggers on all &[T] and &mut [T] returns "Notable Traits" for &[u8] includes Write, which is only on &mut [u8]
5 participants