aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/privacy4.rs
blob: 7865f6a3d479f7982ae300dc139320515cb03fac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#[lang = "sized"]
pub trait Sized {}

mod orange {
    mod green {
        fn bean<T>(value: T) -> T {
            value
        }
    }

    fn brown() {// E0603
        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 }
    }
}