diff --git a/lib/environ/src/environ.rs b/lib/environ/src/environ.rs index e472c697ab..1117bc4d6f 100644 --- a/lib/environ/src/environ.rs +++ b/lib/environ/src/environ.rs @@ -518,7 +518,8 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m .as_u32() .checked_mul(u32::from(sig_id_size)) .unwrap(), - ).unwrap(), + ) + .unwrap(), ); // Load the callee ID. diff --git a/lib/environ/src/lib.rs b/lib/environ/src/lib.rs index 882537c5a5..dfd3d83a62 100644 --- a/lib/environ/src/lib.rs +++ b/lib/environ/src/lib.rs @@ -6,10 +6,7 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![warn(unused_import_braces)] #![cfg_attr(feature = "std", deny(unstable_features))] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) diff --git a/lib/environ/src/vmoffsets.rs b/lib/environ/src/vmoffsets.rs index 5cb902bdca..4b3ab0961a 100644 --- a/lib/environ/src/vmoffsets.rs +++ b/lib/environ/src/vmoffsets.rs @@ -115,7 +115,8 @@ impl VMOffsets { index .checked_mul(u32::from(self.size_of_vmmemory())) .unwrap(), - ).unwrap() + ) + .unwrap() } /// Return the offset from the `globals` pointer to `VMGlobal` index `index`. @@ -124,7 +125,8 @@ impl VMOffsets { index .checked_mul(u32::from(self.size_of_vmglobal())) .unwrap(), - ).unwrap() + ) + .unwrap() } /// Return the offset from the `tables` pointer to `VMTable` index `index`. @@ -133,7 +135,8 @@ impl VMOffsets { index .checked_mul(u32::from(self.size_of_vmtable())) .unwrap(), - ).unwrap() + ) + .unwrap() } /// Return the offset from the `memories` pointer to the `base` field in diff --git a/lib/execute/src/instance.rs b/lib/execute/src/instance.rs index a78b6fee1e..bf8b690912 100644 --- a/lib/execute/src/instance.rs +++ b/lib/execute/src/instance.rs @@ -168,9 +168,9 @@ fn instantiate_tables( let subslice = &mut slice[init.offset..init.offset + init.elements.len()]; for (i, func_idx) in init.elements.iter().enumerate() { let callee_sig = module.functions[*func_idx]; - let code_buf = &compilation.functions[module.defined_func_index(*func_idx).expect( - "table element initializer with imported function not supported yet", - )]; + let code_buf = &compilation.functions[module + .defined_func_index(*func_idx) + .expect("table element initializer with imported function not supported yet")]; let type_id = sig_registry.register(callee_sig, &module.signatures[callee_sig]); subslice[i] = VMCallerCheckedAnyfunc { func_ptr: code_buf.as_ptr(), diff --git a/lib/execute/src/invoke.rs b/lib/execute/src/invoke.rs index b34b49aeff..82649a2558 100644 --- a/lib/execute/src/invoke.rs +++ b/lib/execute/src/invoke.rs @@ -114,10 +114,9 @@ pub fn invoke_by_index( fn_index: FuncIndex, args: &[Value], ) -> Result { - let code_buf = - &compilation.functions[module - .defined_func_index(fn_index) - .expect("imported start functions not supported yet")]; + let code_buf = &compilation.functions[module + .defined_func_index(fn_index) + .expect("imported start functions not supported yet")]; let sig = &module.signatures[module.functions[fn_index]]; let exec_code_buf = code.allocate_copy_of_slice(&code_buf)?.as_ptr(); diff --git a/lib/execute/src/lib.rs b/lib/execute/src/lib.rs index 3b452af51a..2dc0cb6bd0 100644 --- a/lib/execute/src/lib.rs +++ b/lib/execute/src/lib.rs @@ -3,10 +3,7 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![warn(unused_import_braces)] #![cfg_attr(feature = "std", deny(unstable_features))] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) diff --git a/lib/execute/src/libcalls.rs b/lib/execute/src/libcalls.rs index f4166c2a64..8d38337b79 100644 --- a/lib/execute/src/libcalls.rs +++ b/lib/execute/src/libcalls.rs @@ -29,7 +29,8 @@ pub extern "C" fn wasmtime_f32_nearest(x: f32) -> f32 { || (um == dm && { let h = u / 2.; h.floor() == h - }) { + }) + { u } else { d @@ -64,7 +65,8 @@ pub extern "C" fn wasmtime_f64_nearest(x: f64) -> f64 { || (um == dm && { let h = u / 2.; h.floor() == h - }) { + }) + { u } else { d diff --git a/lib/execute/src/memory.rs b/lib/execute/src/memory.rs index 6dcc4a074c..033369dce2 100644 --- a/lib/execute/src/memory.rs +++ b/lib/execute/src/memory.rs @@ -49,7 +49,8 @@ impl LinearMemory { mmap.as_ptr().add(mapped_bytes), inaccessible_bytes, region::Protection::None, - ).expect("unable to make memory inaccessible"); + ) + .expect("unable to make memory inaccessible"); } Ok(Self { @@ -108,7 +109,8 @@ impl LinearMemory { new_mmap.as_ptr().add(new_bytes), guard_bytes, region::Protection::None, - ).expect("unable to make memory inaccessible"); + ) + .expect("unable to make memory inaccessible"); } let copy_len = self.mmap.len() - self.offset_guard_size; diff --git a/lib/execute/src/world.rs b/lib/execute/src/world.rs index 15f5a6b28c..c0e20cf04d 100644 --- a/lib/execute/src/world.rs +++ b/lib/execute/src/world.rs @@ -61,6 +61,7 @@ impl InstanceWorld { self.instance.vmctx(), &function_name, args, - ).map_err(|e| e.to_string()) + ) + .map_err(|e| e.to_string()) } } diff --git a/lib/obj/src/lib.rs b/lib/obj/src/lib.rs index d8cb50abf9..0af2d9bfc8 100644 --- a/lib/obj/src/lib.rs +++ b/lib/obj/src/lib.rs @@ -7,10 +7,7 @@ unstable_features )] #![warn(unused_import_braces)] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) diff --git a/lib/wast/build.rs b/lib/wast/build.rs index 7750fb67dd..3da71c67b5 100644 --- a/lib/wast/build.rs +++ b/lib/wast/build.rs @@ -33,7 +33,8 @@ fn test_directory(out: &mut File, testsuite: &str) -> io::Result<()> { } } false - }).collect(); + }) + .collect(); dir_entries.sort_by_key(|dir| dir.path()); diff --git a/lib/wast/src/lib.rs b/lib/wast/src/lib.rs index 2ec356061b..c992a55d09 100644 --- a/lib/wast/src/lib.rs +++ b/lib/wast/src/lib.rs @@ -3,10 +3,7 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![warn(unused_import_braces)] #![deny(unstable_features)] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) diff --git a/src/run_wast.rs b/src/run_wast.rs index 07934f8e7b..879ec303e5 100644 --- a/src/run_wast.rs +++ b/src/run_wast.rs @@ -7,10 +7,7 @@ unstable_features )] #![warn(unused_import_braces)] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) @@ -73,7 +70,8 @@ fn main() { d.help(true) .version(Some(String::from("0.0.0"))) .deserialize() - }).unwrap_or_else(|e| e.exit()); + }) + .unwrap_or_else(|e| e.exit()); let isa_builder = cranelift_native::builder().unwrap_or_else(|_| { panic!("host machine is not a supported target"); }); diff --git a/src/wasm2obj.rs b/src/wasm2obj.rs index 59ad748dd8..de7558a7d8 100644 --- a/src/wasm2obj.rs +++ b/src/wasm2obj.rs @@ -11,10 +11,7 @@ unstable_features )] #![warn(unused_import_braces)] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) @@ -96,7 +93,8 @@ fn main() { d.help(true) .version(Some(String::from("0.0.0"))) .deserialize() - }).unwrap_or_else(|e| e.exit()); + }) + .unwrap_or_else(|e| e.exit()); let path = Path::new(&args.arg_file); match handle_module(path.to_path_buf(), &args.arg_target, &args.arg_output) { diff --git a/src/wasmtime.rs b/src/wasmtime.rs index cc09f968d7..7038f72831 100644 --- a/src/wasmtime.rs +++ b/src/wasmtime.rs @@ -12,10 +12,7 @@ unstable_features )] #![warn(unused_import_braces)] -#![cfg_attr( - feature = "clippy", - plugin(clippy(conf_file = "../../clippy.toml")) -)] +#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr( feature = "cargo-clippy", allow(new_without_default, new_without_default_derive) @@ -107,7 +104,8 @@ fn main() { d.help(true) .version(Some(String::from("0.0.0"))) .deserialize() - }).unwrap_or_else(|e| e.exit()); + }) + .unwrap_or_else(|e| e.exit()); let isa_builder = cranelift_native::builder().unwrap_or_else(|_| { panic!("host machine is not a supported target"); });