Open
Description
Code
pub enum Foo<T>
where:
T: Debug,
{
}
Current output
Compiling playground v0.0.1 (/playground)
error: expected one of `#`, `{`, lifetime, or type, found `:`
--> src/lib.rs:2:6
|
1 | pub enum Foo<T>
| --- while parsing this enum
2 | where:
| ^ expected one of `#`, `{`, lifetime, or type
|
help: perhaps you meant to use `struct` here
|
1 - pub enum Foo<T>
1 + pub struct Foo<T>
|
error: could not compile `playground` (lib) due to 1 previous error
Rationale and extra context
I found this error by trying out some code which accidentally had a where:
in the code and it results in this incorrect help suggestion.
This doesn't occur if you have a struct instead of an enum (there's no help suggestion in that case )
Rust Version
tested on playground (1.87.0 stable and 1.90.0 nightly )