Update to the rustfmt in rust 1.31, which is now stable.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -114,10 +114,9 @@ pub fn invoke_by_index(
|
||||
fn_index: FuncIndex,
|
||||
args: &[Value],
|
||||
) -> Result<InvokeOutcome, String> {
|
||||
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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -61,6 +61,7 @@ impl InstanceWorld {
|
||||
self.instance.vmctx(),
|
||||
&function_name,
|
||||
args,
|
||||
).map_err(|e| e.to_string())
|
||||
)
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user