about summary refs log tree commit diff
path: root/tests/ui/privacy/projections2.rs
blob: 1afbf6d196e58892b2e78c085e5fb428f99c709e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
mod m {
    use super::*;
    struct Priv;
    pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak`

    trait Trait3 {
        type A<T: Trait>;
    }

    impl Trait3 for u8 {
        type A<T: Trait> = T::A<Leak>;
    }

    pub trait Trait4 {
        type A<T: Trait>;
    }

    impl Trait4 for u8 {
        type A<T: Trait> = <u8 as Trait3>::A<T>;
        //~^ ERROR: private associated type `Trait3::A` in public interface
        //~| ERROR: private trait `Trait3` in public interface
    }
}

pub trait Trait {
    type A<T>;
}

impl Trait for u8 {
    type A<T> = u8;
}
use m::*;

fn check4() -> <u8 as Trait4>::A<u8> {
    todo!()
}

fn main() {}