Open lcnr opened 6 months ago
original test by @aliemjay :heart:
pub trait ParallelIterator {
type Item;
}
impl<T> ParallelIterator for T {
type Item = u32;
}
trait Trait {}
impl<A, B> Trait for (A, B) where
//~^ type annotations needed: cannot satisfy `<<A as ParallelIterator>::Item as ParallelIterator>::Item == u32`
A: ParallelIterator,
A::Item: ParallelIterator<Item = u32>,
B: ParallelIterator,
B::Item: ParallelIterator<Item = u32>,
{}
fn main() {}
this is the underlying reason for https://github.com/rust-lang/trait-system-refactor-initiative/issues/111, closing that issue
trait Trait<'a> {
type Assoc;
}
fn foo<'a, T: Trait<'a>>()
where
T::Assoc: Trait<'a>,
{}
this may also be the root cause of https://github.com/rust-lang/trait-system-refactor-initiative/issues/89
this should compile but fails with
The underlying issue is trying to prove
<A as Trait>::Item: Trait
normalizes the self type:normalizes-to(<A as Trait>::Item)
A::Item: Trait<Item = u32>
alias-relate(A::Item, A)
normalizes-to(<A as Trait>::Item)
inductive cycleB::Item: Trait<Item = i32>
alias-relate(B::Item, A)
normalizes-to(<B as Trait>::Item)
A::Item: Trait<Item = u32>
alias-relate(A::Item, B)
normalizes-to(<A as Trait>::Item)
inductive cycleB::Item: Trait<Item = i32>
alias-relate(B::Item, B)
normalizes-to(<B as Trait>::Item)
inductive cycle