2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2023-06-01 22:05:16 -05:00
|
|
|
// revisions: current next
|
|
|
|
//[next] compile-flags: -Ztrait-solver=next
|
2018-08-08 02:02:47 -05:00
|
|
|
|
|
|
|
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() { }
|