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 variants don't seem to get serialized #4082

Closed
catamorphism opened this issue Nov 30, 2012 · 9 comments
Closed

pub/priv qualifiers on variants don't seem to get serialized #4082

catamorphism opened this issue Nov 30, 2012 · 9 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries

Comments

@catamorphism
Copy link
Contributor

private_variant_1.rs:

mod super_sekrit {
    pub enum sooper_sekrit {
        priv baz
    }
}

private_variant_2.rs:

// aux-build:private_variant_1.rs
extern mod private_variant_1;

fn main() {
    let _x = private_variant_1::super_sekrit::baz; //~ ERROR baz is private
}

This compiles successfully, but should fail.

catamorphism added a commit to catamorphism/rust that referenced this issue Nov 30, 2012
If an enum type's only variant is private, disallow dereferencing
values of its type, as per rust-lang#818.

Due to rust-lang#4082, this only applies to enums that are in the same crate.
catamorphism added a commit that referenced this issue Nov 30, 2012
If an enum type's only variant is private, disallow dereferencing
values of its type.

Due to #4082, this only applies to enums that are in the same crate.

r=pcwalton

Closes #818
@pcwalton
Copy link
Contributor

@catamorphism Is this done?

@catamorphism
Copy link
Contributor Author

I have a branch where I'm working on this -- it's mostly done, but not quite. I'm on medical leave till the 26th, but if I'm feeling up to it, I'll try to get to it sooner.

@ghost ghost assigned catamorphism Dec 18, 2012
@catamorphism
Copy link
Contributor Author

Worked on it today. Mysteriously, locals now get resolved to private enum variants (in other crates) with the same name. I probably won't have time to work on this again till Saturday.

@pnkfelix
Copy link
Member

reproduced on c202430. not a blocker for 0.6 though.

@pnkfelix
Copy link
Member

Not critical for 0.6; de-milestoning

@metajack
Copy link
Contributor

This is still reproducible. Nominating for production ready.

@graydon
Copy link
Contributor

graydon commented May 16, 2013

accepted for production-ready milestone

@pnkfelix
Copy link
Member

visiting for triage email 2013-07-22. still a problem.

(wasted a lot of time because after I transcribed updated versions of the tests, I forgot that we want compilation to fail here, and so I was struggling to figure out why compilation had "started" succeeding in the last two months. ;) )

@alexcrichton
Copy link
Member

This has been well tested by all the various privacy changes recently. The code above correctly errors and there are multiple tests for this in the test suite. Closing due to being fixed.

@catamorphism catamorphism removed their assignment Jun 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

No branches or pull requests

6 participants