File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
tests/ui/traits/next-solver/normalize Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 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 ( ) { }
You can’t perform that action at this time.
0 commit comments