diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28f18dffd2..8d3f4d5273 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,6 +107,12 @@ jobs: - run: cargo check --target wasm32-unknown-emscripten -p wasi-common - run: cargo check --target armv7-unknown-linux-gnueabihf -p wasi-common + # Check that codegen and wasm crates typecheck on 1.41.0; this is required + # for Firefox. + - run: rustup install 1.41.0 + - run: cargo +1.41.0 check -p cranelift-codegen + - run: cargo +1.41.0 check -p cranelift-wasm + fuzz_targets: name: Fuzz Targets diff --git a/cranelift/codegen/src/abi.rs b/cranelift/codegen/src/abi.rs index 0da415b5ce..cf4780e353 100644 --- a/cranelift/codegen/src/abi.rs +++ b/cranelift/codegen/src/abi.rs @@ -80,7 +80,10 @@ impl ValueConversion { /// Is this a conversion to pointer? pub fn is_pointer(self) -> bool { - matches!(self, Self::Pointer(_)) + match self { + Self::Pointer(_) => true, + _ => false, + } } } diff --git a/cranelift/codegen/src/ir/instructions.rs b/cranelift/codegen/src/ir/instructions.rs index 653926a242..6354b92580 100644 --- a/cranelift/codegen/src/ir/instructions.rs +++ b/cranelift/codegen/src/ir/instructions.rs @@ -311,7 +311,7 @@ impl InstructionData { arg: _, imm, } => { - if matches!(opcode, Opcode::SdivImm | Opcode::SremImm) { + if *opcode == Opcode::SdivImm || *opcode == Opcode::SremImm { imm.sign_extend_from_width(bit_width); } }