This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +508
-333
lines changed
tests/ui-fulldeps/stable-mir Expand file tree Collapse file tree 4 files changed +508
-333
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ pub mod pretty;
55pub mod visit;
66
77pub use body:: * ;
8- pub use visit:: MirVisitor ;
8+ pub use visit:: { MirVisitor , MutMirVisitor } ;
Original file line number Diff line number Diff line change @@ -77,6 +77,22 @@ impl Body {
7777 & self . locals [ self . arg_count + 1 ..]
7878 }
7979
80+ /// Returns a mutable reference to the local that holds this function's return value.
81+ pub ( crate ) fn ret_local_mut ( & mut self ) -> & mut LocalDecl {
82+ & mut self . locals [ RETURN_LOCAL ]
83+ }
84+
85+ /// Returns a mutable slice of locals corresponding to this function's arguments.
86+ pub ( crate ) fn arg_locals_mut ( & mut self ) -> & mut [ LocalDecl ] {
87+ & mut self . locals [ 1 ..] [ ..self . arg_count ]
88+ }
89+
90+ /// Returns a mutable slice of inner locals for this function.
91+ /// Inner locals are those that are neither the return local nor the argument locals.
92+ pub ( crate ) fn inner_locals_mut ( & mut self ) -> & mut [ LocalDecl ] {
93+ & mut self . locals [ self . arg_count + 1 ..]
94+ }
95+
8096 /// Convenience function to get all the locals in this function.
8197 ///
8298 /// Locals are typically accessed via the more specific methods `ret_local`,
You can’t perform that action at this time.
0 commit comments