From 53ec12d5195471036715c05c7c8036cb8a55e47f Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Mon, 21 Jun 2021 13:24:46 +0200 Subject: [PATCH] Rustfmt --- cranelift/codegen/meta/src/cdsl/instructions.rs | 12 +++--------- cranelift/codegen/meta/src/cdsl/typevar.rs | 1 - cranelift/codegen/meta/src/shared/mod.rs | 2 +- cranelift/codegen/src/machinst/adapter.rs | 4 +--- cranelift/filetests/src/function_runner.rs | 4 ++-- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/cranelift/codegen/meta/src/cdsl/instructions.rs b/cranelift/codegen/meta/src/cdsl/instructions.rs index 50b3a82cc1..ba9aeebad6 100644 --- a/cranelift/codegen/meta/src/cdsl/instructions.rs +++ b/cranelift/codegen/meta/src/cdsl/instructions.rs @@ -25,9 +25,7 @@ pub(crate) struct InstructionGroupBuilder<'all_inst> { impl<'all_inst> InstructionGroupBuilder<'all_inst> { pub fn new(all_instructions: &'all_inst mut AllInstructions) -> Self { - Self { - all_instructions, - } + Self { all_instructions } } pub fn push(&mut self, builder: InstructionBuilder) { @@ -449,13 +447,9 @@ impl Bindable for BoundInstruction { fn bind(&self, parameter: impl Into) -> BoundInstruction { let mut modified = self.clone(); match parameter.into() { - BindParameter::Lane(lane_type) => modified - .value_types - .push(lane_type.into()), + BindParameter::Lane(lane_type) => modified.value_types.push(lane_type.into()), BindParameter::Reference(reference_type) => { - modified - .value_types - .push(reference_type.into()); + modified.value_types.push(reference_type.into()); } } modified.verify_bindings().unwrap(); diff --git a/cranelift/codegen/meta/src/cdsl/typevar.rs b/cranelift/codegen/meta/src/cdsl/typevar.rs index af1ba966a4..eea3e2724c 100644 --- a/cranelift/codegen/meta/src/cdsl/typevar.rs +++ b/cranelift/codegen/meta/src/cdsl/typevar.rs @@ -895,7 +895,6 @@ fn test_forward_images() { ); } - #[test] #[should_panic] fn test_typeset_singleton_panic_nonsingleton_types() { diff --git a/cranelift/codegen/meta/src/shared/mod.rs b/cranelift/codegen/meta/src/shared/mod.rs index 53ad796c8c..521e058ec9 100644 --- a/cranelift/codegen/meta/src/shared/mod.rs +++ b/cranelift/codegen/meta/src/shared/mod.rs @@ -8,7 +8,7 @@ pub mod settings; pub mod types; use crate::cdsl::formats::{FormatStructure, InstructionFormat}; -use crate::cdsl::instructions::{AllInstructions}; +use crate::cdsl::instructions::AllInstructions; use crate::cdsl::settings::SettingGroup; use crate::shared::entities::EntityRefs; diff --git a/cranelift/codegen/src/machinst/adapter.rs b/cranelift/codegen/src/machinst/adapter.rs index b60bf8300a..543084a0b5 100644 --- a/cranelift/codegen/src/machinst/adapter.rs +++ b/cranelift/codegen/src/machinst/adapter.rs @@ -2,9 +2,7 @@ use crate::binemit; use crate::ir; -use crate::isa::{ - EncInfo, Encoding, Encodings, Legalize, RegClass, RegInfo, TargetIsa, -}; +use crate::isa::{EncInfo, Encoding, Encodings, Legalize, RegClass, RegInfo, TargetIsa}; use crate::machinst::*; use crate::regalloc::RegisterSet; use crate::settings::{self, Flags}; diff --git a/cranelift/filetests/src/function_runner.rs b/cranelift/filetests/src/function_runner.rs index 58a321adba..45170d90ee 100644 --- a/cranelift/filetests/src/function_runner.rs +++ b/cranelift/filetests/src/function_runner.rs @@ -48,8 +48,8 @@ impl SingleFunctionCompiler { /// Build a [SingleFunctionCompiler] using the host machine's ISA and the passed flags. pub fn with_host_isa(flags: settings::Flags) -> Self { - let builder = builder_with_options(true) - .expect("Unable to build a TargetIsa for the current host"); + let builder = + builder_with_options(true).expect("Unable to build a TargetIsa for the current host"); let isa = builder.finish(flags); Self::new(isa) }