2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
2020-08-05 16:07:10 -05:00
|
|
|
|
|
|
|
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() {}
|