summaryrefslogtreecommitdiffstats
path: root/src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs
blob: fda825bc65e8080cda0417d2b80dc11415232335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// check-pass

use std::collections::{BTreeMap, HashMap};

trait Map
where
    for<'a> &'a Self: IntoIterator<Item = (&'a Self::Key, &'a Self::Value)>,
{
    type Key;
    type Value;
}

impl<K, V> Map for HashMap<K, V> {
    type Key = K;
    type Value = V;
}

impl<K, V> Map for BTreeMap<K, V> {
  type Key = K;
  type Value = V;
}

fn main() {}