Merge pull request #1866 from cfallin/remove-matches

Remove uses of `matches!()` macro, incompatible with Firefox build.
This commit is contained in:
Chris Fallin
2020-06-11 16:19:57 -07:00
committed by GitHub
3 changed files with 11 additions and 2 deletions

View File

@@ -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

View File

@@ -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,
}
}
}

View File

@@ -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);
}
}