Skip to main content

Unknown

Enum Unknown 

Source
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§

Source§

impl Clone for Unknown

Source§

fn clone(&self) -> Unknown

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Unknown

Source§

impl Debug for Unknown

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Unknown

Source§

impl PartialEq for Unknown

Source§

fn eq(&self, other: &Unknown) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Unknown

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.