From fe4dfb814b68bb03468736c5c0632f6495ea855e Mon Sep 17 00:00:00 2001 From: Kirby Linvill Date: Thu, 26 Oct 2023 00:18:42 +0100 Subject: [PATCH] Rename internal_locals to inner_locals The word internal has connotations about information that's not exposed. It's more accurate to say that the remaining locals apply only to the inner part of the function, so I'm renaming them to inner locals. --- compiler/stable_mir/src/mir/body.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/stable_mir/src/mir/body.rs b/compiler/stable_mir/src/mir/body.rs index 97dd649bf64..75c988056b4 100644 --- a/compiler/stable_mir/src/mir/body.rs +++ b/compiler/stable_mir/src/mir/body.rs @@ -25,7 +25,7 @@ impl Body { /// because the `arg_count` and `locals` fields are private. pub fn new(blocks: Vec, locals: LocalDecls, arg_count: usize) -> Self { // If locals doesn't contain enough entries, it can lead to panics in - // `ret_local`, `arg_locals`, and `internal_locals`. + // `ret_local`, `arg_locals`, and `inner_locals`. assert!( locals.len() > arg_count, "A Body must contain at least a local for the return value and each of the function's arguments" @@ -43,16 +43,16 @@ impl Body { &self.locals[1..self.arg_count + 1] } - /// Internal locals for this function. These are the locals that are + /// Inner locals for this function. These are the locals that are /// neither the return local nor the argument locals. - pub fn internal_locals(&self) -> &[LocalDecl] { + pub fn inner_locals(&self) -> &[LocalDecl] { &self.locals[self.arg_count + 1..] } /// Convenience function to get all the locals in this function. /// /// Locals are typically accessed via the more specific methods `ret_local`, - /// `arg_locals`, and `internal_locals`. + /// `arg_locals`, and `inner_locals`. pub fn locals(&self) -> &[LocalDecl] { &self.locals }