pub enum DefiningAnchor {
    Bind(LocalDefId),
    Bubble,
    Error,
}
Expand description

Defines the treatment of opaque types in a given inference context.

This affects both what opaques are allowed to be defined, but also whether opaques are replaced with inference vars eagerly in the old solver (e.g. in projection, and in the signature during function type-checking).

Variants§

§

Bind(LocalDefId)

Define opaques which are in-scope of the LocalDefId. Also, eagerly replace opaque types in replace_opaque_types_with_inference_vars.

§

Bubble

In contexts where we don’t currently know what opaques are allowed to be defined, such as (old solver) canonical queries, we will simply allow opaques to be defined, but “bubble” them up in the canonical response or otherwise treat them to be handled later.

We do not eagerly replace opaque types in replace_opaque_types_with_inference_vars, which may affect what predicates pass and fail in the old trait solver.

§

Error

Do not allow any opaques to be defined. This is used to catch type mismatch errors when handling opaque types, and also should be used when we would otherwise reveal opaques (such as Reveal::All reveal mode).

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> 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,

§

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>,

§

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>,

§

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 4 bytes

Size for each variant:

  • Bind: 4 bytes
  • Bubble: 0 bytes
  • Error: 0 bytes