diff --git a/cranelift/src/cat.rs b/cranelift/src/cat.rs index a906214730..b668e0b51f 100644 --- a/cranelift/src/cat.rs +++ b/cranelift/src/cat.rs @@ -3,9 +3,9 @@ //! Read a sequence of Cretonne IR files and print them again to stdout. This has the effect of //! normalizing formatting and removing comments. -use CommandResult; use cretonne_reader::parse_functions; use utils::read_to_string; +use CommandResult; pub fn run(files: &[String]) -> CommandResult { for (i, f) in files.into_iter().enumerate() { diff --git a/cranelift/src/compile.rs b/cranelift/src/compile.rs index 560c9f3497..37f70df364 100644 --- a/cranelift/src/compile.rs +++ b/cranelift/src/compile.rs @@ -1,10 +1,10 @@ //! CLI tool to read Cretonne IR files and compile them into native code. use capstone::prelude::*; -use cretonne_codegen::Context; use cretonne_codegen::isa::TargetIsa; use cretonne_codegen::print_errors::pretty_error; use cretonne_codegen::settings::FlagsOrIsa; +use cretonne_codegen::Context; use cretonne_codegen::{binemit, ir}; use cretonne_reader::parse_test; use std::path::Path; diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index 3723cbecda..d1805d6dc8 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -1,8 +1,12 @@ #![deny(trivial_numeric_casts)] #![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))] +#![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 + ) +)] #[macro_use] extern crate cfg_if; diff --git a/cranelift/src/print_cfg.rs b/cranelift/src/print_cfg.rs index 28c8a81100..bf945da958 100644 --- a/cranelift/src/print_cfg.rs +++ b/cranelift/src/print_cfg.rs @@ -3,10 +3,10 @@ //! Read a series of Cretonne IR files and print their control flow graphs //! in graphviz format. -use CommandResult; use cretonne_codegen::cfg_printer::CFGPrinter; use cretonne_reader::parse_functions; use utils::read_to_string; +use CommandResult; pub fn run(files: &[String]) -> CommandResult { for (i, f) in files.into_iter().enumerate() { diff --git a/cranelift/src/rsfilecheck.rs b/cranelift/src/rsfilecheck.rs index b2b1c66ba8..48e25b3f12 100644 --- a/cranelift/src/rsfilecheck.rs +++ b/cranelift/src/rsfilecheck.rs @@ -2,10 +2,10 @@ //! //! This file is named to avoid a name collision with the filecheck crate. -use CommandResult; use filecheck::{Checker, CheckerBuilder, NO_VARIABLES}; use std::io::{self, Read}; use utils::read_to_string; +use CommandResult; pub fn run(files: &[String], verbose: bool) -> CommandResult { if files.is_empty() { diff --git a/lib/codegen/src/abi.rs b/lib/codegen/src/abi.rs index e4b4b223f4..fe69c67d35 100644 --- a/lib/codegen/src/abi.rs +++ b/lib/codegen/src/abi.rs @@ -184,8 +184,8 @@ pub fn legalize_abi_value(have: Type, arg: &AbiParam) -> ValueConversion { #[cfg(test)] mod tests { use super::*; - use ir::AbiParam; use ir::types; + use ir::AbiParam; #[test] fn legalize() { diff --git a/lib/codegen/src/cfg_printer.rs b/lib/codegen/src/cfg_printer.rs index 46b8754e3e..932345ef5b 100644 --- a/lib/codegen/src/cfg_printer.rs +++ b/lib/codegen/src/cfg_printer.rs @@ -3,8 +3,8 @@ use std::fmt::{Display, Formatter, Result, Write}; use flowgraph::ControlFlowGraph; -use ir::Function; use ir::instructions::BranchInfo; +use ir::Function; /// A utility for pretty-printing the CFG of a `Function`. pub struct CFGPrinter<'a> { diff --git a/lib/codegen/src/divconst_magic_numbers.rs b/lib/codegen/src/divconst_magic_numbers.rs index a56ed730d4..32a342703c 100644 --- a/lib/codegen/src/divconst_magic_numbers.rs +++ b/lib/codegen/src/divconst_magic_numbers.rs @@ -220,8 +220,8 @@ pub fn magicS64(d: i64) -> MS64 { #[cfg(test)] mod tests { - use super::{MS32, MS64, MU32, MU64}; use super::{magicS32, magicS64, magicU32, magicU64}; + use super::{MS32, MS64, MU32, MU64}; fn mkMU32(mulBy: u32, doAdd: bool, shiftBy: i32) -> MU32 { MU32 { diff --git a/lib/codegen/src/ir/dfg.rs b/lib/codegen/src/ir/dfg.rs index 4fde255e82..21c3cc9b66 100644 --- a/lib/codegen/src/ir/dfg.rs +++ b/lib/codegen/src/ir/dfg.rs @@ -1151,8 +1151,8 @@ mod tests { #[test] fn aliases() { - use ir::InstBuilder; use ir::condcodes::IntCC; + use ir::InstBuilder; let mut func = Function::new(); let ebb0 = func.dfg.make_ebb(); diff --git a/lib/codegen/src/ir/heap.rs b/lib/codegen/src/ir/heap.rs index 01beb15b35..b41565b25b 100644 --- a/lib/codegen/src/ir/heap.rs +++ b/lib/codegen/src/ir/heap.rs @@ -1,7 +1,7 @@ //! Heaps. -use ir::GlobalVar; use ir::immediates::Imm64; +use ir::GlobalVar; use std::fmt; /// Information about a heap declaration. diff --git a/lib/codegen/src/ir/stackslot.rs b/lib/codegen/src/ir/stackslot.rs index aecf8abc8f..16794628df 100644 --- a/lib/codegen/src/ir/stackslot.rs +++ b/lib/codegen/src/ir/stackslot.rs @@ -338,8 +338,8 @@ impl StackSlots { #[cfg(test)] mod tests { use super::*; - use ir::Function; use ir::types; + use ir::Function; use std::string::ToString; #[test] diff --git a/lib/codegen/src/isa/arm32/mod.rs b/lib/codegen/src/isa/arm32/mod.rs index 227ba39fd9..560c71248c 100644 --- a/lib/codegen/src/isa/arm32/mod.rs +++ b/lib/codegen/src/isa/arm32/mod.rs @@ -9,8 +9,8 @@ pub mod settings; use super::super::settings as shared_settings; use binemit::{emit_function, CodeSink, MemoryCodeSink}; use ir; -use isa::Builder as IsaBuilder; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings}; +use isa::Builder as IsaBuilder; use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use regalloc; use std::boxed::Box; diff --git a/lib/codegen/src/isa/arm64/mod.rs b/lib/codegen/src/isa/arm64/mod.rs index 0d4f4a5397..240e92883d 100644 --- a/lib/codegen/src/isa/arm64/mod.rs +++ b/lib/codegen/src/isa/arm64/mod.rs @@ -9,8 +9,8 @@ pub mod settings; use super::super::settings as shared_settings; use binemit::{emit_function, CodeSink, MemoryCodeSink}; use ir; -use isa::Builder as IsaBuilder; use isa::enc_tables::{lookup_enclist, Encodings}; +use isa::Builder as IsaBuilder; use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use regalloc; use std::boxed::Box; diff --git a/lib/codegen/src/isa/riscv/mod.rs b/lib/codegen/src/isa/riscv/mod.rs index bcddc496d0..f704a5e7ff 100644 --- a/lib/codegen/src/isa/riscv/mod.rs +++ b/lib/codegen/src/isa/riscv/mod.rs @@ -9,8 +9,8 @@ pub mod settings; use super::super::settings as shared_settings; use binemit::{emit_function, CodeSink, MemoryCodeSink}; use ir; -use isa::Builder as IsaBuilder; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings}; +use isa::Builder as IsaBuilder; use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use regalloc; use std::boxed::Box; @@ -113,8 +113,8 @@ impl TargetIsa for Isa { #[cfg(test)] mod tests { - use ir::{Function, InstructionData, Opcode}; use ir::{immediates, types}; + use ir::{Function, InstructionData, Opcode}; use isa; use settings::{self, Configurable}; use std::string::{String, ToString}; diff --git a/lib/codegen/src/isa/stack.rs b/lib/codegen/src/isa/stack.rs index eefa523ae3..df61f77edc 100644 --- a/lib/codegen/src/isa/stack.rs +++ b/lib/codegen/src/isa/stack.rs @@ -4,8 +4,8 @@ //! defined in this module expresses the low-level details of accessing a stack slot from an //! encoded instruction. -use ir::StackSlot; use ir::stackslot::{StackOffset, StackSlotKind, StackSlots}; +use ir::StackSlot; /// A method for referencing a stack slot in the current stack frame. /// diff --git a/lib/codegen/src/isa/x86/mod.rs b/lib/codegen/src/isa/x86/mod.rs index 335d95cd22..e77b7d5c78 100644 --- a/lib/codegen/src/isa/x86/mod.rs +++ b/lib/codegen/src/isa/x86/mod.rs @@ -9,8 +9,8 @@ pub mod settings; use super::super::settings as shared_settings; use binemit::{emit_function, CodeSink, MemoryCodeSink}; use ir; -use isa::Builder as IsaBuilder; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings}; +use isa::Builder as IsaBuilder; use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use regalloc; use result; diff --git a/lib/codegen/src/lib.rs b/lib/codegen/src/lib.rs index 9636d317b0..05d781dcd7 100644 --- a/lib/codegen/src/lib.rs +++ b/lib/codegen/src/lib.rs @@ -31,9 +31,13 @@ redundant_field_names, useless_let_if_seq, len_without_is_empty))] -#![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))] +#![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 + ) +)] // Turns on no_std and alloc features if std is not available. #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] diff --git a/lib/codegen/src/preopt.rs b/lib/codegen/src/preopt.rs index ead49b9486..b96c3d9531 100644 --- a/lib/codegen/src/preopt.rs +++ b/lib/codegen/src/preopt.rs @@ -3,12 +3,12 @@ #![allow(non_snake_case)] use cursor::{Cursor, FuncCursor}; -use divconst_magic_numbers::{MS32, MS64, MU32, MU64}; use divconst_magic_numbers::{magicS32, magicS64, magicU32, magicU64}; -use ir::Inst; +use divconst_magic_numbers::{MS32, MS64, MU32, MU64}; use ir::dfg::ValueDef; use ir::instructions::Opcode; use ir::types::{I32, I64}; +use ir::Inst; use ir::{DataFlowGraph, Function, InstBuilder, InstructionData, Type, Value}; use timing; diff --git a/lib/codegen/src/regalloc/coloring.rs b/lib/codegen/src/regalloc/coloring.rs index aa7cbbeb47..33ce0ff3b4 100644 --- a/lib/codegen/src/regalloc/coloring.rs +++ b/lib/codegen/src/regalloc/coloring.rs @@ -46,16 +46,16 @@ use cursor::{Cursor, EncCursor}; use dominator_tree::DominatorTree; use ir::{AbiParam, ArgumentLoc, InstBuilder, ValueDef}; use ir::{Ebb, Function, Inst, Layout, SigRef, Value, ValueLoc}; -use isa::{ConstraintKind, EncInfo, OperandConstraint, RecipeConstraints, TargetIsa}; use isa::{regs_overlap, RegClass, RegInfo, RegUnit}; +use isa::{ConstraintKind, EncInfo, OperandConstraint, RecipeConstraints, TargetIsa}; use packed_option::PackedOption; -use regalloc::RegDiversions; use regalloc::affinity::Affinity; use regalloc::live_value_tracker::{LiveValue, LiveValueTracker}; use regalloc::liveness::Liveness; use regalloc::liverange::{LiveRange, LiveRangeContext}; use regalloc::register_set::RegisterSet; use regalloc::solver::{Solver, SolverError}; +use regalloc::RegDiversions; use std::mem; use timing; diff --git a/lib/codegen/src/regalloc/solver.rs b/lib/codegen/src/regalloc/solver.rs index 33217eab86..af935b2104 100644 --- a/lib/codegen/src/regalloc/solver.rs +++ b/lib/codegen/src/regalloc/solver.rs @@ -1367,7 +1367,7 @@ mod tests { mov(v15, gpr, r5, r3), mov(v14, gpr, r4, r5), mov(v13, gpr, r1, r4), - fill(v10, gpr, 0, r1) // Finally complete cycle 1. + fill(v10, gpr, 0, r1), // Finally complete cycle 1. ] ); } diff --git a/lib/codegen/src/stack_layout.rs b/lib/codegen/src/stack_layout.rs index e40499f976..cda2251900 100644 --- a/lib/codegen/src/stack_layout.rs +++ b/lib/codegen/src/stack_layout.rs @@ -1,7 +1,7 @@ //! Computing stack layout. -use ir::StackSlots; use ir::stackslot::{StackOffset, StackSize, StackSlotKind}; +use ir::StackSlots; use result::CtonError; use std::cmp::{max, min}; diff --git a/lib/codegen/src/verifier/locations.rs b/lib/codegen/src/verifier/locations.rs index 89e2b09e9a..5460b938dd 100644 --- a/lib/codegen/src/verifier/locations.rs +++ b/lib/codegen/src/verifier/locations.rs @@ -2,8 +2,8 @@ use ir; use isa; -use regalloc::RegDiversions; use regalloc::liveness::Liveness; +use regalloc::RegDiversions; use timing; use verifier::Result; diff --git a/lib/codegen/src/verifier/mod.rs b/lib/codegen/src/verifier/mod.rs index f8644034b2..20507594e3 100644 --- a/lib/codegen/src/verifier/mod.rs +++ b/lib/codegen/src/verifier/mod.rs @@ -1147,8 +1147,8 @@ impl<'a> Verifier<'a> { mod tests { use super::{Error, Verifier}; use entity::EntityList; - use ir::Function; use ir::instructions::{InstructionData, Opcode}; + use ir::Function; use settings; macro_rules! assert_err_with_msg { diff --git a/lib/entity/src/iter.rs b/lib/entity/src/iter.rs index ea7bfb7199..f818bb0cf5 100644 --- a/lib/entity/src/iter.rs +++ b/lib/entity/src/iter.rs @@ -1,9 +1,9 @@ //! A double-ended iterator over entity references and entities. -use EntityRef; use std::iter::Enumerate; use std::marker::PhantomData; use std::slice; +use EntityRef; /// Iterate over all keys in order. pub struct Iter<'a, K: EntityRef, V> diff --git a/lib/entity/src/keys.rs b/lib/entity/src/keys.rs index 4301bbe689..5014dc3be5 100644 --- a/lib/entity/src/keys.rs +++ b/lib/entity/src/keys.rs @@ -3,8 +3,8 @@ //! When `std::iter::Step` is stablized, `Keys` could be implemented as a wrapper around //! `std::ops::Range`, but for now, we implment it manually. -use EntityRef; use std::marker::PhantomData; +use EntityRef; /// Iterate over all keys in order. pub struct Keys { diff --git a/lib/entity/src/lib.rs b/lib/entity/src/lib.rs index 6b27064c7d..cb1c248db1 100644 --- a/lib/entity/src/lib.rs +++ b/lib/entity/src/lib.rs @@ -34,9 +34,13 @@ #![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 = "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))] +#![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 + ) +)] // Turns on no_std and alloc features if std is not available. #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] diff --git a/lib/entity/src/list.rs b/lib/entity/src/list.rs index 803504bc76..8a0aecbdfd 100644 --- a/lib/entity/src/list.rs +++ b/lib/entity/src/list.rs @@ -1,9 +1,9 @@ //! Small lists of entity references. -use EntityRef; use std::hash::{Hash, Hasher}; use std::marker::PhantomData; use std::mem; use std::vec::Vec; +use EntityRef; /// A small list of entity references allocated from a pool. /// diff --git a/lib/faerie/src/lib.rs b/lib/faerie/src/lib.rs index 6cec1c9e52..7d7bb27a0a 100644 --- a/lib/faerie/src/lib.rs +++ b/lib/faerie/src/lib.rs @@ -6,9 +6,13 @@ #![warn(unused_import_braces, 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 = "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))] +#![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 + ) +)] extern crate cretonne_codegen; extern crate cretonne_module; diff --git a/lib/filetests/src/lib.rs b/lib/filetests/src/lib.rs index e0dca34cc2..7dd87302a5 100644 --- a/lib/filetests/src/lib.rs +++ b/lib/filetests/src/lib.rs @@ -9,9 +9,13 @@ type_complexity, // Rustfmt 0.9.0 is at odds with this lint: block_in_if_condition_stmt))] -#![cfg_attr(feature = "cargo-clippy", - warn(mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else, - unicode_not_nfc, use_self))] +#![cfg_attr( + feature = "cargo-clippy", + warn( + mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else, unicode_not_nfc, + use_self + ) +)] #[macro_use(dbg)] extern crate cretonne_codegen; diff --git a/lib/filetests/src/runone.rs b/lib/filetests/src/runone.rs index 7688785a57..4d3731619b 100644 --- a/lib/filetests/src/runone.rs +++ b/lib/filetests/src/runone.rs @@ -6,8 +6,8 @@ use cretonne_codegen::print_errors::pretty_verifier_error; use cretonne_codegen::settings::Flags; use cretonne_codegen::timing; use cretonne_codegen::verify_function; -use cretonne_reader::IsaSpec; use cretonne_reader::parse_test; +use cretonne_reader::IsaSpec; use std::borrow::Cow; use std::fs; use std::io::{self, Read}; diff --git a/lib/filetests/src/test_domtree.rs b/lib/filetests/src/test_domtree.rs index cdc2a37ae4..9dbd5fe849 100644 --- a/lib/filetests/src/test_domtree.rs +++ b/lib/filetests/src/test_domtree.rs @@ -14,8 +14,8 @@ use cretonne_codegen::dominator_tree::{DominatorTree, DominatorTreePreorder}; use cretonne_codegen::flowgraph::ControlFlowGraph; -use cretonne_codegen::ir::Function; use cretonne_codegen::ir::entities::AnyEntity; +use cretonne_codegen::ir::Function; use cretonne_reader::TestCommand; use match_directive::match_directive; use std::borrow::{Borrow, Cow}; diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 2688a1055a..453fc09c0e 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -607,7 +607,6 @@ where #[cfg(test)] mod tests { - use Variable; use cretonne_codegen::entity::EntityRef; use cretonne_codegen::ir::types::*; use cretonne_codegen::ir::{AbiParam, ExternalName, Function, InstBuilder, Signature}; @@ -615,6 +614,7 @@ mod tests { use cretonne_codegen::settings::CallConv; use cretonne_codegen::verifier::verify_function; use frontend::{FunctionBuilder, FunctionBuilderContext}; + use Variable; fn sample_function(lazy_seal: bool) { let mut sig = Signature::new(CallConv::SystemV); diff --git a/lib/frontend/src/lib.rs b/lib/frontend/src/lib.rs index ad0760dc25..8b25becb33 100644 --- a/lib/frontend/src/lib.rs +++ b/lib/frontend/src/lib.rs @@ -131,9 +131,13 @@ #![warn(unused_import_braces)] #![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default))] -#![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))] +#![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 + ) +)] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 578264ef3a..59a031f6d1 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -712,7 +712,6 @@ where #[cfg(test)] mod tests { - use Variable; use cretonne_codegen::cursor::{Cursor, FuncCursor}; use cretonne_codegen::entity::EntityRef; use cretonne_codegen::ir::instructions::BranchInfo; @@ -721,6 +720,7 @@ mod tests { use cretonne_codegen::settings; use cretonne_codegen::verify_function; use ssa::SSABuilder; + use Variable; #[test] fn simple_block() { diff --git a/lib/module/src/backend.rs b/lib/module/src/backend.rs index 82b7e3295a..15258544d8 100644 --- a/lib/module/src/backend.rs +++ b/lib/module/src/backend.rs @@ -1,13 +1,13 @@ //! Defines the `Backend` trait. +use cretonne_codegen::isa::TargetIsa; +use cretonne_codegen::Context; +use cretonne_codegen::{binemit, ir}; +use std::marker; use DataContext; use Linkage; use ModuleError; use ModuleNamespace; -use cretonne_codegen::Context; -use cretonne_codegen::isa::TargetIsa; -use cretonne_codegen::{binemit, ir}; -use std::marker; /// A `Backend` implements the functionality needed to support a `Module`. pub trait Backend diff --git a/lib/module/src/lib.rs b/lib/module/src/lib.rs index d7f9118288..5c1091dd3f 100644 --- a/lib/module/src/lib.rs +++ b/lib/module/src/lib.rs @@ -4,9 +4,13 @@ #![warn(unused_import_braces, 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 = "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))] +#![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 + ) +)] #[macro_use] extern crate cretonne_codegen; diff --git a/lib/module/src/module.rs b/lib/module/src/module.rs index d9a7c7fda9..6b696d2b33 100644 --- a/lib/module/src/module.rs +++ b/lib/module/src/module.rs @@ -5,12 +5,12 @@ // TODO: Factor out `ir::Function`'s `ext_funcs` and `global_vars` into a struct // shared with `DataContext`? -use Backend; use cretonne_codegen::entity::{EntityRef, PrimaryMap}; use cretonne_codegen::result::CtonError; use cretonne_codegen::{binemit, ir, Context}; use data_context::DataContext; use std::collections::HashMap; +use Backend; /// A function identifier for use in the `Module` interface. #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] diff --git a/lib/native/src/lib.rs b/lib/native/src/lib.rs index 54fa134503..f9f6d4cc7a 100644 --- a/lib/native/src/lib.rs +++ b/lib/native/src/lib.rs @@ -5,9 +5,13 @@ #![warn(unused_import_braces, 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 = "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))] +#![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 + ) +)] #![cfg_attr(not(feature = "std"), no_std)] extern crate cretonne_codegen; diff --git a/lib/reader/src/lib.rs b/lib/reader/src/lib.rs index b623035249..687abd1b85 100644 --- a/lib/reader/src/lib.rs +++ b/lib/reader/src/lib.rs @@ -7,9 +7,13 @@ #![warn(unused_import_braces, 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 = "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))] +#![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 + ) +)] extern crate cretonne_codegen; diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 8fadf88566..7c013cd857 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -2237,9 +2237,9 @@ impl<'a> Parser<'a> { #[cfg(test)] mod tests { use super::*; - use cretonne_codegen::ir::StackSlotKind; use cretonne_codegen::ir::entities::AnyEntity; use cretonne_codegen::ir::types; + use cretonne_codegen::ir::StackSlotKind; use cretonne_codegen::ir::{ArgumentExtension, ArgumentPurpose}; use cretonne_codegen::settings::CallConv; use error::Error; diff --git a/lib/reader/src/testfile.rs b/lib/reader/src/testfile.rs index 2fae3c2d3d..0c591cea26 100644 --- a/lib/reader/src/testfile.rs +++ b/lib/reader/src/testfile.rs @@ -4,8 +4,8 @@ //! file-based test case. //! -use cretonne_codegen::ir::Function; use cretonne_codegen::ir::entities::AnyEntity; +use cretonne_codegen::ir::Function; use error::Location; use isaspec::IsaSpec; use sourcemap::SourceMap; diff --git a/lib/simplejit/src/lib.rs b/lib/simplejit/src/lib.rs index 90ee03d9d5..3212447065 100644 --- a/lib/simplejit/src/lib.rs +++ b/lib/simplejit/src/lib.rs @@ -4,9 +4,13 @@ #![warn(unused_import_braces, 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 = "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))] +#![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 + ) +)] extern crate cretonne_codegen; extern crate cretonne_module; diff --git a/lib/umbrella/src/lib.rs b/lib/umbrella/src/lib.rs index ebfb0c731e..11b773b7f5 100644 --- a/lib/umbrella/src/lib.rs +++ b/lib/umbrella/src/lib.rs @@ -4,9 +4,13 @@ #![warn(unused_import_braces, 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 = "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))] +#![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 + ) +)] /// Provide these crates, renamed to reduce stutter. pub extern crate cretonne_codegen as codegen; diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 60eaf8f853..7aae3d6678 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -32,8 +32,8 @@ use state::{ControlStackFrame, TranslationState}; use std::collections::{hash_map, HashMap}; use std::vec::Vec; use std::{i32, u32}; +use translation_utils::{f32_translation, f64_translation, num_return_values, type_to_type}; use translation_utils::{FunctionIndex, MemoryIndex, SignatureIndex, TableIndex}; -use translation_utils::{num_return_values, type_to_type, f32_translation, f64_translation}; use wasmparser::{MemoryImmediate, Operator}; // Clippy warns about "flags: _" but its important to document that the flags field is ignored diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index 9842f36852..2c73f73953 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -14,9 +14,13 @@ #![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 = "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))] +#![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 + ) +)] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] @@ -57,7 +61,7 @@ mod std { pub use alloc::vec; pub use core::fmt; pub use core::option; - pub use core::{cmp, str, i32, u32}; + pub use core::{cmp, i32, str, u32}; pub mod collections { pub use hashmap_core::{map as hash_map, HashMap}; }