Skip to main content

Crate rustc_const_eval

Crate rustc_const_eval 

Source

Modules§

check_consts
Check the bodies of consts, statics and const fns for illegal operations.
const_eval
errors 🔒
interpret
An interpreter for MIR used in CTFE and by miri
util

Macros§

enter_trace_span
Shorthand for calling crate::interpret::Machine::enter_trace_span on a tracing::info_span!. This is supposed to be compiled out when crate::interpret::Machine::enter_trace_span has the default implementation (i.e. when it does not actually enter the span but instead returns ()). This macro takes a type implementing the crate::interpret::Machine trait as its first argument and otherwise accepts the same syntax as tracing::span! (see some tips below). Note: the result of this macro must be used because the span is exited when it’s dropped.

Statics§

CTRL_C_RECEIVED
rustc_driver::main installs a handler that will set this to true if the compiler has been sent a request to shut down, such as by a Ctrl-C. This static lives here because it is only read by the interpreter.

Functions§

assert_typing_mode 🔒
Const eval always happens in post analysis mode in order to be able to use the hidden types of opaque types. This is needed for trivial things like size_of, but also for using associated types that are not specified in the opaque type. We also use MIR bodies whose opaque types have already been revealed, so we’d be able to at least partially observe the hidden types anyways.
provide