Skip to content

Commit 13240cc

Browse files
committed
add a regression test
1 parent f30eeca commit 13240cc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//@ check-pass
2+
//@ compile-flags: -Znext-solver
3+
//@ ignore-compare-mode-next-solver (explicitly enabled)
4+
5+
// Regression test for an ICE when trying to bootstrap rustc
6+
// with #125343. An ambiguous goal returned a `TypeOutlives`
7+
// constraint referencing an inference variable. This inference
8+
// variable was created inside of the goal, causing it to be
9+
// unconstrained in the caller. This then caused an ICE in MIR
10+
// borrowck.
11+
12+
struct Foo<T>(T);
13+
trait Extend<T> {
14+
fn extend<I: IntoIterator<Item = T>>(iter: I);
15+
}
16+
17+
impl<T> Extend<T> for Foo<T> {
18+
fn extend<I: IntoIterator<Item = T>>(_: I) {
19+
todo!()
20+
}
21+
}
22+
23+
impl<'a, T: 'a + Copy> Extend<&'a T> for Foo<T> {
24+
fn extend<I: IntoIterator<Item = &'a T>>(iter: I) {
25+
<Self as Extend<T>>::extend(iter.into_iter().copied())
26+
}
27+
}
28+
29+
fn main() {}

0 commit comments

Comments
 (0)