Closed
Description
This code fails to compile (unless foo is declared as "pub fn foo()..."):
mod m1 {
fn foo() {}
}
use m1::foo;
>rustc test.rs
test.rs:4:4: 4:12 error: failed to resolve import
test.rs:4 use m1::foo;
^~~~~~~~
This one, however, succeeds:
mod m1 {
fn foo() {}
}
use m1::*;
fn main()
{
foo();
}
It is a bit surprising to me that wildcard import pulls in all module members, including non-publics, whereas named import doesn't. I wonder if this is a bug.