summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/restricted/struct-literal-field.rs
blob: 9c6104755a4f1c371b40e057a2df53855e2b6f43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![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
}