rust/src/test/compile-fail/private-struct-field-ctor.rs

12 lines
155 B
Rust

mod a {
#[legacy_exports];
struct Foo {
priv x: int
}
}
fn main() {
let s = a::Foo { x: 1 }; //~ ERROR field `x` is private
}