You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This is allowed but doesn't do what you might expect.
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.
The text was updated successfully, but these errors were encountered: