]> git.lizzy.rs Git - rust.git/commit
Change private structs to have private fields by default
authorAlex Crichton <alex@alexcrichton.com>
Fri, 24 Jan 2014 19:00:08 +0000 (11:00 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 26 Jan 2014 18:37:08 +0000 (10:37 -0800)
commit31ac9c4288f32c2afdce11e616668b251e6164ef
tree7bdaf7a6709929382bd84d4b9f8c340864a804d6
parent838b5a4cc072057f31453cdd1b50345f92e1a772
Change private structs to have private fields by default

This was the original intention of the privacy of structs, and it was
erroneously implemented before. A pub struct will now have default-pub fields,
and a non-pub struct will have default-priv fields. This essentially brings
struct fields in line with enum variants in terms of inheriting visibility.

As usual, extraneous modifiers to visibility are disallowed depend on the case
that you're dealing with.

Closes #11522
src/librustc/middle/privacy.rs
src/test/auxiliary/struct-field-privacy.rs [new file with mode: 0644]
src/test/compile-fail/struct-field-privacy.rs [new file with mode: 0644]