-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
rust-lang/rust
#137314Description
trait Trait {
type Item;
}
fn foo<A: Trait, B: Trait>()
where
A::Item: Trait<Item = u32>,
B::Item: Trait<Item = i32>,
{}this should compile but fails with
error[E0283]: type annotations needed: cannot satisfy `<A as Trait>::Item: Trait`
--> <source>:7:14
|
7 | A::Item: Trait<Item = u32>,
| ^^^^^^^^^^^^^^^^^
|
The underlying issue is trying to prove <A as Trait>::Item: Trait normalizes the self type:
normalizes-to(<A as Trait>::Item)- candidate
A::Item: Trait<Item = u32>alias-relate(A::Item, A)normalizes-to(<A as Trait>::Item)inductive cycle
- candidate
B::Item: Trait<Item = i32>alias-relate(B::Item, A)normalizes-to(<B as Trait>::Item)- candidate
A::Item: Trait<Item = u32>alias-relate(A::Item, B)normalizes-to(<A as Trait>::Item)inductive cycle
- candidate
B::Item: Trait<Item = i32>alias-relate(B::Item, B)normalizes-to(<B as Trait>::Item)inductive cycle
- candidate
- candidate
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
done