1 // aux-build:priv_dep.rs
2 // aux-build:pub_dep.rs
3 // compile-flags: --extern-public=pub_dep
4 #![feature(public_private_dependencies)]
5 #![deny(exported_private_dependencies)]
7 // This crate is a private dependency
9 // This crate is a public dependenct
12 use priv_dep::{OtherType, OtherTrait};
15 // Type from private dependency used in private
16 // type - this is fine
21 pub struct PublicType {
23 //~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface
24 //~| WARNING this was previously accepted
25 priv_field: OtherType, // Private field - this is fine
26 pub other_field: PubType // Type from public dependency - this is fine
30 pub fn pub_fn(param: OtherType) {}
31 //~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface
32 //~| WARNING this was previously accepted
34 fn priv_fn(param: OtherType) {}
37 pub trait MyPubTrait {
40 //~^^^ ERROR trait `priv_dep::OtherTrait` from private dependency 'priv_dep' in public interface
41 //~| WARNING this was previously accepted