Fix u8::MAX -> std::u8::MAX. (#2047)
As per Carlo Kok on Zulip #cranelift, this breaks builds with stable Rust pre-1.43, as `core::u8::MAX` was only stabilized then. We'd like to support older versions if we can easily do so. This PR also adds `cranelift-tools` to the crates checked on CI with Rust 1.41.0, which pulls in all backends (including `aarch64`).
This commit is contained in:
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -129,6 +129,7 @@ jobs:
|
|||||||
- run: rustup install 1.41.0
|
- run: rustup install 1.41.0
|
||||||
- run: cargo +1.41.0 check -p cranelift-codegen
|
- run: cargo +1.41.0 check -p cranelift-codegen
|
||||||
- run: cargo +1.41.0 check -p cranelift-wasm
|
- run: cargo +1.41.0 check -p cranelift-wasm
|
||||||
|
- run: cargo +1.41.0 check -p cranelift-tools
|
||||||
|
|
||||||
|
|
||||||
fuzz_targets:
|
fuzz_targets:
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ fn put_input_in_rs<C: LowerCtx<I = Inst>>(
|
|||||||
// Can we get the shift amount as an immediate?
|
// Can we get the shift amount as an immediate?
|
||||||
if let Some(shiftimm) = input_to_shiftimm(ctx, shift_amt) {
|
if let Some(shiftimm) = input_to_shiftimm(ctx, shift_amt) {
|
||||||
let shiftee_bits = ty_bits(ctx.input_ty(insn, 0));
|
let shiftee_bits = ty_bits(ctx.input_ty(insn, 0));
|
||||||
if shiftee_bits <= u8::MAX as usize {
|
if shiftee_bits <= std::u8::MAX as usize {
|
||||||
let shiftimm = shiftimm.mask(shiftee_bits as u8);
|
let shiftimm = shiftimm.mask(shiftee_bits as u8);
|
||||||
let reg = put_input_in_reg(ctx, shiftee, narrow_mode);
|
let reg = put_input_in_reg(ctx, shiftee, narrow_mode);
|
||||||
return ResultRS::RegShift(reg, ShiftOpAndAmt::new(ShiftOp::LSL, shiftimm));
|
return ResultRS::RegShift(reg, ShiftOpAndAmt::new(ShiftOp::LSL, shiftimm));
|
||||||
|
|||||||
Reference in New Issue
Block a user