-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
Milestone
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.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically