pub struct Instantiations {
pub calls: HashMap<Site, CallInstance>,
pub constructed: HashMap<Site, InferType>,
pub empty_lists: HashMap<Site, InferType>,
pub scrutinees: HashMap<Site, InferType>,
pub type_params: HashMap<Symbol, Vec<(Symbol, InferType)>>,
}Expand description
What the checker solved at every generic site of a program — the input to monomorphization.
Types are RESOLVED, not zonked: a site inside a generic function’s body still names that
function’s own type variables (listed in type_params), to be substituted once per instance.
A variable nothing constrained stays a variable.
Fields§
§calls: HashMap<Site, CallInstance>Each call of a generic function.
constructed: HashMap<Site, InferType>Each New / NewVariant and some / none: the type it builds.
empty_lists: HashMap<Site, InferType>Each empty sequence literal ([]): the sequence type its context gives it.
scrutinees: HashMap<Site, InferType>Each Inspect: the type of the value it inspects.
type_params: HashMap<Symbol, Vec<(Symbol, InferType)>>Each generic function’s type parameters in declaration order, each as the type its variable resolved to (its own unbound variable, unless the body pinned it).
Trait Implementations§
Source§impl Debug for Instantiations
impl Debug for Instantiations
Source§impl Default for Instantiations
impl Default for Instantiations
Source§fn default() -> Instantiations
fn default() -> Instantiations
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Instantiations
impl RefUnwindSafe for Instantiations
impl Send for Instantiations
impl Sync for Instantiations
impl Unpin for Instantiations
impl UnsafeUnpin for Instantiations
impl UnwindSafe for Instantiations
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.