From d44324d4d0d522df8e6b77151b996c50bdd8d348 Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Tue, 15 Apr 2025 11:44:04 -0700 Subject: [PATCH] clippy --- compiler/codegen/src/compile.rs | 2 +- compiler/codegen/src/ir.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/codegen/src/compile.rs b/compiler/codegen/src/compile.rs index 286f318cc..d32c3f269 100644 --- a/compiler/codegen/src/compile.rs +++ b/compiler/codegen/src/compile.rs @@ -1948,7 +1948,7 @@ impl Compiler<'_> { // If no name is provided, simply pop the top of the stack. None => { emit!(self, Instruction::Pop); - return Ok(()); + Ok(()) } Some(name) => { // Check if the name is forbidden for storing. diff --git a/compiler/codegen/src/ir.rs b/compiler/codegen/src/ir.rs index 662ba81db..ee29c65a1 100644 --- a/compiler/codegen/src/ir.rs +++ b/compiler/codegen/src/ir.rs @@ -244,7 +244,7 @@ impl CodeInfo { let instr_display = instr.display(display_arg, self); eprint!("{instr_display}: {depth} {effect:+} => "); } - if effect < 0 && depth < effect.abs() as u32 { + if effect < 0 && depth < effect.unsigned_abs() { panic!("The stack will underflow at {depth} with {effect} effect on {instr:?}"); } let new_depth = depth.checked_add_signed(effect).unwrap();