Update to the rustfmt in rust 1.28, which is now stable.
Also, rustfmt's --write-mode=check is now named --check.
This commit is contained in:
@@ -210,7 +210,8 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
call_args: &[ir::Value],
|
||||
) -> WasmResult<ir::Inst> {
|
||||
// Pass the current function's vmctx parameter on to the callee.
|
||||
let vmctx = pos.func
|
||||
let vmctx = pos
|
||||
.func
|
||||
.special_param(ir::ArgumentPurpose::VMContext)
|
||||
.expect("Missing vmctx parameter");
|
||||
|
||||
@@ -236,7 +237,8 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
args.extend(call_args.iter().cloned(), &mut pos.func.dfg.value_lists);
|
||||
args.push(vmctx, &mut pos.func.dfg.value_lists);
|
||||
|
||||
Ok(pos.ins()
|
||||
Ok(pos
|
||||
.ins()
|
||||
.CallIndirect(ir::Opcode::CallIndirect, VOID, sig_ref, args)
|
||||
.0)
|
||||
}
|
||||
@@ -249,7 +251,8 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
call_args: &[ir::Value],
|
||||
) -> WasmResult<ir::Inst> {
|
||||
// Pass the current function's vmctx parameter on to the callee.
|
||||
let vmctx = pos.func
|
||||
let vmctx = pos
|
||||
.func
|
||||
.special_param(ir::ArgumentPurpose::VMContext)
|
||||
.expect("Missing vmctx parameter");
|
||||
|
||||
|
||||
@@ -248,10 +248,8 @@ mod tests {
|
||||
// )
|
||||
const BODY: [u8; 7] = [
|
||||
0x00, // local decl count
|
||||
0x20,
|
||||
0x00, // get_local 0
|
||||
0x41,
|
||||
0x01, // i32.const 1
|
||||
0x20, 0x00, // get_local 0
|
||||
0x41, 0x01, // i32.const 1
|
||||
0x6a, // i32.add
|
||||
0x0b, // end
|
||||
];
|
||||
@@ -280,10 +278,8 @@ mod tests {
|
||||
// )
|
||||
const BODY: [u8; 8] = [
|
||||
0x00, // local decl count
|
||||
0x20,
|
||||
0x00, // get_local 0
|
||||
0x41,
|
||||
0x01, // i32.const 1
|
||||
0x20, 0x00, // get_local 0
|
||||
0x41, 0x01, // i32.const 1
|
||||
0x6a, // i32.add
|
||||
0x0f, // return
|
||||
0x0b, // end
|
||||
@@ -318,19 +314,13 @@ mod tests {
|
||||
// )
|
||||
const BODY: [u8; 16] = [
|
||||
0x01, // 1 local decl.
|
||||
0x01,
|
||||
0x7f, // 1 i32 local.
|
||||
0x03,
|
||||
0x7f, // loop i32
|
||||
0x20,
|
||||
0x00, // get_local 0
|
||||
0x41,
|
||||
0x01, // i32.const 0
|
||||
0x01, 0x7f, // 1 i32 local.
|
||||
0x03, 0x7f, // loop i32
|
||||
0x20, 0x00, // get_local 0
|
||||
0x41, 0x01, // i32.const 0
|
||||
0x6a, // i32.add
|
||||
0x21,
|
||||
0x00, // set_local 0
|
||||
0x0c,
|
||||
0x00, // br 0
|
||||
0x21, 0x00, // set_local 0
|
||||
0x0c, 0x00, // br 0
|
||||
0x0b, // end
|
||||
0x0b, // end
|
||||
];
|
||||
|
||||
@@ -412,9 +412,11 @@ pub fn parse_code_section<'data>(
|
||||
}
|
||||
let mut reader = parser.create_binary_reader();
|
||||
let size = reader.bytes_remaining();
|
||||
environ.define_function_body(reader
|
||||
.read_bytes(size)
|
||||
.map_err(WasmError::from_binary_reader_error)?)?;
|
||||
environ.define_function_body(
|
||||
reader
|
||||
.read_bytes(size)
|
||||
.map_err(WasmError::from_binary_reader_error)?,
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -282,7 +282,8 @@ impl TranslationState {
|
||||
environ: &mut FE,
|
||||
) -> GlobalVariable {
|
||||
let index = index as GlobalIndex;
|
||||
*self.globals
|
||||
*self
|
||||
.globals
|
||||
.entry(index)
|
||||
.or_insert_with(|| environ.make_global(func, index))
|
||||
}
|
||||
@@ -296,7 +297,8 @@ impl TranslationState {
|
||||
environ: &mut FE,
|
||||
) -> ir::Heap {
|
||||
let index = index as MemoryIndex;
|
||||
*self.heaps
|
||||
*self
|
||||
.heaps
|
||||
.entry(index)
|
||||
.or_insert_with(|| environ.make_heap(func, index))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user