Skip to content

Recover from C++ style enum struct #99786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add ui test for #99625
  • Loading branch information
obeis committed Jul 29, 2022
commit 0ad06f14820e90cb22b02b3678b6af20e0fe358a
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// run-rustfix

pub enum Range {
//~^ ERROR `enum` and `struct` are mutually exclusive
Valid {
begin: u32,
len: u32,
},
Out,
}

fn main() {
}
13 changes: 13 additions & 0 deletions src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// run-rustfix

pub enum struct Range {
//~^ ERROR `enum` and `struct` are mutually exclusive
Valid {
begin: u32,
len: u32,
},
Out,
}

fn main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: `enum` and `struct` are mutually exclusive
--> $DIR/issue-99625-enum-struct-mutually-exclusive.rs:3:5
|
LL | pub enum struct Range {
| ^^^^^^^^^^^ help: replace `enum struct` with: `enum`

error: aborting due to previous error