Skip to content

type X = ::Y vs use ::Y as X mismatch if ::Y is a enum #44057

Closed
@whitequark

Description

@whitequark

To reproduce, try to compile this:

mod foo {
    pub enum Bar { A }
}

// use foo::Bar as Baz; // this works
type Baz = foo::Bar; // this doesn't

fn main() {
    let _ = Baz::A;
}

This seems... counterintuitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions