Skip to content

Commit 7856348

Browse files
authored
Implement Default for our OOM-handling PrimaryMap (#12470)
1 parent c656ed3 commit 7856348

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/environ/src/collections/primary_map.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ where
1515
inner: cranelift_entity::PrimaryMap<K, V>,
1616
}
1717

18+
impl<K, V> Default for PrimaryMap<K, V>
19+
where
20+
K: EntityRef,
21+
{
22+
fn default() -> Self {
23+
Self {
24+
inner: cranelift_entity::PrimaryMap::default(),
25+
}
26+
}
27+
}
28+
1829
impl<K, V> fmt::Debug for PrimaryMap<K, V>
1930
where
2031
K: EntityRef + fmt::Debug,

0 commit comments

Comments
 (0)