mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
24 lines
349 B
Rust
24 lines
349 B
Rust
// 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() {}
|