Skip to main content

SubtypingEnvironment

Struct SubtypingEnvironment 

Source
pub struct SubtypingEnvironment {
    pub parent: *mut SubtypingEnvironment,
    pub mapped_generics: DenseHashMap<TypeId, Vec<GenericBounds>>,
    pub mapped_generic_packs: MappedGenericEnvironment,
    pub substitutions: DenseHashMap<TypeId, TypeId>,
    pub seen_set_cache: DenseHashMap<(TypeId, TypeId), SubtypingResult, TypePairHash>,
    pub iteration_count: i32,
}

Fields§

§parent: *mut SubtypingEnvironment§mapped_generics: DenseHashMap<TypeId, Vec<GenericBounds>>§mapped_generic_packs: MappedGenericEnvironment§substitutions: DenseHashMap<TypeId, TypeId>§seen_set_cache: DenseHashMap<(TypeId, TypeId), SubtypingResult, TypePairHash>§iteration_count: i32

Implementations§

Source§

impl SubtypingEnvironment

Source

pub fn apply_mapped_generics( &mut self, builtin_types: *mut BuiltinTypes, arena: *mut TypeArena, ty: TypeId, ice_reporter: *mut InternalErrorReporter, ) -> Option<TypeId>

C++ SubtypingEnvironment::applyMappedGenerics (Subtyping.cpp:504-513):

ApplyMappedGenerics amg{builtinTypes, arena, *this, iceReporter};
return amg.substitute(ty);

ApplyMappedGenerics extends Substitution and inherits substitute, whose traversal virtual-dispatches into the overridden isDirty / clean / ignoreChildren. The Rust ApplyMappedGenerics now embeds base: Substitution and installs those overrides into the SubstitutionVtable from its substitute_type_id wrapper.

Source§

impl SubtypingEnvironment

Source§

impl SubtypingEnvironment

Source

pub fn contains_mapped_type(&self, ty: TypeId) -> bool

Source§

impl SubtypingEnvironment

Source

pub fn get_mapped_type_bounds( &mut self, ty: TypeId, ice_reporter: *mut InternalErrorReporter, ) -> &mut GenericBounds

Source§

impl SubtypingEnvironment

Source§

impl SubtypingEnvironment

Source§

impl SubtypingEnvironment

Source

pub fn try_find_subtyping_result( &self, sub_and_super: (TypeId, TypeId), ) -> Option<&SubtypingResult>

Trait Implementations§

Source§

impl Debug for SubtypingEnvironment

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.