pub(crate) enum TypeTrace {
Types(Ty, Ty),
BaseTys(BaseTy, BaseTy),
}Expand description
Used for debugging to attach a “trace” to the RefineTree that can be used to print information
to recover the derivation when relating types via subtyping. The code that attaches the trace is
currently commented out because the output is too verbose.
Variants§
Implementations§
Trait Implementations§
Source§impl TypeFoldable for TypeTrace
impl TypeFoldable for TypeTrace
fn try_fold_with<__F: FallibleTypeFolder>( &self, __folder: &mut __F, ) -> Result<Self, __F::Error>
fn fold_with<F>(&self, folder: &mut F) -> Selfwhere
F: TypeFolder,
Source§fn normalize(&self, genv: GlobalEnv<'_, '_>) -> Self
fn normalize(&self, genv: GlobalEnv<'_, '_>) -> Self
Normalize expressions by applying beta reductions for tuples and lambda abstractions.
Source§fn replace_holes(
&self,
f: impl FnMut(&[Interned<[BoundVariableKind]>], HoleKind) -> Expr,
) -> Self
fn replace_holes( &self, f: impl FnMut(&[Interned<[BoundVariableKind]>], HoleKind) -> Expr, ) -> Self
Replaces all holes with the result of calling a closure. The closure takes a list with
all the layers of bound variables at the point the hole was found. Each layer corresponds
to the list of bound variables at that level. The list is ordered from outermost to innermost
binder, i.e., the last element is the binder closest to the hole.
Source§fn with_holes(&self) -> Self
fn with_holes(&self) -> Self
Remove all refinements and turn each underlying
BaseTy into a TyKind::Exists with a
TyKind::Constr and a hole. For example, Vec<{v. i32[v] | v > 0}>[n] becomes
{n. Vec<{v. i32[v] | *}>[n] | *}.fn replace_evars( &self, f: &mut impl FnMut(EVid) -> Option<Expr>, ) -> Result<Self, EVid>
Source§fn shift_horizontally(&self, amount: usize) -> Self
fn shift_horizontally(&self, amount: usize) -> Self
Shift the [
BoundVar] of all the the variables at index [INNERMOST] “horizontally” to the
right by the specified amount.fn shift_in_escaping(&self, amount: u32) -> Self
fn shift_out_escaping(&self, amount: u32) -> Self
fn erase_regions(&self) -> Self
Source§impl TypeVisitable for TypeTrace
impl TypeVisitable for TypeTrace
fn visit_with<__V: TypeVisitor>( &self, __visitor: &mut __V, ) -> ControlFlow<__V::BreakTy>
fn has_escaping_bvars(&self) -> bool
Source§fn has_escaping_bvars_at_or_above(&self, binder: DebruijnIndex) -> bool
fn has_escaping_bvars_at_or_above(&self, binder: DebruijnIndex) -> bool
Returns
true if self has any late-bound vars that are either
bound by binder or bound by some binder outside of binder.
If binder is ty::INNERMOST, this indicates whether
there are any late-bound vars that appear free.Source§fn fvars(&self) -> HashSet<Name, FxBuildHasher>
fn fvars(&self) -> HashSet<Name, FxBuildHasher>
Returns the set of all free variables.
For example,
Vec<i32[n]>{v : v > m} returns {n, m}.fn early_params(&self) -> HashSet<EarlyReftParam, FxBuildHasher>
Source§fn redundant_bvars(&self) -> HashSet<BoundVar, FxBuildHasher>
fn redundant_bvars(&self) -> HashSet<BoundVar, FxBuildHasher>
Gives the indices of the provided bvars which: Read more
Auto Trait Implementations§
impl Freeze for TypeTrace
impl RefUnwindSafe for TypeTrace
impl Send for TypeTrace
impl Sync for TypeTrace
impl Unpin for TypeTrace
impl UnwindSafe for TypeTrace
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more