]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
7cac9316 XL |
2 | // Regression test for an obscure issue with the projection cache. |
3 | ||
4 | fn into_iter<I: Iterator>(a: &I) -> Groups<I> { | |
5 | Groups { _a: a } | |
6 | } | |
7 | ||
8 | pub struct Groups<'a, I: 'a> { | |
9 | _a: &'a I, | |
10 | } | |
11 | ||
12 | impl<'a, I: Iterator> Iterator for Groups<'a, I> { | |
13 | type Item = Group<'a, I>; | |
14 | fn next(&mut self) -> Option<Self::Item> { | |
15 | None | |
16 | } | |
17 | } | |
18 | ||
19 | pub struct Group<'a, I: Iterator + 'a> | |
20 | where I::Item: 'a // <-- needed to trigger ICE! | |
21 | { | |
22 | _phantom: &'a (), | |
23 | _ice_trigger: I::Item, // <-- needed to trigger ICE! | |
24 | } | |
25 | ||
26 | ||
27 | fn main() { | |
28 | let _ = into_iter(&[0].iter().map(|_| 0)).map(|grp| { | |
29 | let _g = grp; | |
30 | }); | |
31 | } |