Open
Description
The following should not compile, but it does:
trait Test {
type Variant;
fn test(_: ());
}
enum Enum {
Variant,
}
impl Test for <[Enum; 0] as IntoIterator>::Item { // <- Self is a projection
type Variant = ();
fn test(_: Self::Variant) { // <- this is accepted.
//None::<Self::Variant>; // <- this is rejected.
}
}
Self::Variant
here is ambiguous and should be rejected for the same reason it's rejected in the fn body.
This bug is seemingly an unintended fallout from:
https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_analysis/src/collect.rs#L520
@rustbot label T-lang A-resolve