diff --git a/cranelift/codegen/src/isa/x86/binemit.rs b/cranelift/codegen/src/isa/x86/binemit.rs index 90ed8b7ef8..0480873672 100644 --- a/cranelift/codegen/src/isa/x86/binemit.rs +++ b/cranelift/codegen/src/isa/x86/binemit.rs @@ -277,6 +277,7 @@ impl EvexContext { } /// The EVEX format allows choosing a vector length in the `L'` and `L` bits; see `EvexContext`. +#[allow(dead_code)] enum EvexVectorLength { V128, V256, @@ -296,6 +297,7 @@ impl EvexVectorLength { } /// The EVEX format allows defining rounding control in the `L'` and `L` bits; see `EvexContext`. +#[allow(dead_code)] enum EvexRoundingControl { RNE, RD, diff --git a/cranelift/codegen/src/verifier/mod.rs b/cranelift/codegen/src/verifier/mod.rs index dae9ff983d..e20570c951 100644 --- a/cranelift/codegen/src/verifier/mod.rs +++ b/cranelift/codegen/src/verifier/mod.rs @@ -2064,10 +2064,7 @@ mod tests { Some(&VerifierError { ref message, .. }) => { if !message.contains($msg) { #[cfg(feature = "std")] - panic!(format!( - "'{}' did not contain the substring '{}'", - message, $msg - )); + panic!("'{}' did not contain the substring '{}'", message, $msg); #[cfg(not(feature = "std"))] panic!("error message did not contain the expected substring"); } diff --git a/cranelift/filetests/src/test_binemit.rs b/cranelift/filetests/src/test_binemit.rs index ab25decaab..9f8db9ebb9 100644 --- a/cranelift/filetests/src/test_binemit.rs +++ b/cranelift/filetests/src/test_binemit.rs @@ -31,7 +31,6 @@ pub fn subtest(parsed: &TestCommand) -> anyhow::Result> { /// Code sink that generates text. struct TextSink { - code_size: binemit::CodeOffset, offset: binemit::CodeOffset, text: String, } @@ -40,7 +39,6 @@ impl TextSink { /// Create a new empty TextSink. pub fn new() -> Self { Self { - code_size: 0, offset: 0, text: String::new(), } @@ -98,9 +96,7 @@ impl binemit::CodeSink for TextSink { write!(self.text, "{} ", code).unwrap(); } - fn begin_jumptables(&mut self) { - self.code_size = self.offset - } + fn begin_jumptables(&mut self) {} fn begin_rodata(&mut self) {} fn end_codegen(&mut self) {} fn add_stack_map( diff --git a/cranelift/frontend/src/ssa.rs b/cranelift/frontend/src/ssa.rs index 4eef234290..c86503d0d6 100644 --- a/cranelift/frontend/src/ssa.rs +++ b/cranelift/frontend/src/ssa.rs @@ -1098,7 +1098,7 @@ mod tests { Ok(()) => {} Err(_errors) => { #[cfg(feature = "std")] - panic!(_errors); + panic!("{}", _errors); #[cfg(not(feature = "std"))] panic!("function failed to verify"); } @@ -1291,7 +1291,7 @@ mod tests { Ok(()) => {} Err(_errors) => { #[cfg(feature = "std")] - panic!(_errors); + panic!("{}", _errors); #[cfg(not(feature = "std"))] panic!("function failed to verify"); } @@ -1357,7 +1357,7 @@ mod tests { Ok(()) => {} Err(_errors) => { #[cfg(feature = "std")] - panic!(_errors); + panic!("{}", _errors); #[cfg(not(feature = "std"))] panic!("function failed to verify"); } diff --git a/cranelift/wasm/tests/wasm_testsuite.rs b/cranelift/wasm/tests/wasm_testsuite.rs index 7abd3ab905..713a4396d5 100644 --- a/cranelift/wasm/tests/wasm_testsuite.rs +++ b/cranelift/wasm/tests/wasm_testsuite.rs @@ -90,7 +90,7 @@ fn handle_module(data: Vec, flags: &Flags, return_mode: ReturnMode) { for func in dummy_environ.info.function_bodies.values() { verifier::verify_function(func, &*isa) - .map_err(|errors| panic!(pretty_verifier_error(func, Some(&*isa), None, errors))) + .map_err(|errors| panic!("{}", pretty_verifier_error(func, Some(&*isa), None, errors))) .unwrap(); } }