Enum rustc_middle::mir::ConstraintCategory[][src]

pub enum ConstraintCategory {
Show 16 variants Return(ReturnConstraint), Yield, UseAsConst, UseAsStatic, TypeAnnotation, Cast, ClosureBounds, CallArgument, CopyBound, SizedBound, Assignment, OpaqueType, ClosureUpvar(HirId), 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_mir::borrow_check::constraints.

Variants

Return

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

Tuple Fields of ClosureUpvar

0: HirId
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. Example: x = Foo { field: y } technically creates intermediate regions representing the “type of Foo { field: y }”, and data flows from y into those variables, but they are not very interesting. The assignment into x on the other hand might be.

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

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 be different between compiler versions and platforms. 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