Re-exports§
use crate::frontend::prelude::*;🔒
Modules§
- uneval 🔒
- Translate constants to the frontend: type-system constants, and the values read by
rustc_const_uneval.
Structs§
- Constant
Expr - Rustc has different representations for constants: one for MIR
([
rustc_middle::mir::Const]), one for the type system ([rustc_middle::ty::ConstKind]). For simplicity the frontend maps those two constructs to the sameConstantExprtype. - Constant
Field Expr - Variant
Idx - The source-order index of a variant in a type.
Enums§
- Const
Source - A constant that we can ask rustc to evaluate.
- Constant
Byte - A byte of an evaluated constant, in the MiniRust sense.
- Constant
Byte Provenance - What a pointer byte in an evaluated constant points to.
- Constant
Expr Kind - The subset of expressions that corresponds to constants.
- Constant
Int - Constant
Literal - Constant
Projection Elem - Projects a place inside the pointee of a constant pointer.
- Constant
PtrBase - The place a constant pointer starts from.
- FnPtr
Target - The function a function pointer points to.
- Global
Ref - A global allocation.
- Read
Mode - How to read back an evaluated constant.
- Variant
Kind - Describe the kind of a variant
Functions§
- bits_
and_ type_ to_ float_ constant_ literal - Converts a bit-representation of a float of type
tyto a constant literal - const_
reader - The reader for constants evaluated in the current context.
- read_
const - Evaluate
srcand read it back as aConstantExpr. - scalar_
int_ to_ constant_ literal - unsizing_
metadata - The metadata of a pointer to a value of type
fromunsized to typeto.