Closed
Description
Given the following code:
pub enum struct Range {
Valid {
begin: u32,
len: u32,
}
Out,
}
fn main() {
println!("Hello, world!");
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected identifier, found keyword `struct`
--> src/main.rs:1:10
|
1 | pub enum struct Range {
| ^^^^^^ expected identifier, found keyword
error: expected one of `<`, `where`, or `{`, found `Range`
--> src/main.rs:1:17
|
1 | pub enum struct Range {
| ^^^^^ expected one of `<`, `where`, or `{`
error: could not compile `playground` due to 2 previous errors
Ideally the output should look like:
Highlight to the user that the keywords enum
and struct
are mutually exclusive. Replace enum struct
with enum
.