Skip to content

Commit cedf96c

Browse files
committed
Add a test for BTreeMap lifetime bound to see if it compiles
1 parent 62e06a4 commit cedf96c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// check-pass
2+
3+
use std::collections::{BTreeMap, HashMap};
4+
5+
trait Map
6+
where
7+
for<'a> &'a Self: IntoIterator<Item = (&'a Self::Key, &'a Self::Value)>,
8+
{
9+
type Key;
10+
type Value;
11+
}
12+
13+
impl<K, V> Map for HashMap<K, V> {
14+
type Key = K;
15+
type Value = V;
16+
}
17+
18+
impl<K, V> Map for BTreeMap<K, V> {
19+
type Key = K;
20+
type Value = V;
21+
}
22+
23+
fn main() {}

0 commit comments

Comments
 (0)