diff --git a/cranelift/src/clif-util.rs b/cranelift/src/clif-util.rs index f608e78e1e..d1ad95ed3d 100755 --- a/cranelift/src/clif-util.rs +++ b/cranelift/src/clif-util.rs @@ -1,10 +1,19 @@ #![deny(trivial_numeric_casts)] -#![warn(unused_import_braces, unstable_features, unused_extern_crates)] +#![warn( + unused_import_braces, + unstable_features, + unused_extern_crates +)] #![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 ) )] @@ -153,31 +162,26 @@ fn main() { .arg(add_time_flag()) .arg(add_input_file_arg()) .arg(add_debug_flag()), - ) - .subcommand( + ).subcommand( SubCommand::with_name("cat") .about("Outputs .clif file") .arg(add_input_file_arg()) .arg(add_debug_flag()), - ) - .subcommand( + ).subcommand( SubCommand::with_name("print-cfg") .about("Prints out cfg in dot format") .arg(add_input_file_arg()) .arg(add_debug_flag()), - ) - .subcommand( + ).subcommand( add_wasm_or_compile("compile") .arg( Arg::with_name("just-decode") .short("t") .help("Just decode WebAssembly to Cranelift IR"), - ) - .arg(Arg::with_name("check-translation").short("c").help( + ).arg(Arg::with_name("check-translation").short("c").help( "Just checks the correctness of Cranelift IR translated from WebAssembly", )), - ) - .subcommand(add_wasm_or_compile("wasm")) + ).subcommand(add_wasm_or_compile("wasm")) .subcommand( SubCommand::with_name("pass") .about("Run specified pass(s) on an input file.") diff --git a/lib/bforest/src/lib.rs b/lib/bforest/src/lib.rs index 2a1c5f8436..7971d481d8 100644 --- a/lib/bforest/src/lib.rs +++ b/lib/bforest/src/lib.rs @@ -16,13 +16,25 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![warn(unused_import_braces)] #![cfg_attr(feature = "std", warn(unstable_features))] -#![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 ) )] // Turns on no_std and alloc features if std is not available. diff --git a/lib/codegen/src/isa/x86/abi.rs b/lib/codegen/src/isa/x86/abi.rs index 6028fa507d..af7dda69d1 100644 --- a/lib/codegen/src/isa/x86/abi.rs +++ b/lib/codegen/src/isa/x86/abi.rs @@ -99,8 +99,7 @@ impl ArgAssigner for Args { RU::r14 } else { RU::rsi - } as RegUnit) - .into() + } as RegUnit).into() } // This is SpiderMonkey's `WasmTableCallSigReg`. ArgumentPurpose::SignatureId => return ArgumentLoc::Reg(RU::r10 as RegUnit).into(), diff --git a/lib/codegen/src/legalizer/boundary.rs b/lib/codegen/src/legalizer/boundary.rs index e052e63be6..b8bdc83ca8 100644 --- a/lib/codegen/src/legalizer/boundary.rs +++ b/lib/codegen/src/legalizer/boundary.rs @@ -569,8 +569,7 @@ pub fn handle_return_abi(inst: Inst, func: &mut Function, cfg: &ControlFlowGraph rt.purpose == ArgumentPurpose::Link || rt.purpose == ArgumentPurpose::StructReturn || rt.purpose == ArgumentPurpose::VMContext - }) - .count(); + }).count(); let abi_args = func.signature.returns.len() - special_args; let pos = &mut FuncCursor::new(func).at_inst(inst); @@ -689,8 +688,7 @@ fn spill_call_arguments(pos: &mut FuncCursor) -> bool { } _ => None, } - }) - .collect::>() + }).collect::>() }; if arglist.is_empty() { diff --git a/lib/codegen/src/lib.rs b/lib/codegen/src/lib.rs index 10e8a7a461..ec924dc6bf 100644 --- a/lib/codegen/src/lib.rs +++ b/lib/codegen/src/lib.rs @@ -3,7 +3,10 @@ #![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( // This requires Rust 1.27 or later. duration_subsec, @@ -32,8 +35,14 @@ #![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 ) )] // Turns on no_std and alloc features if std is not available. diff --git a/lib/codegen/src/regalloc/coloring.rs b/lib/codegen/src/regalloc/coloring.rs index 56691eecf3..d9df465f5c 100644 --- a/lib/codegen/src/regalloc/coloring.rs +++ b/lib/codegen/src/regalloc/coloring.rs @@ -902,10 +902,9 @@ impl<'a> Context<'a> { } Table(jt) => { let lr = &self.liveness[value]; - !lr.is_local() - && self.cur.func.jump_tables[jt] - .entries() - .any(|(_, ebb)| lr.is_livein(ebb, ctx)) + !lr.is_local() && self.cur.func.jump_tables[jt] + .entries() + .any(|(_, ebb)| lr.is_livein(ebb, ctx)) } } } diff --git a/lib/codegen/src/regalloc/liveness.rs b/lib/codegen/src/regalloc/liveness.rs index 01f72d9adb..8877179e43 100644 --- a/lib/codegen/src/regalloc/liveness.rs +++ b/lib/codegen/src/regalloc/liveness.rs @@ -220,8 +220,7 @@ fn get_or_create<'a>( func.dfg .call_signature(inst) .map(|sig| Affinity::abi(&func.dfg.signatures[sig].returns[rnum], isa)) - }) - .unwrap_or_default(); + }).unwrap_or_default(); } ValueDef::Param(ebb, num) => { def = ebb.into(); diff --git a/lib/codegen/src/regalloc/spilling.rs b/lib/codegen/src/regalloc/spilling.rs index d1244c0774..92b632c30a 100644 --- a/lib/codegen/src/regalloc/spilling.rs +++ b/lib/codegen/src/regalloc/spilling.rs @@ -463,8 +463,7 @@ impl<'a> Context<'a> { } } None - }) - .min_by(|&a, &b| { + }).min_by(|&a, &b| { // Find the minimum candidate according to the RPO of their defs. self.domtree.rpo_cmp( self.cur.func.dfg.value_def(a), diff --git a/lib/codegen/src/verifier/flags.rs b/lib/codegen/src/verifier/flags.rs index 0d16d17ef5..d3fda7555f 100644 --- a/lib/codegen/src/verifier/flags.rs +++ b/lib/codegen/src/verifier/flags.rs @@ -113,7 +113,8 @@ impl<'a> FlagsVerifier<'a> { .encinfo .as_ref() .and_then(|ei| ei.operand_constraints(self.func.encodings[inst])) - .map_or(false, |c| c.clobbers_flags) && live_val.is_some() + .map_or(false, |c| c.clobbers_flags) + && live_val.is_some() { return fatal!(errors, inst, "encoding clobbers live CPU flags in {}", live); } diff --git a/lib/codegen/src/verifier/mod.rs b/lib/codegen/src/verifier/mod.rs index 51aa484525..40f8302592 100644 --- a/lib/codegen/src/verifier/mod.rs +++ b/lib/codegen/src/verifier/mod.rs @@ -941,11 +941,11 @@ impl<'a> Verifier<'a> { ); } // The defining EBB dominates the instruction using this value. - if is_reachable - && !self - .expected_domtree - .dominates(ebb, loc_inst, &self.func.layout) - { + if is_reachable && !self.expected_domtree.dominates( + ebb, + loc_inst, + &self.func.layout, + ) { return fatal!( errors, loc_inst, @@ -1039,7 +1039,8 @@ impl<'a> Verifier<'a> { for (&prev_ebb, &next_ebb) in domtree.cfg_postorder().iter().adjacent_pairs() { if self .expected_domtree - .rpo_cmp(prev_ebb, next_ebb, &self.func.layout) != Ordering::Greater + .rpo_cmp(prev_ebb, next_ebb, &self.func.layout) + != Ordering::Greater { return fatal!( errors, @@ -1586,8 +1587,8 @@ impl<'a> Verifier<'a> { let encoding = self.func.encodings[inst]; if encoding.is_legal() { - let mut encodings = - isa.legal_encodings( + let mut encodings = isa + .legal_encodings( &self.func, &self.func.dfg[inst], self.func.dfg.ctrl_typevar(inst), diff --git a/lib/entity/src/lib.rs b/lib/entity/src/lib.rs index dd666c6ac7..a1d07db442 100644 --- a/lib/entity/src/lib.rs +++ b/lib/entity/src/lib.rs @@ -32,13 +32,25 @@ #![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 = "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 ) )] // Turns on no_std and alloc features if std is not available. diff --git a/lib/faerie/src/backend.rs b/lib/faerie/src/backend.rs index 6aa948703e..908eb1411d 100644 --- a/lib/faerie/src/backend.rs +++ b/lib/faerie/src/backend.rs @@ -228,8 +228,7 @@ impl Backend for FaerieBackend { from: name, to, at: u64::from(offset), - }) - .map_err(|e| ModuleError::Backend(e.to_string()))?; + }).map_err(|e| ModuleError::Backend(e.to_string()))?; } for &(offset, id, addend) in data_relocs { debug_assert_eq!( @@ -242,8 +241,7 @@ impl Backend for FaerieBackend { from: name, to, at: u64::from(offset), - }) - .map_err(|e| ModuleError::Backend(e.to_string()))?; + }).map_err(|e| ModuleError::Backend(e.to_string()))?; } self.artifact @@ -409,8 +407,7 @@ impl<'a> RelocSink for FaerieRelocSink<'a> { reloc: raw_reloc, addend: addend_i32, }, - ) - .expect("faerie relocation error"); + ).expect("faerie relocation error"); } fn reloc_jt(&mut self, _offset: CodeOffset, _reloc: Reloc, _jt: ir::JumpTable) { diff --git a/lib/faerie/src/lib.rs b/lib/faerie/src/lib.rs index 078488a953..0b9187a468 100644 --- a/lib/faerie/src/lib.rs +++ b/lib/faerie/src/lib.rs @@ -2,15 +2,32 @@ //! //! Users of this module should not have to depend on faerie directly. -#![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 ) )] diff --git a/lib/filetests/src/concurrent.rs b/lib/filetests/src/concurrent.rs index df9034618b..44963cc466 100644 --- a/lib/filetests/src/concurrent.rs +++ b/lib/filetests/src/concurrent.rs @@ -106,8 +106,7 @@ fn heartbeat_thread(replies: Sender) -> thread::JoinHandle<()> { while replies.send(Reply::Tick).is_ok() { thread::sleep(Duration::from_secs(1)); } - }) - .unwrap() + }).unwrap() } /// Spawn a worker thread running tests. @@ -154,6 +153,5 @@ fn worker_thread( // Timing is accumulated independently per thread. // Timings from this worker thread will be aggregated by `ConcurrentRunner::join()`. timing::take_current() - }) - .unwrap() + }).unwrap() } diff --git a/lib/filetests/src/lib.rs b/lib/filetests/src/lib.rs index f8e796182e..24086d88ab 100644 --- a/lib/filetests/src/lib.rs +++ b/lib/filetests/src/lib.rs @@ -3,7 +3,12 @@ //! This crate contains the main test driver as well as implementations of the //! available filetest commands. -#![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 = "cargo-clippy", allow( @@ -13,7 +18,11 @@ #![cfg_attr( feature = "cargo-clippy", warn( - mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else, unicode_not_nfc, + mut_mut, + nonminimal_bool, + option_map_unwrap_or, + option_map_unwrap_or_else, + unicode_not_nfc, use_self ) )] diff --git a/lib/filetests/src/runner.rs b/lib/filetests/src/runner.rs index a05f54c390..ff6f203590 100644 --- a/lib/filetests/src/runner.rs +++ b/lib/filetests/src/runner.rs @@ -315,8 +315,7 @@ impl TestRunner { .. } => Some(dur), _ => None, - }) - .collect::>(); + }).collect::>(); // Get me some real data, kid. let len = times.len(); diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 0a6732a89b..405de81f51 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -517,11 +517,10 @@ impl<'a> FunctionBuilder<'a> { None => false, Some(entry) => self.position.ebb.unwrap() == entry, }; - !is_entry && self.func_ctx.ssa.is_sealed(self.position.ebb.unwrap()) - && !self - .func_ctx - .ssa - .has_any_predecessors(self.position.ebb.unwrap()) + !is_entry && self.func_ctx.ssa.is_sealed(self.position.ebb.unwrap()) && !self + .func_ctx + .ssa + .has_any_predecessors(self.position.ebb.unwrap()) } /// Returns `true` if and only if no instructions have been added since the last call to diff --git a/lib/frontend/src/lib.rs b/lib/frontend/src/lib.rs index aec18899cb..9b90a5df07 100644 --- a/lib/frontend/src/lib.rs +++ b/lib/frontend/src/lib.rs @@ -163,8 +163,14 @@ #![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 ) )] #![cfg_attr(not(feature = "std"), no_std)] diff --git a/lib/module/src/lib.rs b/lib/module/src/lib.rs index 479288df57..3c569d0ec8 100644 --- a/lib/module/src/lib.rs +++ b/lib/module/src/lib.rs @@ -3,13 +3,25 @@ #![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 = "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 ) )] // Turns on no_std and alloc features if std is not available. diff --git a/lib/module/src/module.rs b/lib/module/src/module.rs index 0f04440f2a..bdeb90c627 100644 --- a/lib/module/src/module.rs +++ b/lib/module/src/module.rs @@ -129,7 +129,10 @@ pub enum ModuleError { #[fail(display = "Duplicate definition of identifier: {}", _0)] DuplicateDefinition(String), /// Indicates an identifier was defined, but was declared as an import - #[fail(display = "Invalid to define identifier declared as an import: {}", _0)] + #[fail( + display = "Invalid to define identifier declared as an import: {}", + _0 + )] InvalidImportDefinition(String), /// Wraps a `cranelift-codegen` error #[fail(display = "Compilation error: {}", _0)] diff --git a/lib/native/src/lib.rs b/lib/native/src/lib.rs index 3d4e4bac2c..7d88984db5 100644 --- a/lib/native/src/lib.rs +++ b/lib/native/src/lib.rs @@ -1,15 +1,32 @@ //! Performs autodetection of the host for the purposes of running //! Cranelift to generate code to run on the same machine. -#![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 ) )] #![cfg_attr(not(feature = "std"), no_std)] diff --git a/lib/reader/src/lexer.rs b/lib/reader/src/lexer.rs index 5a2a0124a2..c1d9a81d93 100644 --- a/lib/reader/src/lexer.rs +++ b/lib/reader/src/lexer.rs @@ -322,8 +322,7 @@ impl<'a> Lexer<'a> { .and_then(|(prefix, number)| { Self::numbered_entity(prefix, number) .or_else(|| Self::value_type(text, prefix, number)) - }) - .unwrap_or_else(|| match text { + }).unwrap_or_else(|| match text { "iflags" => Token::Type(types::IFLAGS), "fflags" => Token::Type(types::FFLAGS), _ => Token::Identifier(text), diff --git a/lib/reader/src/lib.rs b/lib/reader/src/lib.rs index 2873a644ac..bfa9bc8207 100644 --- a/lib/reader/src/lib.rs +++ b/lib/reader/src/lib.rs @@ -3,15 +3,32 @@ //! The `cranelift_reader` library supports reading .clif files. This functionality is needed for //! testing Cranelift, but is not essential for a JIT compiler. -#![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 ) )] diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 4a116699b8..1594d183b6 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -969,9 +969,10 @@ impl<'a> Parser<'a> { self.consume(); match self.token() { Some(Token::Integer(index_str)) => { - let index: u32 = u32::from_str_radix(index_str, 10).map_err( - |_| self.error("the integer given overflows the u32 type"), - )?; + let index: u32 = + u32::from_str_radix(index_str, 10).map_err(|_| { + self.error("the integer given overflows the u32 type") + })?; self.consume(); Ok(ExternalName::user(namespace, index)) } @@ -2557,7 +2558,7 @@ mod tests { v1 = iadd_imm v3, 17 }", ).parse_function(None) - .unwrap(); + .unwrap(); assert_eq!(func.name.to_string(), "%qux"); let v4 = details.map.lookup_str("v4").unwrap(); assert_eq!(v4.to_string(), "v4"); @@ -2633,7 +2634,7 @@ mod tests { ss1 = spill_slot 1 }", ).parse_function(None) - .unwrap(); + .unwrap(); assert_eq!(func.name.to_string(), "%foo"); let mut iter = func.stack_slots.keys(); let _ss0 = iter.next().unwrap(); @@ -2656,8 +2657,8 @@ mod tests { ss1 = spill_slot 1 }", ).parse_function(None) - .unwrap_err() - .to_string(), + .unwrap_err() + .to_string(), "3: duplicate entity: ss1" ); } @@ -2670,7 +2671,7 @@ mod tests { ebb4(v3: i32): }", ).parse_function(None) - .unwrap(); + .unwrap(); assert_eq!(func.name.to_string(), "%ebbs"); let mut ebbs = func.layout.ebbs(); @@ -2692,7 +2693,7 @@ mod tests { ebb0: return 2", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 3); assert_eq!(message, "duplicate entity: ebb0"); @@ -2705,7 +2706,7 @@ mod tests { jt0 = jump_table 0, 0 jt0 = jump_table 0, 0", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 3); assert_eq!(message, "duplicate entity: jt0"); @@ -2718,7 +2719,7 @@ mod tests { ss0 = explicit_slot 8 ss0 = explicit_slot 8", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 3); assert_eq!(message, "duplicate entity: ss0"); @@ -2731,7 +2732,7 @@ mod tests { gv0 = vmctx gv0 = vmctx", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 3); assert_eq!(message, "duplicate entity: gv0"); @@ -2744,7 +2745,7 @@ mod tests { heap0 = static gv0, min 0x1000, bound 0x10_0000, guard 0x1000 heap0 = static gv0, min 0x1000, bound 0x10_0000, guard 0x1000", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 3); assert_eq!(message, "duplicate entity: heap0"); @@ -2757,7 +2758,7 @@ mod tests { sig0 = () sig0 = ()", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 3); assert_eq!(message, "duplicate entity: sig0"); @@ -2771,7 +2772,7 @@ mod tests { fn0 = %foo sig0 fn0 = %foo sig0", ).parse_function(None) - .unwrap_err(); + .unwrap_err(); assert_eq!(location.line_number, 4); assert_eq!(message, "duplicate entity: fn0"); @@ -2791,7 +2792,7 @@ mod tests { } ; Trailing. ; More trailing.", ).parse_function(None) - .unwrap(); + .unwrap(); assert_eq!(func.name.to_string(), "%comment"); assert_eq!(comments.len(), 8); // no 'before' comment. assert_eq!( @@ -2868,7 +2869,7 @@ mod tests { isa riscv function %foo() system_v {}", ).unwrap() - .isa_spec + .isa_spec { IsaSpec::None(_) => panic!("Expected some ISA"), IsaSpec::Some(v) => { @@ -2887,8 +2888,8 @@ mod tests { trap int_divz }", ).parse_function(None) - .unwrap() - .0; + .unwrap() + .0; assert_eq!(func.name.to_string(), "u1:2"); // Invalid characters in the name: diff --git a/lib/serde/src/clif-json.rs b/lib/serde/src/clif-json.rs index 228b13703d..bab63ace97 100644 --- a/lib/serde/src/clif-json.rs +++ b/lib/serde/src/clif-json.rs @@ -1,14 +1,30 @@ //! Utility for `cranelift_serde`. -#![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 ) )] @@ -67,8 +83,7 @@ fn main() { .value_name("FILE") .help("Input file for serialization"), ), - ) - .subcommand( + ).subcommand( SubCommand::with_name("deserialize") .about("Deserializes Cranelift IR into JSON.") .arg( @@ -77,8 +92,7 @@ fn main() { .value_name("FILE") .help("Input file for deserialization"), ), - ) - .get_matches(); + ).get_matches(); let res_serde = match matches.subcommand() { ("serialize", Some(m)) => { diff --git a/lib/simplejit/src/lib.rs b/lib/simplejit/src/lib.rs index 99297f33b0..50f84f67eb 100644 --- a/lib/simplejit/src/lib.rs +++ b/lib/simplejit/src/lib.rs @@ -1,14 +1,31 @@ //! Top-level lib.rs for `cranelift_simplejit`. -#![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 ) )] diff --git a/lib/umbrella/src/lib.rs b/lib/umbrella/src/lib.rs index d56bdd6f71..79d262ecfd 100644 --- a/lib/umbrella/src/lib.rs +++ b/lib/umbrella/src/lib.rs @@ -1,14 +1,31 @@ //! Cranelift umbrella crate, providing a convenient one-line dependency. -#![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 ) )] diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index bc8e3fa9fa..31640635b5 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -35,7 +35,11 @@ pub enum WasmError { /// /// This error code is used by a WebAssembly translator when it encounters invalid WebAssembly /// code. This should never happen for validated WebAssembly code. - #[fail(display = "Invalid input WebAssembly code at offset {}: {}", _1, _0)] + #[fail( + display = "Invalid input WebAssembly code at offset {}: {}", + _1, + _0 + )] InvalidWebAssembly { /// A string describing the validation error. message: &'static str, diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index a559ae941d..95667d870d 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -12,13 +12,25 @@ #![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 = "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 ) )] #![cfg_attr(not(feature = "std"), no_std)] diff --git a/lib/wasm/tests/wasm_testsuite.rs b/lib/wasm/tests/wasm_testsuite.rs index a64ec63e6b..f7cc0e678e 100644 --- a/lib/wasm/tests/wasm_testsuite.rs +++ b/lib/wasm/tests/wasm_testsuite.rs @@ -30,8 +30,7 @@ fn testsuite() { } } false - }) - .collect(); + }).collect(); paths.sort_by_key(|dir| dir.path()); let flags = Flags::new(settings::builder()); for path in paths {