]> git.proxmox.com Git - rustc.git/blame - src/test/ui/privacy/private-type-in-interface.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / privacy / private-type-in-interface.rs
CommitLineData
041b39d2
XL
1// aux-build:private-inferred-type.rs
2
3b2f2976 3#![allow(warnings)]
041b39d2
XL
4
5extern crate private_inferred_type as ext;
6
7mod m {
8 struct Priv;
9 pub type Alias = Priv;
10
11 pub trait Trait { type X; }
12 impl Trait for Priv { type X = u8; }
13}
14
1b1a35ee
XL
15fn f(_: m::Alias) {} //~ ERROR type `Priv` is private
16 //~^ ERROR type `Priv` is private
041b39d2
XL
17fn f_ext(_: ext::Alias) {} //~ ERROR type `ext::Priv` is private
18 //~^ ERROR type `ext::Priv` is private
19
20trait Tr1 {}
1b1a35ee 21impl m::Alias {} //~ ERROR type `Priv` is private
041b39d2 22impl Tr1 for ext::Alias {} //~ ERROR type `ext::Priv` is private
1b1a35ee 23type A = <m::Alias as m::Trait>::X; //~ ERROR type `Priv` is private
041b39d2
XL
24
25trait Tr2<T> {}
26impl<T> Tr2<T> for u8 {}
1b1a35ee 27fn g() -> impl Tr2<m::Alias> { 0 } //~ ERROR type `Priv` is private
041b39d2
XL
28fn g_ext() -> impl Tr2<ext::Alias> { 0 } //~ ERROR type `ext::Priv` is private
29
30fn main() {}