Incorrect compiler hint on missing stricter trait bound #99597
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Let's consider the following snippet:
The compiler will throw the following error + hint:
But the hint is not correct: changing the
go
function as suggested by the compilerWill result in a new error:
The compiler hint should be something like this:
The only case where just adding the restriction works out of the box is when taking an owned value as a parameter:
The text was updated successfully, but these errors were encountered: