1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(decl_macro, associated_type_defaults)]
12 #![allow(unused, private_in_public)]
18 pub trait PubTr: PrivTr {}
21 let _: Box<PubTr<AssocTy = u8>>;
22 //~^ ERROR type `(dyn priv_trait::PubTr<AssocTy=u8> + '<empty>)` is private
23 //~| ERROR type `(dyn priv_trait::PubTr<AssocTy=u8> + '<empty>)` is private
24 type InSignatureTy2 = Box<PubTr<AssocTy = u8>>;
25 //~^ ERROR type `(dyn priv_trait::PubTr<AssocTy=u8> + 'static)` is private
26 trait InSignatureTr2: PubTr<AssocTy = u8> {}
27 //~^ ERROR trait `priv_trait::PrivTr` is private
30 let _: Box<PrivTr<AssocTy = u8>>;
31 //~^ ERROR type `(dyn priv_trait::PrivTr<AssocTy=u8> + '<empty>)` is private
32 //~| ERROR type `(dyn priv_trait::PrivTr<AssocTy=u8> + '<empty>)` is private
33 type InSignatureTy1 = Box<PrivTr<AssocTy = u8>>;
34 //~^ ERROR type `(dyn priv_trait::PrivTr<AssocTy=u8> + 'static)` is private
35 trait InSignatureTr1: PrivTr<AssocTy = u8> {}
36 //~^ ERROR trait `priv_trait::PrivTr` is private
46 mod priv_parent_substs {
47 pub trait PubTrWithParam<T = Priv> {
51 pub trait PubTr: PubTrWithParam<Priv> {}
54 let _: Box<PubTrWithParam<AssocTy = u8>>;
55 //~^ ERROR type `priv_parent_substs::Priv` is private
56 //~| ERROR type `priv_parent_substs::Priv` is private
57 let _: Box<PubTr<AssocTy = u8>>;
58 //~^ ERROR type `priv_parent_substs::Priv` is private
59 //~| ERROR type `priv_parent_substs::Priv` is private
60 pub type InSignatureTy1 = Box<PubTrWithParam<AssocTy = u8>>;
61 //~^ ERROR type `priv_parent_substs::Priv` is private
62 pub type InSignatureTy2 = Box<PubTr<AssocTy = u8>>;
63 //~^ ERROR type `priv_parent_substs::Priv` is private
64 trait InSignatureTr1: PubTrWithParam<AssocTy = u8> {}
65 //~^ ERROR type `priv_parent_substs::Priv` is private
66 trait InSignatureTr2: PubTr<AssocTy = u8> {}
67 //~^ ERROR type `priv_parent_substs::Priv` is private
70 fn priv_parent_substs() {
71 priv_parent_substs::mac!();