Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Remove `#[derive(Clone)]` from our OOM-handling `Vec<T>` (#12668)

Nick Fitzgerald8a8a92373779
diff --git a/crates/core/src/alloc/vec.rs b/crates/core/src/alloc/vec.rs
index 5dde4a4357..0d19a6690f 100644
--- a/crates/core/src/alloc/vec.rs
+++ b/crates/core/src/alloc/vec.rs
@@ -49,7 +49,7 @@ macro_rules! private_len {
/// Like `std::vec::Vec` but all methods that allocate force handling allocation
/// failure.
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Vec<T> {
inner: StdVec<T>,
}
diff --git a/crates/environ/src/gc.rs b/crates/environ/src/gc.rs
index 68c5ebf5ba..469396b896 100644
--- a/crates/environ/src/gc.rs
+++ b/crates/environ/src/gc.rs
@@ -370,7 +370,7 @@ impl GcArrayLayout {
/// tuples of typed fields with a certain size. The only difference in
/// practice is that an exception object also carries a tag reference
/// (at a fixed offset as per `GcTypeLayouts::exception_tag_offset`).
-#[derive(Clone, Debug)]
+#[derive(Debug)]
pub struct GcStructLayout {
/// The size (in bytes) of this struct.
pub size: u32,
diff --git a/crates/environ/src/module.rs b/crates/environ/src/module.rs
index 05468109a5..d667c9ccea 100644
--- a/crates/environ/src/module.rs
+++ b/crates/environ/src/module.rs
@@ -237,7 +237,7 @@ pub struct TableInitialization {
}
/// Initial value for all elements in a table.
-#[derive(Clone, Debug, Serialize, Deserialize)]
+#[derive(Debug, Serialize, Deserialize)]
pub enum TableInitialValue {
/// Initialize each table element to null, optionally setting some elements
/// to non-null given the precomputed image.