pub struct ClosureBodyPeek {
pub params: Vec<FunctionParameter>,
pub body: Vec<Statement>,
pub return_type: Option<TypeAnnotation>,
pub function_index: Option<usize>,
}Expand description
cluster-2-cw-IB-class-b (2026-05-16, supervisor R3 binding-ratified):
retained closure-literal peek used to re-run body return-type
inference at the value-call site with caller-context arg type hints.
Stored per-local-slot in BytecodeCompiler.local_callable_closure_bodies
at let-binding time (update_callable_binding_from_expr /
FunctionExpr arm). The body is the AST Vec<Statement> clone — no
bytecode-lowering happens at lookup time; the inference walker only
inspects AST shape.
Fields§
§params: Vec<FunctionParameter>Formal parameters of the closure literal (|inner| →
[FunctionParameter { pattern: Identifier("inner"), .. }]).
body: Vec<Statement>Closure literal body statements.
return_type: Option<TypeAnnotation>Explicit -> T return annotation, if any.
function_index: Option<usize>Compiled-function index assigned to the closure body by
compile_expr_closure. None until the closure literal is
actually lowered (the peek is built from the AST; the function
index is assigned at compile-emission time). Used by the value-
call propagation path to retroactively patch
mir.local_typed_array_element_types for the closure body’s
MIR-side typed-array param seed.
Trait Implementations§
Source§impl Clone for ClosureBodyPeek
impl Clone for ClosureBodyPeek
Source§fn clone(&self) -> ClosureBodyPeek
fn clone(&self) -> ClosureBodyPeek
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ClosureBodyPeek
impl RefUnwindSafe for ClosureBodyPeek
impl Send for ClosureBodyPeek
impl Sync for ClosureBodyPeek
impl Unpin for ClosureBodyPeek
impl UnsafeUnpin for ClosureBodyPeek
impl UnwindSafe for ClosureBodyPeek
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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