Expand description
Reconstruct structured expressions from rustcβs various constant representations.
FunctionsΒ§
- alloc_
as_ πglobal - The global that an allocation corresponds to, if any.
- alloc_
provenance π - The provenance to give to the bytes of a pointer into the given allocation.
- bits_
and_ πtype_ to_ float_ constant_ literal - Converts a bit-representation of a float of type
tyto a constant literal - const_
value_ to_ constant_ expr - const_
value_ to_ raw_ memory - Like
const_value_to_constant_expr, but untyped. - eval_
ty_ constant - Evaluate a
ty::Const. - imm_
to_ πraw_ bytes - The bytes of an immediate, which is made of at most two scalars.
- is_
anon_ πconst - Whether a
DefIdis aAnonConst. An anonymous constant is generated by Rustc, hoisting every constat bits from items as separate top-level items. This AnonConst mechanism is internal to Rustc; we donβt want to reflect that, instead we prefer inlining those.is_anon_constis used to detect such AnonConst so that we can evaluate and inline them. - mplace_
to_ πraw_ bytes - The bytes of a value in memory.
- op_
to_ πconst - Use the const-eval interpreter to convert an evaluated operand back to a structured constant expression.
- op_
to_ πraw_ bytes - Read the raw bytes of an evaluated operand, keeping track of uninitialized bytes and pointer provenance. Used for values that have no structured representation (e.g. unions).
- pointee_
to_ πconst - Convert the target of a valid pointer. Pointers to globals are kept as references to these globals, and we fallback to reading the bytes for other cases.
- scalar_
int_ πto_ constant_ literal - valtree_
to_ πconstant_ expr