]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-42552.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / issues / issue-42552.rs
CommitLineData
b7449926 1// run-pass
7cac9316
XL
2// Regression test for an obscure issue with the projection cache.
3
4fn into_iter<I: Iterator>(a: &I) -> Groups<I> {
5 Groups { _a: a }
6}
7
8pub struct Groups<'a, I: 'a> {
9 _a: &'a I,
10}
11
12impl<'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
19pub 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
27fn main() {
28 let _ = into_iter(&[0].iter().map(|_| 0)).map(|grp| {
29 let _g = grp;
30 });
31}