Closed
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