Add error reporting on nested keywords inside 'enum' definition

This commit is contained in:
Janusz Marcinkiewicz 2019-11-23 03:41:12 +01:00
parent a449535bbc
commit 0e660d8a79
3 changed files with 70 additions and 1 deletions

View file

@ -0,0 +1,8 @@
enum Foo {
enum Bar { Baz }, //~ ERROR `enum` definition cannot be nested inside `enum`
struct Quux { field: u8 }, //~ ERROR `struct` definition cannot be nested inside `enum`
union Wibble { field: u8 }, //~ ERROR `union` definition cannot be nested inside `enum`
Bat,
}
fn main() { }