using impl Trait
on a return type as part of a trait declaration results in a misleading error
#92458
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: an error message stating that
impl Trait
is not allowed as part of trait declarations.Instead, this happened: the following misleading error
This error is misleading because it states that the problem is that the keyword
impl
is not being used as part of a return type, even though it is.Meta
rustc --version --verbose
:Backtrace
Produces the exact same error
The text was updated successfully, but these errors were encountered: