Module qualifs

Source
Expand description

Structural const qualification.

See the Qualif trait for more info.

Structs§

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 because implicit promotion would remove side-effects that occur as part of dropping that value. N.B., the implicit promotion has to reject const Drop implementations because even if side-effects are ruled out through other means, the execution of the drop could diverge.
NeedsNonConstDrop
Constant containing an ADT that implements non-const Drop. This must be ruled out because we cannot run Drop during compile-time.

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.