Closed
Description
@thestinger found this odd bug. This code:
enum Foo { C { a: int, b: int } }
struct C { a: int, b: int }
fn main() { }
properly errors out with:
test.rs:2:0: 2:27 error: duplicate definition of type C
test.rs:2 struct C { a: int, b: int }
^~~~~~~~~~~~~~~~~~~~~~~~~~~
test.rs:1:11: 1:31 note: first definition of type C here:
test.rs:1 enum Foo { C { a: int, b: int } }
^~~~~~~~~~~~~~~~~~~~
However, if you swap the enum and struct definition, it compiles fine with rust HEAD:
struct C { a: int, b: int }
enum Foo { C { a: int, b: int } }
fn main() { }