aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/privacy5.rs
blob: 16445ddc3e3be52c4cc8642af006c721efcc5122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod orange {
    mod green {
        struct Foo;
        pub(in orange) struct Bar;
        pub struct Baz;
    }

    fn brown() {// E0603
        let _ = green::Foo; // { dg-error "definition is private in this context" }
        let _ = green::Bar;
        let _ = green::Baz;

        let _: green::Foo; // { dg-error "definition is private in this context" }

        fn any(a0: green::Foo, a1: green::Bar) {} // { dg-error "20:definition is private in this context" }
    }
}