-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
use std::panic::UnwindSafe;
struct S<T>(T);
impl<T: UnwindSafe> impl UnwindSafe for T {}
// We're using UnwindSafe as an example trait
Current output
error: expected a trait, found type
--> src/lib.rs:5:21
|
5 | impl<T: UnwindSafe> impl UnwindSafe for T {}
| ^^^^^^^^^^^^^^^
Desired output
error: expected a trait, found type
--> src/lib.rs:5:21
|
5 | impl<T: UnwindSafe> impl UnwindSafe for T {}
| ^^^^^^^^^^^^^^^
--> src/lib.rs:5:21
|
5 | impl<T: UnwindSafe> impl UnwindSafe for T {}
| ^^^^ ^^^^
note: second occurrence of keyword `impl` is probably a mistake
Rationale and extra context
I made this mistake and didn't spot that the ^^^^
were pointing at the whole of impl Trait
rather than just Trait
and spent several minutes thinking "but Trait
is a trait!".
Probably my "desired output" could be improved. Maybe replacing rather than supplementing the "expected trait, not type" would be better.
Other cases
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.