about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/wf-check-rpit-lifetimes.rs
blob: bca146ffd117b720ad051afb2f1b232601c45473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@check-pass

pub struct Key;
#[derive(Clone)]
pub struct Value;

use std::collections::HashMap;

pub struct DiagnosticBuilder<'db> {
    inner: HashMap<&'db Key, Vec<&'db Value>>,
}

impl<'db> DiagnosticBuilder<'db> {
    pub fn iter<'a>(&'a self) -> impl Iterator<Item = (&'db Key, impl Iterator<Item = &'a Value>)> {
        self.inner.iter().map(|(key, values)| (*key, values.iter().map(|v| *v)))
    }
}

fn main() {}