Expand description
Concrete error types for all operations which may be invalid in a certain const context.
Structs§
- Coroutine π
- Escaping
Cell πBorrow A borrow of a type that contains anUnsafeCell
somewhere. The borrow might escape to the final value of the constant, and thus we cannot allow this (for now). We may allow it in the future for static items. - Escaping
MutBorrow πThis op is for&mut
borrows in the trailing expression of a constant which uses the βenclosing scopes ruleβ to leak its locals into anonymous static or const items. - FnCall
Indirect πA function call where the callee is a pointer. - FnCall
NonConst πA function call where the callee is not marked asconst
. - FnCall
Unstable πA call to an#[unstable]
const fn or#[rustc_const_unstable]
function. - Heap
Allocation π - Inline
Asm π - Live
Drop π - Panic
NonStr πA call to apanic()
lang item where the first argument is not a&str
. - RawPtr
Comparison πComparing raw pointers for equality. Not currently intended to ever be allowed, even behind a feature gate: operation depends on allocation base addresses that are not known at compile-time. - RawPtr
ToInt πCast Casting raw pointer or function pointer to an integer. Not currently intended to ever be allowed, even behind a feature gate: operation depends on allocation base addresses that are not known at compile-time. - Thread
Local πAccess An access to a thread-localstatic
.
Enums§
Traits§
- An operation that is not always allowed in a const context.