Account for HRTB on unsatisfied trait bound suggestions #66762
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-higher-ranked
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When encountering a higher-ranked-trait-bound error where the compiler would suggest adding a new
where
bound that is the same as an existing bound, the suggestion should be to replace the existing one with the hrtb version:before:
after:
The text was updated successfully, but these errors were encountered: