pub struct ClosureInfo {
pub free_vars: Vec<LcnfVarId>,
pub captured_types: Vec<LcnfType>,
pub arity: usize,
pub is_escaping: bool,
pub has_side_effects: bool,
pub original_name: Option<String>,
}Expand description
Information about a closure discovered during analysis.
Fields§
§free_vars: Vec<LcnfVarId>Free variables captured by the closure.
captured_types: Vec<LcnfType>Types of the captured variables.
arity: usizeArity (number of explicit parameters).
is_escaping: boolWhether the closure escapes its defining scope.
has_side_effects: boolWhether the closure body has side effects.
original_name: Option<String>The original function name (if this closure was lifted).
Implementations§
Source§impl ClosureInfo
impl ClosureInfo
Sourcepub fn can_stack_allocate(&self) -> bool
pub fn can_stack_allocate(&self) -> bool
Whether this closure can be stack-allocated.
Sourcepub fn total_fields(&self) -> usize
pub fn total_fields(&self) -> usize
Total number of fields in the closure struct (fn_ptr + captured).
Trait Implementations§
Source§impl Clone for ClosureInfo
impl Clone for ClosureInfo
Source§fn clone(&self) -> ClosureInfo
fn clone(&self) -> ClosureInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClosureInfo
impl Debug for ClosureInfo
Auto Trait Implementations§
impl Freeze for ClosureInfo
impl RefUnwindSafe for ClosureInfo
impl Send for ClosureInfo
impl Sync for ClosureInfo
impl Unpin for ClosureInfo
impl UnsafeUnpin for ClosureInfo
impl UnwindSafe for ClosureInfo
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
Mutably borrows from an owned value. Read more