Skip to content

Commit f43b418

Browse files
authored
Fix some warnings on nightly (#1409)
1 parent d514f70 commit f43b418

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

crates/wasm-mutate/src/mutators/codemotion/ir.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,22 +185,6 @@ pub trait AstWriter {
185185
Ok(())
186186
}
187187

188-
/// Default encoding for code node
189-
///
190-
/// This function is called by the defaut implementation
191-
/// of the `write_code` method
192-
fn write_code_default<'a>(
193-
&self,
194-
ast: &Ast,
195-
nodeidx: usize,
196-
range: Range<usize>,
197-
newfunc: &mut Function,
198-
operators: &Vec<OperatorAndByteOffset>,
199-
input_wasm: &'a [u8],
200-
) -> crate::Result<()> {
201-
self.write_code(ast, nodeidx, range, newfunc, operators, input_wasm)
202-
}
203-
204188
/// Encoding discriminator for the Ast nodes
205189
///
206190
/// It calls the corresponding methods depending on the node type

crates/wasm-mutate/src/mutators/peephole.rs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ use crate::{
3939
Error, ErrorKind, ModuleInfo, Result, WasmMutate,
4040
};
4141
use 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;
4543
use wasm_encoder::{CodeSection, ConstExpr, Function, GlobalSection, Module, ValType};
4644
use 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

Comments
 (0)