diff options
| author | Obei Sideg <obei.sideg@gmail.com> | 2022-07-27 02:17:07 +0300 |
|---|---|---|
| committer | Obei Sideg <obei.sideg@gmail.com> | 2022-07-29 13:57:04 +0300 |
| commit | 0ad06f14820e90cb22b02b3678b6af20e0fe358a (patch) | |
| tree | 6bbf0c657fbea353053ddee4b761b45c3c8a68a3 | |
| parent | 254b89d209eccf4b5a5fd835db1089e1a814eef9 (diff) | |
| download | rust-0ad06f14820e90cb22b02b3678b6af20e0fe358a.tar.gz rust-0ad06f14820e90cb22b02b3678b6af20e0fe358a.zip | |
Add ui test for #99625
3 files changed, 34 insertions, 0 deletions
diff --git a/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.fixed b/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.fixed new file mode 100644 index 00000000000..4b4a416b1ac --- /dev/null +++ b/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.fixed @@ -0,0 +1,13 @@ +// run-rustfix + +pub enum Range { + //~^ ERROR `enum` and `struct` are mutually exclusive + Valid { + begin: u32, + len: u32, + }, + Out, +} + +fn main() { +} diff --git a/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs b/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs new file mode 100644 index 00000000000..9cc88664129 --- /dev/null +++ b/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs @@ -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() { +} diff --git a/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.stderr b/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.stderr new file mode 100644 index 00000000000..edc640bf5ec --- /dev/null +++ b/src/test/ui/parser/issue-99625-enum-struct-mutually-exclusive.stderr @@ -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 + |
