pub struct ConstraintContext<'a> {
pub locals: HashMap<Spur, LocalVarInfo>,
pub params: &'a HashMap<Spur, ParamVarInfo>,
pub return_type: Type,
pub loop_depth: u32,
/* private fields */
}Expand description
Context for constraint generation within a single function.
Fields§
§locals: HashMap<Spur, LocalVarInfo>Local variables in scope.
params: &'a HashMap<Spur, ParamVarInfo>Function parameters.
return_type: TypeReturn type of the current function.
loop_depth: u32How many loops we’re nested inside (for break/continue validation).
Implementations§
Source§impl<'a> ConstraintContext<'a>
impl<'a> ConstraintContext<'a>
Sourcepub fn new(params: &'a HashMap<Spur, ParamVarInfo>, return_type: Type) -> Self
pub fn new(params: &'a HashMap<Spur, ParamVarInfo>, return_type: Type) -> Self
Create a new context for a function.
Auto Trait Implementations§
impl<'a> Freeze for ConstraintContext<'a>
impl<'a> RefUnwindSafe for ConstraintContext<'a>
impl<'a> Send for ConstraintContext<'a>
impl<'a> Sync for ConstraintContext<'a>
impl<'a> Unpin for ConstraintContext<'a>
impl<'a> UnwindSafe for ConstraintContext<'a>
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