Enum rustc_middle::mir::query::ConstraintCategory [−][src]
pub enum ConstraintCategory {
Show 18 variants
Return(ReturnConstraint),
Yield,
UseAsConst,
UseAsStatic,
TypeAnnotation,
Cast,
ClosureBounds,
CallArgument,
CopyBound,
SizedBound,
Assignment,
Usage,
OpaqueType,
ClosureUpvar(HirId),
Predicate(Span),
Boring,
BoringNoLocation,
Internal,
}
Expand description
Outlives-constraints can be categorized to determine whether and why they are interesting (for error reporting). Order of variants indicates sort order of the category, thereby influencing diagnostic output.
See also rustc_const_eval::borrow_check::constraints
.
Variants
Return(ReturnConstraint)
Tuple Fields of Return
A constraint that came from checking the body of a closure.
We try to get the category that the closure used when reporting this.
A constraint that came from a usage of a variable (e.g. in an ADT expression
like Foo { field: my_val }
)
ClosureUpvar(HirId)
Tuple Fields of ClosureUpvar
0: HirId
Predicate(Span)
A constraint from a user-written predicate
with the provided span, written on the item
with the given DefId
Tuple Fields of Predicate
0: Span
A “boring” constraint (caused by the given location) is one that the user probably doesn’t want to see described in diagnostics, because it is kind of an artifact of the type system setup.
A constraint that doesn’t correspond to anything the user sees.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ConstraintCategory
impl !Send for ConstraintCategory
impl !Sync for ConstraintCategory
impl Unpin for ConstraintCategory
impl UnwindSafe for ConstraintCategory
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
This method tries to recover the query key from the given DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it. Read more
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: 12 bytes
Size for each variant:
Return
: 8 bytesYield
: 0 bytesUseAsConst
: 0 bytesUseAsStatic
: 0 bytesTypeAnnotation
: 0 bytesCast
: 0 bytesClosureBounds
: 0 bytesCallArgument
: 0 bytesCopyBound
: 0 bytesSizedBound
: 0 bytesAssignment
: 0 bytesUsage
: 0 bytesOpaqueType
: 0 bytesClosureUpvar
: 8 bytesPredicate
: 8 bytesBoring
: 0 bytesBoringNoLocation
: 0 bytesInternal
: 0 bytes