Module rustc_mir::transform::check_consts::ops[−][src]

Concrete error types for all operations which may be invalid in a certain const context.

Modules

ty

Structs

CellBorrow

A borrow of a type that contains an UnsafeCell 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.

FloatingPointOp
FnCallIndirect

A function call where the callee is a pointer.

FnCallNonConst

A function call where the callee is not marked as const.

FnCallUnstable

A call to a #[unstable] const fn or #[rustc_const_unstable] function.

FnPtrCast
Generator
HeapAllocation
InlineAsm
LiveDrop
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.

MutDeref
Panic
PanicNonStr

A call to a panic() lang item where the first argument is not a &str.

RawPtrComparison
RawPtrDeref
RawPtrToIntCast
StaticAccess

An access to a (non-thread-local) static.

ThreadLocalAccess

An access to a thread-local static.

TransientCellBorrow

A borrow of a type that contains an UnsafeCell somewhere. The borrow never escapes to the final value of the constant.

TransientMutBorrow
Transmute
UnionAccess
UnsizingCast

See #64992.

Enums

DiagnosticImportance
Status

Traits

NonConstOp

An operation that is not always allowed in a const context.

Functions

mcf_build_error
mcf_status_in_item