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

0: ReturnConstraint
Yield
UseAsConst
UseAsStatic
TypeAnnotation
Cast
ClosureBounds

A constraint that came from checking the body of a closure.

We try to get the category that the closure used when reporting this.

CallArgument
CopyBound
SizedBound
Assignment
Usage

A constraint that came from a usage of a variable (e.g. in an ADT expression like Foo { field: my_val })

OpaqueType
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
Boring

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.

BoringNoLocation
Internal

A constraint that doesn’t correspond to anything the user sees.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion 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: 12 bytes

Size for each variant: