Remove uses of matches!() macro, incompatible with Firefox build.
When we vendor Cranelift into Firefox, we need to be able to build with the Firefox CI setup (unless we carry patches on top of upstream). Unfortunately, the Firefox CI currently appears to build with a slightly older version of Rust: I can't work out which version exactly, but one without stable support for `matches!()`. A recent attempt to version-bump Cranelift failed with build errors at the two locations in this patch: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=305994046&repo=autoland&lineNumber=24829 I also see a bunch of uses of `matches!()` in Peepmatic, but those crates are not built by Firefox, so we can leave them be for now, I think.
This commit is contained in:
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@@ -107,6 +107,12 @@ jobs:
|
|||||||
- run: cargo check --target wasm32-unknown-emscripten -p wasi-common
|
- run: cargo check --target wasm32-unknown-emscripten -p wasi-common
|
||||||
- run: cargo check --target armv7-unknown-linux-gnueabihf -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:
|
fuzz_targets:
|
||||||
name: Fuzz Targets
|
name: Fuzz Targets
|
||||||
|
|||||||
@@ -80,7 +80,10 @@ impl ValueConversion {
|
|||||||
|
|
||||||
/// Is this a conversion to pointer?
|
/// Is this a conversion to pointer?
|
||||||
pub fn is_pointer(self) -> bool {
|
pub fn is_pointer(self) -> bool {
|
||||||
matches!(self, Self::Pointer(_))
|
match self {
|
||||||
|
Self::Pointer(_) => true,
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ impl InstructionData {
|
|||||||
arg: _,
|
arg: _,
|
||||||
imm,
|
imm,
|
||||||
} => {
|
} => {
|
||||||
if matches!(opcode, Opcode::SdivImm | Opcode::SremImm) {
|
if *opcode == Opcode::SdivImm || *opcode == Opcode::SremImm {
|
||||||
imm.sign_extend_from_width(bit_width);
|
imm.sign_extend_from_width(bit_width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user