ZJIT: Fix Rust warnings (#13813)

This commit is contained in:
Stan Lo 2025-07-08 00:46:21 +01:00 committed by GitHub
parent 0239809ab9
commit e0841a795b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3147,7 +3147,7 @@ mod validation_tests {
fn one_block_no_terminator() { fn one_block_no_terminator() {
let mut function = Function::new(std::ptr::null()); let mut function = Function::new(std::ptr::null());
let entry = function.entry_block; let entry = function.entry_block;
let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) }); function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) });
assert_matches_err(function.validate(), ValidationError::BlockHasNoTerminator(format!("{:?}", function), entry)); assert_matches_err(function.validate(), ValidationError::BlockHasNoTerminator(format!("{:?}", function), entry));
} }
@ -3166,7 +3166,6 @@ mod validation_tests {
let mut function = Function::new(std::ptr::null()); let mut function = Function::new(std::ptr::null());
let entry = function.entry_block; let entry = function.entry_block;
let side = function.new_block(); let side = function.new_block();
let exit = function.new_block();
let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) }); let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) });
function.push_insn(entry, Insn::IfTrue { val, target: BranchEdge { target: side, args: vec![val, val, val] } }); function.push_insn(entry, Insn::IfTrue { val, target: BranchEdge { target: side, args: vec![val, val, val] } });
assert_matches_err(function.validate(), ValidationError::MismatchedBlockArity(format!("{:?}", function), entry, 0, 3)); assert_matches_err(function.validate(), ValidationError::MismatchedBlockArity(format!("{:?}", function), entry, 0, 3));
@ -3177,7 +3176,6 @@ mod validation_tests {
let mut function = Function::new(std::ptr::null()); let mut function = Function::new(std::ptr::null());
let entry = function.entry_block; let entry = function.entry_block;
let side = function.new_block(); let side = function.new_block();
let exit = function.new_block();
let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) }); let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) });
function.push_insn(entry, Insn::IfFalse { val, target: BranchEdge { target: side, args: vec![val, val, val] } }); function.push_insn(entry, Insn::IfFalse { val, target: BranchEdge { target: side, args: vec![val, val, val] } });
assert_matches_err(function.validate(), ValidationError::MismatchedBlockArity(format!("{:?}", function), entry, 0, 3)); assert_matches_err(function.validate(), ValidationError::MismatchedBlockArity(format!("{:?}", function), entry, 0, 3));
@ -3188,7 +3186,6 @@ mod validation_tests {
let mut function = Function::new(std::ptr::null()); let mut function = Function::new(std::ptr::null());
let entry = function.entry_block; let entry = function.entry_block;
let side = function.new_block(); let side = function.new_block();
let exit = function.new_block();
let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) }); let val = function.push_insn(entry, Insn::Const { val: Const::Value(Qnil) });
function.push_insn(entry, Insn::Jump ( BranchEdge { target: side, args: vec![val, val, val] } )); function.push_insn(entry, Insn::Jump ( BranchEdge { target: side, args: vec![val, val, val] } ));
assert_matches_err(function.validate(), ValidationError::MismatchedBlockArity(format!("{:?}", function), entry, 0, 3)); assert_matches_err(function.validate(), ValidationError::MismatchedBlockArity(format!("{:?}", function), entry, 0, 3));