about summary refs log tree commit diff
path: root/tests/ui/privacy/pub-priv-dep/shared_indirect.rs
blob: 2fe66ae80cf48a39314dcec18612d08f8f071fb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//@ aux-crate:priv:shared=shared.rs
//@ aux-crate:priv:indirect1=indirect1.rs
//@ compile-flags: -Zunstable-options

// A shared dependency, where it is only indirectly public.
//
//            shared_indirect
//                  /\
//       (PRIVATE) /  | (PRIVATE)
//                /   |
//     indirect1 |    |
//     (PRIVATE) |    |
//     indirect2 |    |
//                \   |
//        (public) \  /
//                  \/
//                shared

#![crate_type = "lib"]
#![deny(exported_private_dependencies)]

extern crate shared;
extern crate indirect1;

pub fn leaks_priv() -> shared::Shared {
    //~^ ERROR type `Shared` from private dependency 'shared' in public interface
    shared::Shared
}