Closed
Description
Code
trait Trait {}
impl<T ?Sized> Trait for T {}
Current output
error: invalid `?` in type
--> src/lib.rs:3:8
|
3 | impl<T ?Sized> Trait for T {}
| ^ `?` is only allowed on expressions, not types
|
help: if you meant to express that the type might not contain a value, use the `Option` wrapper type
|
3 | impl<Option<T >Sized> Trait for T {}
| +++++++ ~
error: expected one of `>` or `as`, found `Sized`
--> src/lib.rs:3:9
|
3 | impl<T ?Sized> Trait for T {}
| ^^^^^ expected one of `>` or `as`
Desired output
It should suggest adding a `:` and not emit the two current errors, explaining that you forgot to write `:` before the `?Sized` bound.
Rationale and extra context
No response
Other cases
No response
Anything else?
No response