Module consts

Source
Expand description

A simple const eval API, for use on arbitrary HIR expressions.

This cannot use rustc’s const eval, aka miri, as arbitrary HIR expressions cannot be lowered to executable MIR bodies, so we have to do this instead.

Structs§

ConstEvalCtxt
The context required to evaluate a constant expression.

Enums§

Constant
A LitKind-like enum to fold constant Exprs into.
ConstantSource
The source of a constant value.
FullInt

Traits§

IntTypeBounds 🔒

Functions§

field_of_struct 🔒
lit_to_mir_constant
Parses a LitKind to a Constant.
mir_is_empty 🔒
mir_to_const