Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pub/priv qualifiers on individual variants #3993

Closed
catamorphism opened this issue Nov 17, 2012 · 2 comments
Closed

pub/priv qualifiers on individual variants #3993

catamorphism opened this issue Nov 17, 2012 · 2 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-resolve Area: Name resolution
Milestone

Comments

@catamorphism
Copy link
Contributor

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.

@nikomatsakis
Copy link
Contributor

You are supposed to be able to mark variants as private so as to control
the conditions in which they are constructed.

@ghost ghost assigned catamorphism Nov 24, 2012
@catamorphism
Copy link
Contributor Author

f459acc fixes the problem (as it turns out, priv wasn't working correctly on top-level items, either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

2 participants