-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language team
Description
This compiles:
mod foo {
trait IntoIterator {}
fn f() { Some(0).into_iter(); }
}
but this doesn't:
trait T {}
mod bar {
use T as IntoIterator;
fn f() { Some(0).into_iter(); }
}
More generally, a shadowed trait's methods are usable if it is shadowed by an item, but not if it is shadowed by an import.
Should methods from shadowed traits be usable?
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language team