mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
27 lines
417 B
Rust
27 lines
417 B
Rust
// ensures that 'use foo:*' doesn't import non-public item
|
|
|
|
use m1::*;
|
|
|
|
mod foo {
|
|
pub fn foo() {}
|
|
}
|
|
mod a {
|
|
pub mod b {
|
|
use foo::foo;
|
|
type Bar = isize;
|
|
}
|
|
pub mod sub {
|
|
use 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`
|
|
}
|