pub enum RanOutOfContentCause {
Tunnel,
Function,
Plain,
Unknown,
}Expand description
Why execution ran out of content — the call-stack shape C#’s
Story.Continue() inspects to pick one of four messages (Story.cs,
the AddError calls guarding the “ran out of content” branch: it checks
callStack.CanPop(PushPopType.Tunnel), then .CanPop(PushPopType.Function),
then !callStack.canPop, with a final backstop for none of the above).
Classified the moment a frame’s content is discovered exhausted
(vm::handle_frame_exhaustion, the same instant C# reads
callStack.CanPop), but only stashed on Flow — for the next
continue_single call to raise as the deferred fault (issue #1574 ruled
the deferred timing stays — this only changes which cause is attached,
not when the fault fires) — on the paths where this exhaustion is
itself the terminal one (vm::Stepped::Done). A frame whose exhaustion
instead resumes execution (a completed thread with a parent to fall back
to, a popped frame with content still below it) never writes its cause:
otherwise a transient exhaustion elsewhere on the same flow (e.g. a
Story::call_function boundary evaluating a function that calls a void
helper) would clobber a cause an earlier, still-pending exhaustion had
already recorded, and a later, unrelated Done would read it stale. It
has to be classified that early rather than read fresh at fault time:
unlike C#, this runtime’s own exhaustion recovery always pops the
exhausted frame (even a Tunnel with nothing pending), so by the time the
deferred fault fires the frame that triggered it is usually long gone
from the call stack.
In practice, only Plain is reachable through any story
today: a Tunnel or Function frame’s exhaustion classifies correctly at
the instant it happens, but this runtime’s frame-popping (unlike C#’s)
keeps unwinding past it instead of stopping there — cascading all the
way to the root frame’s own exhaustion, which is the one that actually
produces the terminal Done and gets its Plain cause stashed, before
the fault ever surfaces. Making the other three arms reachable needs a
separate, deliberate fix to that popping behavior — tracked in #2005.
Variants§
Tunnel
The top call-stack frame is a tunnel (->t->) — content ran out
mid-tunnel with no ->-> to return. Mirrors
callStack.CanPop(PushPopType.Tunnel).
Function
The top call-stack frame is a function call — content ran out
mid-function with no ~ return. Mirrors
callStack.CanPop(PushPopType.Function).
Plain
The call stack can’t pop at all (only the root frame remains) — the
plain “story fell off the end” case, and the default when nothing
more specific was ever recorded. Mirrors !callStack.canPop.
Unknown
The call stack can still pop, but the exhausted frame that produced
the terminal Done is neither a tunnel nor a function — e.g. a
Thread boundary with no parent thread left to fall back to, or a
FunctionEvalFromGame boundary that is itself the last frame
standing. C#’s backstop for a call-stack shape well-formed compiler
output should never produce; an ordinary <- thread completing
(a Thread frame exhausting with a parent thread still waiting)
never reaches this arm — that path resumes via ThreadCompleted and
records no cause at all.
Trait Implementations§
Source§impl Clone for RanOutOfContentCause
impl Clone for RanOutOfContentCause
Source§fn clone(&self) -> RanOutOfContentCause
fn clone(&self) -> RanOutOfContentCause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RanOutOfContentCause
Source§impl Debug for RanOutOfContentCause
impl Debug for RanOutOfContentCause
Source§impl Default for RanOutOfContentCause
impl Default for RanOutOfContentCause
Source§fn default() -> RanOutOfContentCause
fn default() -> RanOutOfContentCause
Source§impl Display for RanOutOfContentCause
impl Display for RanOutOfContentCause
impl Eq for RanOutOfContentCause
Source§impl Error for RanOutOfContentCause
impl Error for RanOutOfContentCause
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()