aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/privacy4.rs
blob: d1ce0afd65431a55002d0193d29860312bb60423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mod orange {
    mod green {
        fn bean<T>(value: T) -> T {
            value
        }
    }

    fn brown() {
        green::bean::<bool>(false);
        // { dg-error "definition is private in this context" "" { target *-*-* } .-1 }
        let a = green::bean::<i32>(15);
        // { dg-error "definition is private in this context" "" { target *-*-* } .-1 }

        struct S;

        let s = green::bean(S);
        // { dg-error "definition is private in this context" "" { target *-*-* } .-1 }
    }
}