Browse Source

Update to the rustfmt in rust 1.29, which is now stable.

pull/18/head
Dan Gohman 6 years ago
parent
commit
5a96e022db
  1. 27
      lib/environ/src/lib.rs
  2. 7
      lib/execute/src/execute.rs
  3. 27
      lib/execute/src/lib.rs
  4. 27
      lib/obj/src/lib.rs
  5. 29
      src/main.rs
  6. 29
      src/wasm2obj.rs

27
lib/environ/src/lib.rs

@ -3,15 +3,32 @@
//! the translation the base addresses of regions of memory that will hold the globals, tables and
//! linear memories.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates, unstable_features)]
#![deny(
missing_docs,
trivial_numeric_casts,
unused_extern_crates,
unstable_features
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(
feature = "clippy",
plugin(clippy(conf_file = "../../clippy.toml"))
)]
#![cfg_attr(
feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive)
)]
#![cfg_attr(
feature = "cargo-clippy",
warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
print_stdout,
unicode_not_nfc,
use_self
)
)]

7
lib/execute/src/execute.rs

@ -140,9 +140,10 @@ pub fn execute(
}
}
let code_buf = &compilation.functions[module.defined_func_index(start_index).expect(
"imported start functions not supported yet",
)];
let code_buf =
&compilation.functions[module
.defined_func_index(start_index)
.expect("imported start functions not supported yet")];
// Collect all memory base addresses and Vec.
let mut mem_base_addrs = instance

27
lib/execute/src/lib.rs

@ -1,14 +1,31 @@
//! JIT-style runtime for WebAssembly using Cranelift.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates, unstable_features)]
#![deny(
missing_docs,
trivial_numeric_casts,
unused_extern_crates,
unstable_features
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(
feature = "clippy",
plugin(clippy(conf_file = "../../clippy.toml"))
)]
#![cfg_attr(
feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive)
)]
#![cfg_attr(
feature = "cargo-clippy",
warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
print_stdout,
unicode_not_nfc,
use_self
)
)]

27
lib/obj/src/lib.rs

@ -1,14 +1,31 @@
//! Object-file writing library using the wasmtime environment.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates, unstable_features)]
#![deny(
missing_docs,
trivial_numeric_casts,
unused_extern_crates,
unstable_features
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(
feature = "clippy",
plugin(clippy(conf_file = "../../clippy.toml"))
)]
#![cfg_attr(
feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive)
)]
#![cfg_attr(
feature = "cargo-clippy",
warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
print_stdout,
unicode_not_nfc,
use_self
)
)]

29
src/main.rs

@ -5,15 +5,31 @@
//! IL. Can also executes the `start` function of the module by laying out the memories, globals
//! and tables, then emitting the translated code with hardcoded addresses to memory.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates, unstable_features)]
#![deny(
missing_docs,
trivial_numeric_casts,
unused_extern_crates,
unstable_features
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(
feature = "clippy",
plugin(clippy(conf_file = "../../clippy.toml"))
)]
#![cfg_attr(
feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive)
)]
#![cfg_attr(
feature = "cargo-clippy",
warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
unicode_not_nfc, use_self
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
unicode_not_nfc,
use_self
)
)]
@ -78,8 +94,7 @@ 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 (mut flag_builder, isa_builder) = cranelift_native::builders().unwrap_or_else(|_| {
panic!("host machine is not a supported target");
});

29
src/wasm2obj.rs

@ -4,15 +4,31 @@
//! IL, then translates it to native code, and writes it out to a native
//! object file with relocations.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates, unstable_features)]
#![deny(
missing_docs,
trivial_numeric_casts,
unused_extern_crates,
unstable_features
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(
feature = "clippy",
plugin(clippy(conf_file = "../../clippy.toml"))
)]
#![cfg_attr(
feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive)
)]
#![cfg_attr(
feature = "cargo-clippy",
warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
unicode_not_nfc, use_self
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
unicode_not_nfc,
use_self
)
)]
@ -74,8 +90,7 @@ 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_output) {

Loading…
Cancel
Save