1 // aux-crate:priv:priv_dep=priv_dep.rs
2 // aux-build:pub_dep.rs
3 #![deny(exported_private_dependencies)]
5 // This crate is a private dependency
7 // This crate is a public dependency
10 use priv_dep::{OtherType, OtherTrait};
13 // Type from private dependency used in private
14 // type - this is fine
19 pub struct PublicType {
21 //~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface
22 priv_field: OtherType, // Private field - this is fine
23 pub other_field: PubType // Type from public dependency - this is fine
27 pub fn pub_fn(param: OtherType) {}
28 //~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface
30 fn priv_fn(param: OtherType) {}
33 pub trait MyPubTrait {
36 //~^^^ ERROR trait `priv_dep::OtherTrait` from private dependency 'priv_dep' in public interface
38 pub struct AllowedPrivType {
39 #[allow(exported_private_dependencies)]
40 pub allowed: OtherType