Skip to content

Unit/tuple structs with the same name as a module are allowed. #29185

Closed
@eddyb

Description

@eddyb

The following two type-definition/module conflicts cause errors:

enum Foo {}
mod Foo {}
struct Bar { x: bool }
mod Bar {}

But unit and tuple structs, due to the special-casing to check for value conflicts, end up not checking for module conflicts, resulting in the following two examples compiling:

struct Foo;
mod Foo {}
struct Bar(bool);
mod Bar {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions