Do renames proposed by review

This commit is contained in:
Maybe Waffle 2024-06-17 17:36:26 +00:00 committed by Maybe Lapkin
parent 236352024b
commit dd5a447b5a
2 changed files with 9 additions and 9 deletions

View File

@ -160,7 +160,7 @@ pub enum StackPopCleanup {
} }
/// Return type of [`InterpCx::pop_stack_frame`]. /// Return type of [`InterpCx::pop_stack_frame`].
pub struct StackPop<'tcx, Prov: Provenance> { pub struct StackPopInfo<'tcx, Prov: Provenance> {
/// Additional information about the action to be performed when returning from the popped /// Additional information about the action to be performed when returning from the popped
/// stack frame. /// stack frame.
pub return_action: ReturnAction, pub return_action: ReturnAction,
@ -890,7 +890,7 @@ fn after_stack_frame_push(
pub fn pop_stack_frame( pub fn pop_stack_frame(
&mut self, &mut self,
unwinding: bool, unwinding: bool,
) -> InterpResult<'tcx, StackPop<'tcx, M::Provenance>> { ) -> InterpResult<'tcx, StackPopInfo<'tcx, M::Provenance>> {
let cleanup = self.cleanup_current_frame_locals()?; let cleanup = self.cleanup_current_frame_locals()?;
let frame = let frame =
@ -905,7 +905,7 @@ pub fn pop_stack_frame(
ReturnAction::NoCleanup ReturnAction::NoCleanup
}; };
Ok(StackPop { return_action, return_to_block, return_place }) Ok(StackPopInfo { return_action, return_to_block, return_place })
} }
/// A private helper for [`pop_stack_frame`](InterpCx::pop_stack_frame). /// A private helper for [`pop_stack_frame`](InterpCx::pop_stack_frame).
@ -1043,12 +1043,12 @@ pub(super) fn return_from_current_stack_frame(
}; };
// All right, now it is time to actually pop the frame. // All right, now it is time to actually pop the frame.
let frame = self.pop_stack_frame(unwinding)?; let stack_pop_info = self.pop_stack_frame(unwinding)?;
// Report error from return value copy, if any. // Report error from return value copy, if any.
copy_ret_result?; copy_ret_result?;
match frame.return_action { match stack_pop_info.return_action {
ReturnAction::Normal => {} ReturnAction::Normal => {}
ReturnAction::NoJump => { ReturnAction::NoJump => {
// The hook already did everything. // The hook already did everything.
@ -1066,7 +1066,7 @@ pub(super) fn return_from_current_stack_frame(
// Normal return, figure out where to jump. // Normal return, figure out where to jump.
if unwinding { if unwinding {
// Follow the unwind edge. // Follow the unwind edge.
let unwind = match frame.return_to_block { let unwind = match stack_pop_info.return_to_block {
StackPopCleanup::Goto { unwind, .. } => unwind, StackPopCleanup::Goto { unwind, .. } => unwind,
StackPopCleanup::Root { .. } => { StackPopCleanup::Root { .. } => {
panic!("encountered StackPopCleanup::Root when unwinding!") panic!("encountered StackPopCleanup::Root when unwinding!")
@ -1076,7 +1076,7 @@ pub(super) fn return_from_current_stack_frame(
self.unwind_to_block(unwind) self.unwind_to_block(unwind)
} else { } else {
// Follow the normal return edge. // Follow the normal return edge.
match frame.return_to_block { match stack_pop_info.return_to_block {
StackPopCleanup::Goto { ret, .. } => self.return_to_block(ret), StackPopCleanup::Goto { ret, .. } => self.return_to_block(ret),
StackPopCleanup::Root { .. } => { StackPopCleanup::Root { .. } => {
assert!( assert!(

View File

@ -27,7 +27,7 @@
}; };
use crate::{ use crate::{
fluent_generated as fluent, fluent_generated as fluent,
interpret::{eval_context::StackPop, ReturnAction}, interpret::{eval_context::StackPopInfo, ReturnAction},
}; };
/// An argment passed to a function. /// An argment passed to a function.
@ -982,7 +982,7 @@ pub(crate) fn eval_fn_tail_call(
// only the tail called function should return to the current return block. // only the tail called function should return to the current return block.
M::before_stack_pop(self, self.frame())?; M::before_stack_pop(self, self.frame())?;
let StackPop { return_action, return_to_block, return_place } = let StackPopInfo { return_action, return_to_block, return_place } =
self.pop_stack_frame(false)?; self.pop_stack_frame(false)?;
assert_eq!(return_action, ReturnAction::Normal); assert_eq!(return_action, ReturnAction::Normal);