-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
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() { }
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically