rustc should first suggest adding a trait bound on generic impl block when inherent method name bound by that trait collides with methods from unintended traits in scope #120568
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The code closer to what I met is the following as I posted in URLO
Rustc doesn't report the obvious fix by add
L: AsRef<[Line]>
bound on the call site block,so it'd be great if we have it
Other cases
No response
Rust Version
Anything else?
Some similar issues but the lack of trait bounds happens on functions, not on generic impl blocks.
cmp
is incorrect #108428So I think this issue would be a different case.
The text was updated successfully, but these errors were encountered: