pub enum Unknown {
Recovery,
DynamicBoundary,
Unconstrained,
Var(u32),
Placeholder,
}Expand description
Why the checker does not know a type.
This is the classification the module documentation describes, carried by the type rather than implied by which constructor built it. Every kind compares equal to every type — telling them apart decides what a reader is told, never what type-checks — so the only thing this changes about the checking rules is that a form can ask whether the unknown standing in for its context has already been accounted for.
Variants§
Recovery
An error was already reported about this place, or about the value this one was derived from. Silent.
DynamicBoundary
A host module no schema describes — neither a shipped one nor one an
embedder handed over. The remedy is at the use that names the
module, not here.
Unconstrained
Nothing that has been read states this type: a shipped schema’s
HostType::Any, or a type parameter no argument, annotation, or
expected type settles.
Var(u32)
An unconstrained unknown carrying an identity, so that a later use can say what it is.
This is not a fifth kind of not-knowing. It is the same fact as
Unknown::Unconstrained — a type parameter nothing read so far
settles — with a number attached, and the number is what lets the
uses of a local binding after its initializer settle the type its
initializer left open. See the module documentation under
“Inference variables”: one never leaves the body that minted it, and
what is left in Facts is either the type its uses settled or a
plain unconstrained unknown.
Placeholder
A position no reachable program observes.
This is not a classification of a program’s type. It marks the
internal positions the surrounding form settles before anything reads
them and the ones no reachable program produces at all, and
Checker::expr and Checker::declare assert in debug builds that
one never reaches a type a program can observe. If one ever does, the
assertion names the site rather than leaving the unknown to validate
whatever came after it.
Trait Implementations§
impl Copy for Unknown
impl Eq for Unknown
impl StructuralPartialEq for Unknown
Auto Trait Implementations§
impl Freeze for Unknown
impl RefUnwindSafe for Unknown
impl Send for Unknown
impl Sync for Unknown
impl Unpin for Unknown
impl UnsafeUnpin for Unknown
impl UnwindSafe for Unknown
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.