diff --git a/fuzz/fuzz_targets/equivalence_jit.rs b/fuzz/fuzz_targets/equivalence_jit.rs index 751278b9abb..66e74e9019d 100644 --- a/fuzz/fuzz_targets/equivalence_jit.rs +++ b/fuzz/fuzz_targets/equivalence_jit.rs @@ -31,13 +31,12 @@ impl Config for ExportedFunctionConfig { } } -#[derive(Arbitrary)] struct WasmSmithModule(ConfiguredModule); -impl Default for WasmSmithModule { - fn default() -> Self { - let mut inner = ConfiguredModule::::default(); - inner.ensure_termination(100000); - Self(inner) +impl<'a> arbitrary::Arbitrary<'a> for WasmSmithModule { + fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { + let mut module = ConfiguredModule::::arbitrary(u)?; + module.ensure_termination(100000); + Ok(WasmSmithModule(module)) } } impl std::fmt::Debug for WasmSmithModule { diff --git a/fuzz/fuzz_targets/jit_cranelift.rs b/fuzz/fuzz_targets/jit_cranelift.rs index 6f7bb4afc14..26eb9f7f4e0 100644 --- a/fuzz/fuzz_targets/jit_cranelift.rs +++ b/fuzz/fuzz_targets/jit_cranelift.rs @@ -20,7 +20,7 @@ impl Config for NoImportsConfig { false } } -#[derive(Default, Arbitrary)] +#[derive(Arbitrary)] struct WasmSmithModule(ConfiguredModule); impl std::fmt::Debug for WasmSmithModule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/fuzz/fuzz_targets/jit_llvm.rs b/fuzz/fuzz_targets/jit_llvm.rs index badf65d9faa..7885485e3df 100644 --- a/fuzz/fuzz_targets/jit_llvm.rs +++ b/fuzz/fuzz_targets/jit_llvm.rs @@ -20,7 +20,7 @@ impl Config for NoImportsConfig { false } } -#[derive(Default, Arbitrary)] +#[derive(Arbitrary)] struct WasmSmithModule(ConfiguredModule); impl std::fmt::Debug for WasmSmithModule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/fuzz/fuzz_targets/jit_singlepass.rs b/fuzz/fuzz_targets/jit_singlepass.rs index 163b1e911fa..94a7a0448ea 100644 --- a/fuzz/fuzz_targets/jit_singlepass.rs +++ b/fuzz/fuzz_targets/jit_singlepass.rs @@ -20,7 +20,7 @@ impl Config for NoImportsConfig { false } } -#[derive(Default, Arbitrary)] +#[derive(Arbitrary)] struct WasmSmithModule(ConfiguredModule); impl std::fmt::Debug for WasmSmithModule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/fuzz/fuzz_targets/metering.rs b/fuzz/fuzz_targets/metering.rs index 3262ca995b1..6f5e56e5243 100644 --- a/fuzz/fuzz_targets/metering.rs +++ b/fuzz/fuzz_targets/metering.rs @@ -24,7 +24,7 @@ impl Config for NoImportsConfig { } } -#[derive(Default, Arbitrary)] +#[derive(Arbitrary)] struct WasmSmithModule(ConfiguredModule); impl std::fmt::Debug for WasmSmithModule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/fuzz/fuzz_targets/native_cranelift.rs b/fuzz/fuzz_targets/native_cranelift.rs index 06e688fde6a..1be7c5e17c3 100644 --- a/fuzz/fuzz_targets/native_cranelift.rs +++ b/fuzz/fuzz_targets/native_cranelift.rs @@ -20,7 +20,7 @@ impl Config for NoImportsConfig { false } } -#[derive(Default, Arbitrary)] +#[derive(Arbitrary)] struct WasmSmithModule(ConfiguredModule); impl std::fmt::Debug for WasmSmithModule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {