diff --git a/compiler/stable_mir/src/mir/body.rs b/compiler/stable_mir/src/mir/body.rs index 8081def1479..d86d56b3dc7 100644 --- a/compiler/stable_mir/src/mir/body.rs +++ b/compiler/stable_mir/src/mir/body.rs @@ -40,7 +40,7 @@ pub fn ret_local(&self) -> &LocalDecl { /// Locals in `self` that correspond to this function's arguments. pub fn arg_locals(&self) -> &[LocalDecl] { - &self.locals[1..self.arg_count + 1] + &self.locals[1..][..self.arg_count] } /// Inner locals for this function. These are the locals that are