-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyT-langRelevant to the language teamRelevant to the language team
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
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyT-langRelevant to the language teamRelevant to the language team
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity