rust/tests/ui/privacy/restricted/struct-literal-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
263 B
Rust
Raw Normal View History

2016-04-10 06:52:25 -05:00
#![allow(warnings)]
mod foo {
pub mod bar {
pub struct S {
2017-03-07 17:50:13 -06:00
pub(in foo) x: i32,
2016-04-10 06:52:25 -05:00
}
}
fn f() {
use foo::bar::S;
S { x: 0 }; // ok
}
}
fn main() {
use foo::bar::S;
S { x: 0 }; //~ ERROR private
}