-
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 binaries
Milestone
Description
This is allowed but doesn't do what you might expect.
mod foo {
pub fn bar() -> int { 10 }
}
mod baz {
pub fn bar() -> int { 20 }
}
use foo = baz;
fn main() {
// This will fail - calling into mod foo, not mod baz
assert foo::bar() == 20;
}
It used to be that 'use' statements only came before items and the items shadowed the use statements. Now they may appear alongside items, but the items still shadow the use statements, regardless of order.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binaries