Skip to content

Should not be able to declare mod item and type item (e.g. an enum) in same scope #15205

Closed
@pnkfelix

Description

@pnkfelix

Illustrative code provided by cmr:

mod Foo {
    pub static X: int = 42;
}

#[deriving(Show)]
enum Foo {
    X
}

fn main() {
    println!("{}", Foo::X);
    let x: Foo = X;
    println!("{}", x);
}

The above should not be legal: one should not be able to declare the mod Foo item in the same scope as the enum Foo item.

But the following playpen appears to accept it, at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions