@@ -39,9 +39,7 @@ use crate::{
3939 Error , ErrorKind , ModuleInfo , Result , WasmMutate ,
4040} ;
4141use egg:: { Rewrite , Runner } ;
42- use rand:: { prelude:: SmallRng , Rng } ;
43- use std:: ops:: Range ;
44- use std:: { borrow:: Cow , fmt:: Debug } ;
42+ use rand:: Rng ;
4543use wasm_encoder:: { CodeSection , ConstExpr , Function , GlobalSection , Module , ValType } ;
4644use wasmparser:: { CodeSectionReader , FunctionBody , GlobalSectionReader , LocalsReader } ;
4745
@@ -447,38 +445,6 @@ impl Mutator for PeepholeMutator {
447445 }
448446}
449447
450- impl Debug for Box < dyn CodeMutator > {
451- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
452- f. debug_tuple ( "Code mutator" ) . finish ( )
453- }
454- }
455-
456- pub ( crate ) trait CodeMutator {
457- fn mutate (
458- & self ,
459- config : & WasmMutate ,
460- rnd : & mut SmallRng ,
461- operator_index : usize ,
462- operators : Vec < OperatorAndByteOffset > ,
463- funcreader : FunctionBody ,
464- body_range : Range < usize > ,
465- function_data : & [ u8 ] ,
466- ) -> Result < Function > ;
467-
468- /// Returns if this mutator can be applied to the opcode at index i
469- fn can_mutate < ' a > (
470- & self ,
471- config : & ' a WasmMutate ,
472- operators : & [ OperatorAndByteOffset < ' a > ] ,
473- at : usize ,
474- ) -> Result < bool > ;
475-
476- /// Provides the name of the mutator, mostly used for debugging purposes
477- fn name ( & self ) -> Cow < ' static , str > {
478- std:: any:: type_name :: < Self > ( ) . into ( )
479- }
480- }
481-
482448// This macro is meant to be used for testing deep mutators
483449// It receives the original wat text variable, the expression returning the mutated function and the expected wat
484450// For an example, look at SwapCommutativeOperator
0 commit comments