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