pub(crate) struct InlineCtx<'z3, 'tcx> {
pub inline_depth: usize,
pub symbolic_generic_const_inline: bool,
pub inline_truncated_terms: FxHashSet<Int<'z3>>,
pub inline_branch_terms: FxHashSet<Int<'z3>>,
pub pending_states: Vec<Box<VmExecutor<'z3, 'tcx>>>,
pub opaque_intrinsic_terms: FxHashSet<Int<'z3>>,
pub arg_referents: Vec<Option<Local>>,
pub deferred_field_writes: Vec<(Local, Vec<usize>, VmValue<'z3, 'tcx>)>,
}Expand description
Scratch state shared by recursive inlining and path replay.
Recursive inlining saves caller bindings on the Rust call stack; path replay
saves them with the caller frame in SavedCallerFrame.
§Deferring &mut writes across the inline frame
While the callee runs, the caller’s local_alloc (the name → allocation
binding) is parked in the saved FrameState, so a write through a &mut
argument cannot resolve the caller referent local by address and land in its
field values immediately. arg_referents pre-resolves (before enter_frame)
which caller local each &mut argument points at, and deferred_field_writes
collects the writes to replay once the caller is restored:
struct Foo { field: i32 }
fn bar(foo: &mut Foo) { foo.field = 1; } // inlined callee
fn main() {
let mut x = Foo { field: 0 };
bar(&mut x); // inline `bar`
}- Enter
bar:enter_frameparksmain’s local_alloc;arg_referents[0] = x. - Run
bar:foo.field = 1((*foo).field) can no longer resolvexby address (the caller’s address map is gone), so it pushes(x, [0], 1). - Exit
bar:restore_framebringsmain’s local_alloc back, then the deferred write is replayed, givingx.field == 1.
Fields§
§inline_depth: usizeRecursive inlining depth, bounded by MAX_INLINE_DEPTH.
symbolic_generic_const_inline: bool§inline_truncated_terms: FxHashSet<Int<'z3>>Terms from depth-limited calls; dependent checks become Unknown.
inline_branch_terms: FxHashSet<Int<'z3>>§pending_states: Vec<Box<VmExecutor<'z3, 'tcx>>>§opaque_intrinsic_terms: FxHashSet<Int<'z3>>§arg_referents: Vec<Option<Local>>Caller referent local for each inlined callee argument.
deferred_field_writes: Vec<(Local, Vec<usize>, VmValue<'z3, 'tcx>)>(caller local, field path, value) writes replayed after frame restoration.
Trait Implementations§
Auto Trait Implementations§
impl<'z3, 'tcx> !DynSend for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> !DynSync for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> !RefUnwindSafe for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> !Send for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> !Sync for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> !UnwindSafe for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> Forget for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> Freeze for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> Move for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> Unpin for InlineCtx<'z3, 'tcx>
impl<'z3, 'tcx> UnsafeUnpin for InlineCtx<'z3, 'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more