Struct chalk_integration::lowering::env::Env
source · pub struct Env<'k> {Show 16 fields
pub adt_ids: &'k BTreeMap<Identifier, AdtId<ChalkIr>>,
pub adt_kinds: &'k BTreeMap<AdtId<ChalkIr>, TypeKind>,
pub fn_def_ids: &'k BTreeMap<Identifier, FnDefId<ChalkIr>>,
pub fn_def_kinds: &'k BTreeMap<FnDefId<ChalkIr>, TypeKind>,
pub closure_ids: &'k BTreeMap<Identifier, ClosureId<ChalkIr>>,
pub closure_kinds: &'k BTreeMap<ClosureId<ChalkIr>, TypeKind>,
pub trait_ids: &'k BTreeMap<Identifier, TraitId<ChalkIr>>,
pub trait_kinds: &'k BTreeMap<TraitId<ChalkIr>, TypeKind>,
pub opaque_ty_ids: &'k BTreeMap<Identifier, OpaqueTyId<ChalkIr>>,
pub opaque_ty_kinds: &'k BTreeMap<OpaqueTyId<ChalkIr>, TypeKind>,
pub associated_ty_lookups: &'k BTreeMap<(TraitId<ChalkIr>, Identifier), AssociatedTyLookup>,
pub auto_traits: &'k BTreeMap<TraitId<ChalkIr>, bool>,
pub foreign_ty_ids: &'k BTreeMap<Identifier, ForeignDefId<ChalkIr>>,
pub coroutine_ids: &'k BTreeMap<Identifier, CoroutineId<ChalkIr>>,
pub coroutine_kinds: &'k BTreeMap<CoroutineId<ChalkIr>, TypeKind>,
pub parameter_map: BTreeMap<Identifier, WithKind<ChalkIr, BoundVar>>,
}Fields§
§adt_ids: &'k BTreeMap<Identifier, AdtId<ChalkIr>>§adt_kinds: &'k BTreeMap<AdtId<ChalkIr>, TypeKind>§fn_def_ids: &'k BTreeMap<Identifier, FnDefId<ChalkIr>>§fn_def_kinds: &'k BTreeMap<FnDefId<ChalkIr>, TypeKind>§closure_ids: &'k BTreeMap<Identifier, ClosureId<ChalkIr>>§closure_kinds: &'k BTreeMap<ClosureId<ChalkIr>, TypeKind>§trait_ids: &'k BTreeMap<Identifier, TraitId<ChalkIr>>§trait_kinds: &'k BTreeMap<TraitId<ChalkIr>, TypeKind>§opaque_ty_ids: &'k BTreeMap<Identifier, OpaqueTyId<ChalkIr>>§opaque_ty_kinds: &'k BTreeMap<OpaqueTyId<ChalkIr>, TypeKind>§associated_ty_lookups: &'k BTreeMap<(TraitId<ChalkIr>, Identifier), AssociatedTyLookup>§auto_traits: &'k BTreeMap<TraitId<ChalkIr>, bool>§foreign_ty_ids: &'k BTreeMap<Identifier, ForeignDefId<ChalkIr>>§coroutine_ids: &'k BTreeMap<Identifier, CoroutineId<ChalkIr>>§coroutine_kinds: &'k BTreeMap<CoroutineId<ChalkIr>, TypeKind>§parameter_map: BTreeMap<Identifier, WithKind<ChalkIr, BoundVar>>GenericArg identifiers are used as keys, therefore all identifiers in an environment must be unique (no shadowing).
Implementations§
source§impl Env<'_>
impl Env<'_>
pub fn interner(&self) -> ChalkIr
pub fn lookup_generic_arg( &self, name: &Identifier, ) -> Result<GenericArg<ChalkIr>, RustIrError>
pub fn lookup_type( &self, name: &Identifier, ) -> Result<TypeLookup<'_>, RustIrError>
pub fn auto_trait(&self, id: TraitId<ChalkIr>) -> bool
pub fn lookup_trait( &self, name: &Identifier, ) -> Result<TraitId<ChalkIr>, RustIrError>
pub fn trait_kind(&self, id: TraitId<ChalkIr>) -> &TypeKind
pub fn adt_kind(&self, id: AdtId<ChalkIr>) -> &TypeKind
pub fn fn_def_kind(&self, id: FnDefId<ChalkIr>) -> &TypeKind
pub fn closure_kind(&self, id: ClosureId<ChalkIr>) -> &TypeKind
pub fn opaque_kind(&self, id: OpaqueTyId<ChalkIr>) -> &TypeKind
pub fn coroutine_kind(&self, id: CoroutineId<ChalkIr>) -> &TypeKind
pub fn lookup_associated_ty( &self, trait_id: TraitId<ChalkIr>, ident: &Identifier, ) -> Result<&AssociatedTyLookup, RustIrError>
sourcepub fn introduce<I>(&self, binders: I) -> Result<Self, RustIrError>
pub fn introduce<I>(&self, binders: I) -> Result<Self, RustIrError>
Introduces new parameters, shifting the indices of existing parameters to accommodate them. The indices of the new binders will be assigned in order as they are iterated.
pub fn in_binders<I, T, OP>(
&self,
binders: I,
op: OP,
) -> Result<Binders<T>, RustIrError>where
I: IntoIterator<Item = WithKind<ChalkIr, Ident>>,
I::IntoIter: ExactSizeIterator,
T: HasInterner<Interner = ChalkIr>,
OP: FnOnce(&Self) -> Result<T, RustIrError>,
Trait Implementations§
Auto Trait Implementations§
impl<'k> Freeze for Env<'k>
impl<'k> RefUnwindSafe for Env<'k>
impl<'k> Send for Env<'k>
impl<'k> Sync for Env<'k>
impl<'k> Unpin for Env<'k>
impl<'k> UnwindSafe for Env<'k>
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
source§impl<T> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U using CastTo.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)