Skip to main content

charon_lib/ast/type_level/
regions.rs

1use crate::ast::*;
2use derive_generic_visitor::*;
3use enum_as_inner::EnumAsInner;
4use serde_state::{DeserializeState, SerializeState};
5
6#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7#[derive(EnumAsInner)]
8#[derive(SerializeState, DeserializeState, Drive, DriveMut, DriveTwo)]
9#[cfg_attr(feature = "charon_on_charon", charon::variants_prefix("R"))]
10pub enum Region {
11    /// Region variable. See `DeBruijnVar` for details.
12    Var(RegionDbVar),
13    /// The least upper bound, in the outlives ordering, of the regions in this type.
14    /// `'lub<T>: 'a` is equivalent to `T: 'a`.
15    Lub(Ty),
16    /// Static region
17    Static,
18    /// Body-local region, considered existentially-bound at the level of a body.
19    Body(RegionId),
20    /// Erased region
21    Erased,
22}