summaryrefslogtreecommitdiffstats
path: root/src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs')
-rw-r--r--src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs b/src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs
new file mode 100644
index 000000000..fda825bc6
--- /dev/null
+++ b/src/test/ui/btreemap/btreemap_into_iterator_lifetime.rs
@@ -0,0 +1,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() {}