File tree 4 files changed +508
-333
lines changed
tests/ui-fulldeps/stable-mir
4 files changed +508
-333
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ pub mod pretty;
5
5
pub mod visit;
6
6
7
7
pub 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 {
77
77
& self . locals [ self . arg_count + 1 ..]
78
78
}
79
79
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
+
80
96
/// Convenience function to get all the locals in this function.
81
97
///
82
98
/// Locals are typically accessed via the more specific methods `ret_local`,
You can’t perform that action at this time.
0 commit comments