summaryrefslogtreecommitdiff
path: root/tests/ui/associated-inherent-types/private-in-public.rs
blob: a4b372537c789d680e32a81e767c3992e3ce88bf (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
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
#![crate_type = "lib"]

#![deny(private_in_public)]

pub type PubAlias0 = PubTy::PrivAssocTy;
//~^ ERROR private associated type `PubTy::PrivAssocTy` in public interface (error E0446)
//~| WARNING this was previously accepted
pub type PubAlias1 = PrivTy::PubAssocTy;
//~^ ERROR private type `PrivTy` in public interface (error E0446)
//~| WARNING this was previously accepted
pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
//~^ ERROR private type `PrivTy` in public interface (error E0446)
//~| WARNING this was previously accepted

pub struct PubTy;
impl PubTy {
    type PrivAssocTy = ();
    pub type PubAssocTy<T> = T;
}

struct PrivTy;
impl PrivTy {
    pub type PubAssocTy = ();
}