impl dyn Trait
on an auto trait produces a confusing diagnostic
#85026
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
F-auto_traits
`#![feature(auto_traits)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (playground):
The current output is:
This is rather confusing. It's not immediately clear what the difference between
impl dyn Unpin
and this working code is (playground):Since
impl dyn A
is accepted, the user might be confused whydyn A
would be considered a nominal type whendyn Unpin
isn't. The real reason whyimpl dyn Unpin
is an error is because it is animpl
block fora type[edit: a dynamically dispatched auto trait] from another crate, which should be handled byE0116
.Ideally the output should look like:
The text was updated successfully, but these errors were encountered: