rust/tests/ui/btreemap/btreemap_into_iterator_lifetime.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
350 B
Rust
Raw Normal View History

//@ 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() {}