Skip to content

pub/priv qualifiers on individual variants #3993

Closed
@catamorphism

Description

@catamorphism
use foo::{f, h};

mod foo {
    pub enum f {
        pub g,
        priv h
    }
}


fn main() {
    let y = h;
}

This shouldn't compile, because h is private. But it's currently accepted. I'm not sure if we want to support pub/priv on variants or not, but if not, we should disallow pub/priv on them altogether.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)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