Type Alias TypeDbVar

Source
pub type TypeDbVar = DeBruijnVar<TypeVarId>;

Aliased Type§

enum TypeDbVar {
    Bound(DeBruijnId, TypeVarId),
    Free(TypeVarId),
}

Variants§

§

Bound(DeBruijnId, TypeVarId)

A variable attached to the nth binder, counting from the innermost.

§

Free(TypeVarId)

A variable attached to the outermost binder (the one on the item). As explained above, This is not used in charon internals, only as a micro-pass before exporting the crate data.

Implementations

Source§

impl<Id> DeBruijnVar<Id>
where Id: Copy,

Source

pub fn new_at_zero(id: Id) -> Self

Source

pub fn free(id: Id) -> Self

Source

pub fn bound(index: DeBruijnId, id: Id) -> Self

Source

pub fn incr(&self) -> Self

Source

pub fn decr(&self) -> Self

Source

pub fn bound_at_depth(&self, depth: DeBruijnId) -> Option<Id>

Returns the variable id if it is bound as the given depth.

Source

pub fn bound_at_depth_mut(&mut self, depth: DeBruijnId) -> Option<&mut Id>

Returns the variable id if it is bound as the given depth.

Source

pub fn move_out_from_depth(&self, depth: DeBruijnId) -> Option<Self>

Move the variable out of depth binders. Returns None if the variable is bound in one of these depth binders.

Source

pub fn move_under_binders(&self, depth: DeBruijnId) -> Self

Move under depth binders.

Trait Implementations

Source§

impl<T: AstVisitable + Idx> AstVisitable for DeBruijnVar<T>

Source§

fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn name(&self) -> &'static str

The name of the type, used for debug logging.
Source§

fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

impl<Id: Clone> Clone for DeBruijnVar<Id>

Source§

fn clone(&self) -> DeBruijnVar<Id>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Id: Debug> Debug for DeBruijnVar<Id>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, Id> Deserialize<'de> for DeBruijnVar<Id>
where Id: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Id> Display for DeBruijnVar<Id>
where Id: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'s, Id, V> Drive<'s, V> for DeBruijnVar<Id>
where V: Visitor + Visit<'s, DeBruijnId> + Visit<'s, Id>,

Source§

fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self.
Source§

impl<'s, Id, V> DriveMut<'s, V> for DeBruijnVar<Id>
where V: Visitor + VisitMut<'s, DeBruijnId> + VisitMut<'s, Id>,

Source§

fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self.
Source§

impl<Id: Hash> Hash for DeBruijnVar<Id>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Id: Ord> Ord for DeBruijnVar<Id>

Source§

fn cmp(&self, other: &DeBruijnVar<Id>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<Id: PartialEq> PartialEq for DeBruijnVar<Id>

Source§

fn eq(&self, other: &DeBruijnVar<Id>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Id: PartialOrd> PartialOrd for DeBruijnVar<Id>

Source§

fn partial_cmp(&self, other: &DeBruijnVar<Id>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<Id> Serialize for DeBruijnVar<Id>
where Id: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Id: Copy> Copy for DeBruijnVar<Id>

Source§

impl<Id: Eq> Eq for DeBruijnVar<Id>

Source§

impl<Id> StructuralPartialEq for DeBruijnVar<Id>