Skip to content

Commit d8369eb

Browse files
committed
add regression test
1 parent f6092f2 commit d8369eb

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//@ check-pass
2+
3+
// Regression test for #128887.
4+
#![allow(unconditional_recursion)]
5+
trait Mappable<T> {
6+
type Output;
7+
}
8+
9+
trait Bound<T> {}
10+
// Deleting this impl made it compile on beta
11+
impl<T> Bound<T> for T {}
12+
13+
trait Generic<M> {}
14+
15+
// Deleting the `: Mappable<T>` already made it error on stable.
16+
struct IndexWithIter<I, M: Mappable<T>, T>(I, M, T);
17+
18+
impl<I, M, T> IndexWithIter<I, M, T>
19+
where
20+
<M as Mappable<T>>::Output: Bound<T>,
21+
// flipping these where bounds causes this to succeed, even when removing
22+
// the where-clause on the struct definition.
23+
M: Mappable<T>,
24+
I: Generic<M>,
25+
{
26+
fn new(x: I) {
27+
IndexWithIter::<_, _, _>::new(x);
28+
}
29+
}
30+
fn main() {}

0 commit comments

Comments
 (0)