Skip to content

Commit c4a37fb

Browse files
authored
Fix compile warnings on nightly (#1510)
1 parent 30200e1 commit c4a37fb

6 files changed

Lines changed: 3 additions & 22 deletions

File tree

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ pub trait AstWriter {
203203
consequent,
204204
alternative,
205205
ty,
206-
range: _,
207206
} => {
208207
self.write_if_else(
209208
ast,
@@ -222,7 +221,7 @@ pub trait AstWriter {
222221
Node::Loop { body, ty, range: _ } => {
223222
self.write_loop(ast, nodeidx, body, newfunc, operators, input_wasm, ty)?
224223
}
225-
Node::Block { body, ty, range: _ } => {
224+
Node::Block { body, ty } => {
226225
self.write_block(ast, nodeidx, body, newfunc, operators, input_wasm, ty)?
227226
}
228227
Node::Root(body) => {
@@ -304,11 +303,10 @@ impl AstBuilder {
304303
consequent: then_branch,
305304
alternative: None,
306305
ty: ty.expect("Missing if type"),
307-
range: frame_start..idx,
308306
});
309307
}
310308
State::Else => {
311-
let (last_frame, ty, if_start) = parse_context.pop_frame()?;
309+
let (last_frame, ty, _if_start) = parse_context.pop_frame()?;
312310
// Validate parent
313311
match last_frame {
314312
State::If => {}
@@ -322,7 +320,6 @@ impl AstBuilder {
322320
consequent: then_branch,
323321
alternative: Some(else_branch),
324322
ty: ty.expect("Missing if type"),
325-
range: if_start..idx,
326323
});
327324
}
328325
State::Loop => {
@@ -342,7 +339,6 @@ impl AstBuilder {
342339
parse_context.push_node_to_current_parsing(Node::Block {
343340
body: children,
344341
ty: ty.expect("Missing block type for loop"),
345-
range: frame_start..idx,
346342
});
347343
}
348344
State::Root => {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pub enum Node {
5151
alternative: Option<Vec<usize>>,
5252
/// The block type for the branches.
5353
ty: BlockType,
54-
range: Range<usize>,
5554
},
5655
/// Code node
5756
Code {
@@ -73,8 +72,6 @@ pub enum Node {
7372
body: Vec<usize>,
7473
/// Block type
7574
ty: BlockType,
76-
/// Range on the instructions stream
77-
range: Range<usize>,
7875
},
7976
/// Special node to wrap the root nodes of the Ast
8077
Root(Vec<usize>),
@@ -147,7 +144,6 @@ impl ParseContext {
147144
consequent: _,
148145
alternative: _,
149146
ty: _,
150-
range: _,
151147
} => self.ifs.push(id),
152148
Node::Loop { .. } => self.loops.push(id),
153149
Node::Block { .. } => self.blocks.push(id),

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ impl PeepholeMutator {
306306
for resource in &needed_resources {
307307
match resource {
308308
ResourceRequest::Global {
309-
index: _,
310309
tpe: ty,
311310
mutable,
312311
shared,

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ pub struct BBlock {
4343
pub struct StackEntry {
4444
/// Lang enode operator mapping
4545
pub operator: Lang,
46-
/// Index in the MiniDFG entries collection
47-
pub entry_idx: usize,
4846
/// Color of the dfg part
4947
pub color: u32,
5048
/// Instruction index if its apply
@@ -292,7 +290,6 @@ impl<'a> DFGBuilder {
292290

293291
let new_node = StackEntry {
294292
operator,
295-
entry_idx,
296293
color: self.color,
297294
operator_idx,
298295
};
@@ -321,7 +318,6 @@ impl<'a> DFGBuilder {
321318

322319
let leaf = StackEntry {
323320
operator: Lang::Undef,
324-
entry_idx,
325321
color: UNDEF_COLOR,
326322
operator_idx,
327323
};

crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/expr2wasm.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ use wasm_encoder::{Function, Instruction};
1717
pub enum ResourceRequest {
1818
/// Global resource request
1919
Global {
20-
/// Global index
21-
index: usize,
2220
/// Global type
2321
tpe: PrimitiveTypeInfo,
2422
/// If its mutable
@@ -362,7 +360,6 @@ pub fn expr2wasm(
362360
Lang::I32UseGlobal(_) => {
363361
// Request a new global
364362
let request = ResourceRequest::Global {
365-
index: global_idx as usize,
366363
tpe: PrimitiveTypeInfo::I32,
367364
mutable: true,
368365
shared: false,
@@ -375,7 +372,6 @@ pub fn expr2wasm(
375372
}
376373
Lang::I64UseGlobal(_) => {
377374
let request = ResourceRequest::Global {
378-
index: global_idx as usize,
379375
tpe: PrimitiveTypeInfo::I64,
380376
mutable: true,
381377
shared: false,
@@ -388,7 +384,6 @@ pub fn expr2wasm(
388384
}
389385
Lang::F32UseGlobal(_) => {
390386
let request = ResourceRequest::Global {
391-
index: global_idx as usize,
392387
tpe: PrimitiveTypeInfo::F32,
393388
mutable: true,
394389
shared: false,
@@ -401,7 +396,6 @@ pub fn expr2wasm(
401396
}
402397
Lang::F64UseGlobal(_) => {
403398
let request = ResourceRequest::Global {
404-
index: global_idx as usize,
405399
tpe: PrimitiveTypeInfo::F64,
406400
mutable: true,
407401
shared: false,

crates/wast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ macro_rules! custom_keyword {
9696
#[allow(non_camel_case_types)]
9797
#[allow(missing_docs)]
9898
#[derive(Debug, Copy, Clone)]
99-
pub struct $name(pub $crate::token::Span);
99+
pub struct $name(#[allow(dead_code)] pub $crate::token::Span);
100100

101101
impl<'a> $crate::parser::Parse<'a> for $name {
102102
fn parse(parser: $crate::parser::Parser<'a>) -> $crate::parser::Result<Self> {

0 commit comments

Comments
 (0)