about summary refs log tree commit diff
path: root/tests/ui/imports/issue-4366-2.rs
blob: e92d964f889329728b8a6c93db16202f0d2c851e (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
// ensures that 'use foo:*' doesn't import non-public item

use m1::*;

mod foo {
    pub fn foo() {}
}
mod a {
    pub mod b {
        use crate::foo::foo;
        type Bar = isize;
    }
    pub mod sub {
        use crate::a::b::*;
        fn sub() -> Bar { 1 }
        //~^ ERROR cannot find type `Bar` in this scope
    }
}

mod m1 {
    fn foo() {}
}

fn main() {
    foo(); //~ ERROR expected function, found module `foo`
}