Skip to content

Private variants can be publicly reexported #30055

Closed
@petrochenkov

Description

@petrochenkov

This snippet compiles, but it shouldn't, because the variants V1 and V2 belong to private enums and private things can't normally be publicly reexported.

enum E1 { V1 }
enum E2 { V2 }

pub use E1::V1;
pub use E2::*;

fn main() {}

Reproduces on stable/beta/nightly.
The E1::V1 case is fixed in #29973, E2::* is not fixed is fixed in #29973 as well .

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