From 72d761f6194fdf786c9f9c5bf8cf3e6a9fa8b898 Mon Sep 17 00:00:00 2001 From: vasilito Date: Tue, 28 Jul 2026 08:05:07 +0900 Subject: [PATCH] acpi-rs: fix 3 panic sites referencing non-existent .opcode field OpInFlight has no `opcode` field (it has `op: Opcode`), and at the logical-op site `result` was referenced inside its own initializer (not yet in scope). All three defensive _ => panic! arms now use `op.op` with {:?} (Opcode derives Debug; {:#x} was invalid for the fieldless enum anyway), matching the Opcode::* arms they follow. Fixes E0425 + two E0609 that failed `cook base`. Co-Authored-By: Claude Opus 4.8 (1M context) --- drivers/acpi-rs/src/aml/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi-rs/src/aml/mod.rs b/drivers/acpi-rs/src/aml/mod.rs index 9a20597843..819d09a363 100644 --- a/drivers/acpi-rs/src/aml/mod.rs +++ b/drivers/acpi-rs/src/aml/mod.rs @@ -2013,7 +2013,7 @@ where Opcode::Or => left | right, Opcode::Nor => !(left | right), Opcode::Xor => left ^ right, - _ => panic!("acpi: unknown binary maths opcode {:#x}", op.opcode), + _ => panic!("acpi: unknown binary maths opcode {:?}", op.op), }; let result = Object::Integer(result).wrap(); @@ -2057,7 +2057,7 @@ where 0 } } - _ => panic!("acpi: unknown unary maths opcode {:#x}", op.opcode), + _ => panic!("acpi: unknown unary maths opcode {:?}", op.op), }; context.contribute_arg(Argument::Object(Object::Integer(result).wrap())); @@ -2131,7 +2131,7 @@ where Opcode::LEqual => left == right, Opcode::LGreater => left > right, Opcode::LLess => left < right, - _ => panic!("acpi: unknown logical opcode {:#x}", result.opcode), + _ => panic!("acpi: unknown logical opcode {:?}", op.op), }; let result = if result { Object::Integer(u64::MAX) } else { Object::Integer(0) };