#![feature(decl_macro, associated_type_defaults)] #![allow(unused, private_in_public)] mod priv_trait { trait PrivTr { type AssocTy = u8; } pub trait PubTr: PrivTr {} pub macro mac1() { let _: Box>; //~^ ERROR trait `PrivTr` is private //~| ERROR trait `PrivTr` is private type InSignatureTy2 = Box>; //~^ ERROR trait `PrivTr` is private trait InSignatureTr2: PubTr {} //~^ ERROR trait `PrivTr` is private } pub macro mac2() { let _: Box>; //~^ ERROR trait `PrivTr` is private //~| ERROR trait `PrivTr` is private type InSignatureTy1 = Box>; //~^ ERROR trait `PrivTr` is private trait InSignatureTr1: PrivTr {} //~^ ERROR trait `PrivTr` is private } } fn priv_trait1() { priv_trait::mac1!(); } fn priv_trait2() { priv_trait::mac2!(); } mod priv_parent_substs { pub trait PubTrWithParam { type AssocTy = u8; } struct Priv; pub trait PubTr: PubTrWithParam {} pub macro mac() { let _: Box>; //~^ ERROR type `Priv` is private //~| ERROR type `Priv` is private let _: Box>; //~^ ERROR type `Priv` is private //~| ERROR type `Priv` is private pub type InSignatureTy1 = Box>; //~^ ERROR type `Priv` is private pub type InSignatureTy2 = Box>; //~^ ERROR type `Priv` is private trait InSignatureTr1: PubTrWithParam {} //~^ ERROR type `Priv` is private trait InSignatureTr2: PubTr {} //~^ ERROR type `Priv` is private } } fn priv_parent_substs() { priv_parent_substs::mac!(); } fn main() {}