1 // ignore-tidy-linelength
3 #![feature(decl_macro, associated_type_defaults)]
4 #![allow(unused, private_in_public)]
13 impl PrivTr for Pub {}
14 pub trait PubTr: PrivTr {}
17 let value = <Pub as PrivTr>::method;
18 //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
20 //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
22 //~^ ERROR type `for<'r> fn(&'r Self) {<Self as PrivTr>::method}` is private
23 <Pub as PrivTr>::CONST;
24 //~^ ERROR associated constant `<Pub as PrivTr>::CONST` is private
25 let _: <Pub as PrivTr>::AssocTy;
26 //~^ ERROR associated type `<Pub as PrivTr>::AssocTy` is private
27 pub type InSignatureTy = <Pub as PrivTr>::AssocTy;
28 //~^ ERROR trait `PrivTr` is private
29 pub trait InSignatureTr: PrivTr {}
30 //~^ ERROR trait `PrivTr` is private
32 //~^ ERROR trait `PrivTr` is private
41 fn method(&self, arg: Priv) {}
48 let value = <Pub as PubTr>::method;
49 //~^ ERROR type `priv_signature::Priv` is private
51 //~^ ERROR type `priv_signature::Priv` is private
53 //~^ ERROR type `priv_signature::Priv` is private
57 priv_signature::mac!();
62 fn method<T>(&self) {}
69 let value = <Pub as PubTr>::method::<Priv>;
70 //~^ ERROR type `priv_substs::Priv` is private
72 //~^ ERROR type `priv_substs::Priv` is private
74 //~^ ERROR type `priv_substs::Priv` is private
81 mod priv_parent_substs {
82 pub trait PubTr<T = Priv> {
89 impl PubTr<Priv> for Pub {}
90 impl PubTr<Pub> for Priv {}
93 let value = <Pub as PubTr>::method;
94 //~^ ERROR type `priv_parent_substs::Priv` is private
96 //~^ ERROR type `priv_parent_substs::Priv` is private
97 let value = <Pub as PubTr<_>>::method;
98 //~^ ERROR type `priv_parent_substs::Priv` is private
100 //~^ ERROR type `priv_parent_substs::Priv` is private
102 //~^ ERROR type `priv_parent_substs::Priv` is private
104 let value = <Priv as PubTr<_>>::method;
105 //~^ ERROR type `priv_parent_substs::Priv` is private
107 //~^ ERROR type `priv_parent_substs::Priv` is private
109 //~^ ERROR type `priv_parent_substs::Priv` is private
111 <Pub as PubTr>::CONST;
112 //~^ ERROR type `priv_parent_substs::Priv` is private
113 <Pub as PubTr<_>>::CONST;
114 //~^ ERROR type `priv_parent_substs::Priv` is private
115 <Priv as PubTr<_>>::CONST;
116 //~^ ERROR type `priv_parent_substs::Priv` is private
118 let _: <Pub as PubTr>::AssocTy; // FIXME no longer an error?!
119 let _: <Pub as PubTr<_>>::AssocTy;
120 //~^ ERROR type `priv_parent_substs::Priv` is private
121 let _: <Priv as PubTr<_>>::AssocTy;
122 //~^ ERROR type `priv_parent_substs::Priv` is private
124 pub type InSignatureTy1 = <Pub as PubTr>::AssocTy;
125 //~^ ERROR type `priv_parent_substs::Priv` is private
126 pub type InSignatureTy2 = <Priv as PubTr<Pub>>::AssocTy;
127 //~^ ERROR type `priv_parent_substs::Priv` is private
129 //~^ ERROR type `priv_parent_substs::Priv` is private
132 fn priv_parent_substs() {
133 priv_parent_substs::mac!();