-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix prelude collision lint suggestion for generics with lifetimes #88496
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
if trait_generics.params.len() <= trait_generics.has_self as usize { | ||
trait_path | ||
} else { | ||
let counts = trait_generics.own_counts(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@bors r+ |
📌 Commit 78a7d1c has been approved by |
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
Fixes #88470
cc @nikomatsakis