Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit de7ab3d

Browse files
committedMar 22, 2025
Auto merge of rust-lang#138803 - matthiaskrgr:rollup-qtvr8ov, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#136769 (Provide optional `Read`/`Write` methods for stdio) - rust-lang#138410 (Couple mir building cleanups) - rust-lang#138490 (Forward `stream_position` in `Arc<File>` as well) - rust-lang#138535 (Cleanup `LangString::parse`) - rust-lang#138536 (stable_mir: Add `MutMirVisitor`) - rust-lang#138673 (Fix build failure on Trusty) - rust-lang#138750 (Make `crate_hash` not iterate over `hir_crate` owners anymore) - rust-lang#138763 (jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 48b36c9 + 66d2e2a commit de7ab3d

File tree

172 files changed

+1984
-1772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+1984
-1772
lines changed
 

‎compiler/stable_mir/src/mir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pub mod pretty;
55
pub mod visit;
66

77
pub use body::*;
8-
pub use visit::MirVisitor;
8+
pub use visit::{MirVisitor, MutMirVisitor};

‎compiler/stable_mir/src/mir/body.rs

+16
Original file line numberDiff line numberDiff 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`,
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.