Skip to content

Commit 5b6978a

Browse files
authored
Rollup merge of #146918 - lcnr:add-regression-test, r=jdonszelmann
add regression test closes #128887 the errors in that issue are due to two separate issues: - MIR inlining causing the trait solver to hit the recursion limit (partially fixed in #129714) - using subtyping in method selection for paths (fixed in #129073) We moved any remaining issues due to MIR inlining into #131960, but keeping #128887 open as well seems unhelpful and confusing.
2 parents 1e1a394 + 465e373 commit 5b6978a

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)