@@ -32,6 +32,33 @@ pub struct PublicType {
3232 pub other_field : PubType , // Type from public dependency - this is fine
3333}
3434
35+ pub struct PublicTuple (
36+ pub OtherType ,
37+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface [exported_private_dependencies]
38+ OtherType ,
39+ PubType ,
40+ ) ;
41+
42+ pub enum PublicEnum {
43+ OtherType ,
44+ ActualOtherType ( OtherType , PubType ) ,
45+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface [exported_private_dependencies]
46+ ActualOtherTypeStruct {
47+ field : OtherType ,
48+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface [exported_private_dependencies]
49+ other_field : PubType ,
50+ } ,
51+ }
52+
53+ pub struct PublicGenericType < T , U > ( pub T , U ) ;
54+ pub type ReexportedPublicGeneric = PublicGenericType < OtherType , ( ) > ;
55+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
56+ pub type ReexportedPrivateGeneric = PublicGenericType < ( ) , OtherType > ;
57+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
58+
59+ pub struct PublicGenericBoundedType < T : OtherTrait > ( T ) ;
60+ //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
61+
3562impl PublicType {
3663 pub fn pub_fn_param ( param : OtherType ) { }
3764 //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
@@ -44,8 +71,21 @@ impl PublicType {
4471
4572pub trait MyPubTrait {
4673 type Foo : OtherTrait ;
74+ //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
75+
76+ fn required_impl_trait ( ) -> impl OtherTrait ;
77+ //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
78+
79+ fn provided_impl_trait ( ) -> impl OtherTrait { OtherType }
80+ //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
81+ //~| ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
82+
83+ fn required_concrete ( ) -> OtherType ;
84+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
85+
86+ fn provided_concrete ( ) -> OtherType { OtherType }
87+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
4788}
48- //~^^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
4989
5090pub trait WithSuperTrait : OtherTrait { }
5191//~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
@@ -63,6 +103,12 @@ impl PubLocalTraitWithAssoc for PrivateAssoc {
63103pub fn in_bounds < T : OtherTrait > ( x : T ) { unimplemented ! ( ) }
64104//~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
65105
106+ pub fn private_return_impl_trait ( ) -> impl OtherTrait { OtherType }
107+ //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface
108+
109+ pub fn private_return ( ) -> OtherType { OtherType }
110+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
111+
66112pub fn private_in_generic ( ) -> std:: num:: Saturating < OtherType > { unimplemented ! ( ) }
67113//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
68114
@@ -75,6 +121,9 @@ pub const CONST: OtherType = OtherType;
75121pub type Alias = OtherType ;
76122//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
77123
124+ pub type AliasOfAlias = priv_dep:: PubPub ;
125+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
126+
78127pub struct PublicWithPrivateImpl ;
79128
80129impl OtherTrait for PublicWithPrivateImpl { }
@@ -86,6 +135,22 @@ impl PubTraitOnPrivate for OtherType {}
86135//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
87136//~| ERROR type `OtherType` from private dependency 'priv_dep' in public interface
88137
138+ pub struct PublicWithStdImpl ;
139+
140+ impl From < OtherType > for PublicWithStdImpl {
141+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
142+ fn from ( val : OtherType ) -> Self { Self }
143+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
144+ }
145+
146+ impl From < PublicWithStdImpl > for OtherType {
147+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
148+ //~| ERROR type `OtherType` from private dependency 'priv_dep' in public interface
149+ fn from ( val : PublicWithStdImpl ) -> Self { Self }
150+ //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface
151+ //~| ERROR type `OtherType` from private dependency 'priv_dep' in public interface
152+ }
153+
89154pub struct AllowedPrivType {
90155 #[ allow( exported_private_dependencies) ]
91156 pub allowed : OtherType ,
@@ -103,4 +168,13 @@ pub use pm::pm_attr;
103168pub use priv_dep:: E :: V1 ;
104169//~^ ERROR variant `V1` from private dependency 'priv_dep' is re-exported
105170
171+ pub use priv_dep:: Unit ;
172+ //~^ ERROR type alias `Unit` from private dependency 'priv_dep' is re-exported
173+ pub use priv_dep:: PubPub ;
174+ //~^ ERROR type alias `PubPub` from private dependency 'priv_dep' is re-exported
175+ pub use priv_dep:: PubPriv ;
176+ //~^ ERROR type alias `PubPriv` from private dependency 'priv_dep' is re-exported
177+ pub use priv_dep:: OtherType as Renamed ;
178+ //~^ ERROR struct `Renamed` from private dependency 'priv_dep' is re-exported
179+
106180fn main ( ) { }
0 commit comments