|
| 1 | +// https://github.com/rust-lang/rust/issues/148431 |
| 2 | + |
| 3 | +// This test is designed to hit a case where, thanks to the |
| 4 | +// recursion limit, the where clause gets generated, but not |
| 5 | +// used, because we run out of fuel. |
| 6 | +// |
| 7 | +// This results in a reverse index with nothing in it, which |
| 8 | +// used to crash when we parsed it. |
| 9 | +pub fn foobar1<A: T1<B>, B: T2<C>, C: T3<D>, D: T4<A>>(a: A) {} |
| 10 | + |
| 11 | +pub trait T1<T: ?Sized> {} |
| 12 | +pub trait T2<T: ?Sized> {} |
| 13 | +pub trait T3<T: ?Sized> {} |
| 14 | +pub trait T4<T: ?Sized> {} |
| 15 | + |
| 16 | +// foobar1 is the version that worked at the time this test was written |
| 17 | +// the rest are here to try to make the test at least a little more |
| 18 | +// robust, in the sense that it actually tests the code and isn't magically |
| 19 | +// fixed by the recursion limit changing |
| 20 | +pub fn foobar2<A: U1<B>, B: U2<C>, C: U3<D>, D: U4<E>, E: U5<A>>(a: A) {} |
| 21 | + |
| 22 | +pub trait U1<T: ?Sized> {} |
| 23 | +pub trait U2<T: ?Sized> {} |
| 24 | +pub trait U3<T: ?Sized> {} |
| 25 | +pub trait U4<T: ?Sized> {} |
| 26 | +pub trait U5<T: ?Sized> {} |
| 27 | + |
| 28 | +pub fn foobar3<A: V1<B>, B: V2<C>, C: V3<D>, D: V4<E>, E: V5<F>, F: V6<A>>(a: A) {} |
| 29 | + |
| 30 | +pub trait V1<T: ?Sized> {} |
| 31 | +pub trait V2<T: ?Sized> {} |
| 32 | +pub trait V3<T: ?Sized> {} |
| 33 | +pub trait V4<T: ?Sized> {} |
| 34 | +pub trait V5<T: ?Sized> {} |
| 35 | +pub trait V6<T: ?Sized> {} |
| 36 | + |
| 37 | +pub fn foobar4<A: W1<B>, B: W2<C>, C: W3<A>>(a: A) {} |
| 38 | + |
| 39 | +pub trait W1<T: ?Sized> {} |
| 40 | +pub trait W2<T: ?Sized> {} |
| 41 | +pub trait W3<T: ?Sized> {} |
0 commit comments