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

Fix prelude collision lint suggestion for generics with lifetimes #88496

Merged
merged 3 commits into from
Aug 31, 2021

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Aug 30, 2021

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 Aug 30, 2021
@m-ou-se m-ou-se added A-edition-2021 Area: The 2021 edition D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. labels Aug 30, 2021
if trait_generics.params.len() <= trait_generics.has_self as usize {
trait_path
} else {
let counts = trait_generics.own_counts();
Copy link
Member Author

Choose a reason for hiding this comment

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

This used .count() before, and .own_counts() now, to get counts for each kind of generics individually. So that does not include the parent counts. I couldn't find any case where that makes a difference though. Will this break (or fix) anything?

Copy link
Contributor

Choose a reason for hiding this comment

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

For a trait, no, traits never have parents.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 30, 2021

📌 Commit 78a7d1c has been approved by petrochenkov

@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 Aug 30, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2021
Rollup of 14 pull requests

Successful merges:

 - rust-lang#88394 (Document `std::env::current_exe` possible rename behaviour)
 - rust-lang#88406 (Tait nest infer test)
 - rust-lang#88408 (Add inference cycle TAIT test)
 - rust-lang#88409 (Add auto trait leakage TAIT test)
 - rust-lang#88413 (Add weird return types TAIT test)
 - rust-lang#88450 (fix(rustc_parse): correct span in `maybe_whole_expr!`)
 - rust-lang#88462 (rustdoc: Stop using resolver for macro loading)
 - rust-lang#88465 (Adding examples to docs of `std::time` module)
 - rust-lang#88486 (Remove unused arena macro args)
 - rust-lang#88492 (Use MaybeUninit::write in functor.rs)
 - rust-lang#88496 (Fix prelude collision lint suggestion for generics with lifetimes)
 - rust-lang#88497 (Fix prelude collision suggestions for glob imported traits. )
 - rust-lang#88503 (Warn when [T; N].into_iter() is ambiguous in the new edition. )
 - rust-lang#88509 (Don't suggest extra <> in dyn suggestion.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fdf9c09 into rust-lang:master Aug 31, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2021 Area: The 2021 edition D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rust_2021_prelude_collisions bad suggestion with lifetime generics
6 participants