pub struct LifetimeInferencer { /* private fields */ }Expand description
Infers lifetimes for local variables based on their usage patterns
Implementations§
Source§impl LifetimeInferencer
impl LifetimeInferencer
pub fn new() -> Self
Sourcepub fn infer_function_lifetimes(
&mut self,
function: &IrFunction,
) -> HashMap<String, InferredLifetime>
pub fn infer_function_lifetimes( &mut self, function: &IrFunction, ) -> HashMap<String, InferredLifetime>
Infer lifetimes for all variables in a function
Sourcepub fn lifetimes_overlap(&self, a: &str, b: &str) -> bool
pub fn lifetimes_overlap(&self, a: &str, b: &str) -> bool
Check if two lifetimes overlap
Sourcepub fn get_lifetime(&self, var: &str) -> Option<&InferredLifetime>
pub fn get_lifetime(&self, var: &str) -> Option<&InferredLifetime>
Get the inferred lifetime for a variable
Sourcepub fn is_alive_at(&self, var: &str, point: usize) -> bool
pub fn is_alive_at(&self, var: &str, point: usize) -> bool
Check if a variable is alive at a given point
Auto Trait Implementations§
impl Freeze for LifetimeInferencer
impl RefUnwindSafe for LifetimeInferencer
impl Send for LifetimeInferencer
impl Sync for LifetimeInferencer
impl Unpin for LifetimeInferencer
impl UnwindSafe for LifetimeInferencer
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