rust/tests/ui/privacy/restricted/struct-literal-field.rs
2023-01-11 09:32:08 +00:00

20 lines
263 B
Rust

#![allow(warnings)]
mod foo {
pub mod bar {
pub struct S {
pub(in foo) x: i32,
}
}
fn f() {
use foo::bar::S;
S { x: 0 }; // ok
}
}
fn main() {
use foo::bar::S;
S { x: 0 }; //~ ERROR private
}