pub trait TyCtxMut: TyCtx {
type Snap;
// Required methods
fn start_scope(&mut self) -> Self::Snap;
fn end_scope(&mut self, snap: Self::Snap);
fn bind_local(&mut self, var: &Interned<TypeVar>, ty: Ty);
fn type_of_func(&mut self, func: &Func) -> Option<Interned<SigTy>>;
fn type_of_value(&mut self, val: &Value) -> Ty;
fn check_module_item(
&mut self,
module: FileId,
key: &Interned<str>,
) -> Option<Ty>;
// Provided methods
fn with_scope<R>(&mut self, f: impl FnOnce(&mut Self) -> R) -> R { ... }
fn type_of_dict(&mut self, dict: &Dict) -> Interned<RecordTy> { ... }
fn type_of_module(&mut self, module: &Module) -> Interned<RecordTy> { ... }
}
Expand description
A mutable type context.
Required Associated Types§
Required Methods§
Sourcefn start_scope(&mut self) -> Self::Snap
fn start_scope(&mut self) -> Self::Snap
Start a new scope.
Sourcefn bind_local(&mut self, var: &Interned<TypeVar>, ty: Ty)
fn bind_local(&mut self, var: &Interned<TypeVar>, ty: Ty)
Bind a variable locally.
Sourcefn type_of_func(&mut self, func: &Func) -> Option<Interned<SigTy>>
fn type_of_func(&mut self, func: &Func) -> Option<Interned<SigTy>>
Get the type of a runtime function.
Sourcefn type_of_value(&mut self, val: &Value) -> Ty
fn type_of_value(&mut self, val: &Value) -> Ty
Get the type of a runtime value.
Provided Methods§
Sourcefn with_scope<R>(&mut self, f: impl FnOnce(&mut Self) -> R) -> R
fn with_scope<R>(&mut self, f: impl FnOnce(&mut Self) -> R) -> R
Execute a function with a new scope.
Sourcefn type_of_dict(&mut self, dict: &Dict) -> Interned<RecordTy>
fn type_of_dict(&mut self, dict: &Dict) -> Interned<RecordTy>
Get the type of a runtime dict.
Sourcefn type_of_module(&mut self, module: &Module) -> Interned<RecordTy>
fn type_of_module(&mut self, module: &Module) -> Interned<RecordTy>
Get the type of a runtime module.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.