-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.breaking-changeThe RFC proposes a breaking change.The RFC proposes a breaking change.
Description
Issue by erickt
Saturday Jan 17, 2015 at 16:01 GMT
For earlier discussion, see rust-lang/rust#21301
This issue was labelled with: A-associated-items in the Rust repository
This is a weird case that we should probably not allow:
mod T {
pub type Type = i32;
}
trait Trait {
type Type;
}
impl Trait for i32 {
type Type = i8;
}
struct Baz<T: Trait> {
a: T::Type,
}
fn main() {
let x: Baz<i32> = Baz { a: 0i8 };
}
The rule appears to be that the <T: Trait>
has precedence over the module, it would be easiest if we just errored out in this circumstance.
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.breaking-changeThe RFC proposes a breaking change.The RFC proposes a breaking change.