A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
Document that cloning a `SecondaryMap`'s default value should not allocate (#12667)
Nick Fitzgeraldccfd33b495b7
diff --git a/crates/environ/src/collections/secondary_map.rs b/crates/environ/src/collections/secondary_map.rsindex 1ceb052792..d9e91de07d 100644--- a/crates/environ/src/collections/secondary_map.rs+++ b/crates/environ/src/collections/secondary_map.rs@@ -27,6 +27,8 @@ whereV: Clone,{/// Same as [`cranelift_entity::SecondaryMap::new`].+ ///+ /// XXX: `Clone::clone(&<V as Default>::default())` should never allocate.pub fn new() -> SelfwhereV: Default,@@ -37,6 +39,8 @@ where}/// Same as [`cranelift_entity::SecondaryMap::try_with_capacity`].+ ///+ /// XXX: `Clone::clone(&<V as Default>::default())` should never allocate.pub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>whereV: Default,@@ -47,6 +51,8 @@ where}/// Same as [`cranelift_entity::SecondaryMap::with_default`].+ ///+ /// XXX: `Clone::clone(&default)` should never allocate.pub fn with_default(default: V) -> Self {Self {inner: Inner::with_default(default),