Update to rustfmt-preview (#348)
* Update to rustfmt-preview. * Run "cargo fmt --all" with rustfmt 0.4.1. rustfmt 0.4.1 is the latest release of rustfmt-preview available on the stable channel. * Fix a long line that rustfmt 0.4.1 can't handle. * Remove unneeded commas left behind by rustfmt.
This commit is contained in:
@@ -165,7 +165,9 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
base: ir::HeapBase::GlobalVar(gv),
|
||||
min_size: 0.into(),
|
||||
guard_size: 0x8000_0000.into(),
|
||||
style: ir::HeapStyle::Static { bound: 0x1_0000_0000.into() },
|
||||
style: ir::HeapStyle::Static {
|
||||
bound: 0x1_0000_0000.into(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -224,11 +226,9 @@ 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()
|
||||
.CallIndirect(ir::Opcode::CallIndirect, VOID, sig_ref, args)
|
||||
.0,
|
||||
)
|
||||
Ok(pos.ins()
|
||||
.CallIndirect(ir::Opcode::CallIndirect, VOID, sig_ref, args)
|
||||
.0)
|
||||
}
|
||||
|
||||
fn translate_call(
|
||||
@@ -301,10 +301,9 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
"Imported functions must be declared first"
|
||||
);
|
||||
self.info.functions.push(Exportable::new(sig_index));
|
||||
self.info.imported_funcs.push((
|
||||
String::from(module),
|
||||
String::from(field),
|
||||
));
|
||||
self.info
|
||||
.imported_funcs
|
||||
.push((String::from(module), String::from(field)));
|
||||
}
|
||||
|
||||
fn get_num_func_imports(&self) -> usize {
|
||||
@@ -353,33 +352,27 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
}
|
||||
|
||||
fn declare_func_export(&mut self, func_index: FunctionIndex, name: &'data str) {
|
||||
self.info.functions[func_index].export_names.push(
|
||||
String::from(
|
||||
name,
|
||||
),
|
||||
);
|
||||
self.info.functions[func_index]
|
||||
.export_names
|
||||
.push(String::from(name));
|
||||
}
|
||||
|
||||
fn declare_table_export(&mut self, table_index: TableIndex, name: &'data str) {
|
||||
self.info.tables[table_index].export_names.push(
|
||||
String::from(name),
|
||||
);
|
||||
self.info.tables[table_index]
|
||||
.export_names
|
||||
.push(String::from(name));
|
||||
}
|
||||
|
||||
fn declare_memory_export(&mut self, memory_index: MemoryIndex, name: &'data str) {
|
||||
self.info.memories[memory_index].export_names.push(
|
||||
String::from(
|
||||
name,
|
||||
),
|
||||
);
|
||||
self.info.memories[memory_index]
|
||||
.export_names
|
||||
.push(String::from(name));
|
||||
}
|
||||
|
||||
fn declare_global_export(&mut self, global_index: GlobalIndex, name: &'data str) {
|
||||
self.info.globals[global_index].export_names.push(
|
||||
String::from(
|
||||
name,
|
||||
),
|
||||
);
|
||||
self.info.globals[global_index]
|
||||
.export_names
|
||||
.push(String::from(name));
|
||||
}
|
||||
|
||||
fn declare_start_func(&mut self, func_index: FunctionIndex) {
|
||||
@@ -395,11 +388,8 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
let sig = func_environ.vmctx_sig(self.get_func_type(function_index));
|
||||
let mut func = ir::Function::with_name_signature(name, sig);
|
||||
let reader = wasmparser::BinaryReader::new(body_bytes);
|
||||
self.trans.translate_from_reader(
|
||||
reader,
|
||||
&mut func,
|
||||
&mut func_environ,
|
||||
)?;
|
||||
self.trans
|
||||
.translate_from_reader(reader, &mut func, &mut func_environ)?;
|
||||
func
|
||||
};
|
||||
self.func_bytecode_sizes.push(body_bytes.len());
|
||||
|
||||
Reference in New Issue
Block a user