Closed
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.