summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-53119.rs
blob: d19a9a0327cf6cacff3b9e78f09b8042034b2ce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// check-pass
// revisions: current next
//[next] compile-flags: -Znext-solver

use std::ops::Deref;

pub struct TypeFieldIterator<'a, T: 'a> {
    _t: &'a T,
}

pub struct Type<Id, T> {
    _types: Vec<(Id, T)>,
}

impl<'a, Id: 'a, T> Iterator for TypeFieldIterator<'a, T>
where T: Deref<Target = Type<Id, T>> {
    type Item = &'a (Id, T);

    fn next(&mut self) -> Option<&'a (Id, T)> {
        || self.next();
        None
    }
}

fn main() { }