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§
impl RefUnwindSafe for DefiningAnchor
impl Send for DefiningAnchor
impl Sync for DefiningAnchor
impl Unpin for DefiningAnchor
impl UnwindSafe for DefiningAnchor
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
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 bytesBubble
: 0 bytesError
: 0 bytes