[−][src]Module rustc_mir::transform::check_consts::qualifs

Structural const qualification.

See the Qualif trait for more info.

Structs

CustomEq

A constant that cannot be used as part of a pattern in a match expression.

HasMutInterior

Constant containing interior mutability (UnsafeCell<T>). This must be ruled out to make sure that evaluating the constant at compile-time and at any point during the run-time would produce the same result. In particular, promotion of temporaries must not change program behavior; if the promoted could be written to, that would be a problem.

NeedsDrop

Constant containing an ADT that implements Drop. This must be ruled out (a) because we cannot run Drop during compile-time as that might not be a const fn, and (b) because implicit promotion would remove side-effects that occur as part of dropping that value.

Traits

Qualif

A "qualif"(-ication) is a way to look for something "bad" in the MIR that would disqualify some code for promotion or prevent it from evaluating at compile time.

Functions

in_any_value_of_ty
in_operand

Returns true if this Operand contains qualif Q.

in_place

Returns true if this Place contains qualif Q.

in_rvalue

Returns true if this Rvalue contains qualif Q.