Skip to main content

Module uneval

Module uneval 

Source
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 ty to 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 DefId is a AnonConst. 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_const is 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 πŸ”’