about summary refs log tree commit diff
path: root/tests/ui/pub/pub-restricted-warning.rs
blob: 80384afbb008b0c9f2a46ec185561e4ed02b64c2 (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
//@ check-pass

#![allow(dead_code)]

mod outer {
    pub mod inner {
        pub(in crate::outer) struct Foo;
        pub fn bar() -> Foo {
            //~^ WARNING type `Foo` is more private than the item `outer::inner::bar` [private_interfaces]
            Foo
        }
    }

    pub mod nested {
        pub mod inner {
            pub(in crate::outer::nested) struct NestedFoo;
            pub fn bar() -> NestedFoo {
                //~^ WARNING type `NestedFoo` is more private than the item `nested::inner::bar` [private_interfaces]
                NestedFoo
            }
        }
    }
}

fn main() {}