Open
Description
The test at http://is.gd/xHYV2z was extracted from the qcollect-traits
package on crates.io. It fails to compile due to a false ambiguity between the higher-ranked where-clause and the other one. This is particularly frustrating because the ambiguity occurs as part of projection and the higher-ranked where clause doesn't even list a binding for Output
.
The correct fix is probably to prune one where clause or the other as part of selection, but this is a bit tricky with the current region setup due to #21974.
pub trait ImmutableSequenceTypes<'a, T:'a>{
type Output;
}
pub trait MutableSequenceTypes<'a, T:'a>: ImmutableSequenceTypes<'a, T> {
}
fn foo<'t,X,T:'t>()
where X: for<'a> ImmutableSequenceTypes<'a, T>,
X: ImmutableSequenceTypes<'t, T, Output=&'t T>
{
bar::<<X as ImmutableSequenceTypes<'t,T>>::Output>();
}
fn bar<A>() { }
fn main() { }
(Due to this bug, PR #27641 causes a regression in qcollect-traits
, but the problem is pre-existing.)