rustc_const_eval::check_consts::ops

Trait NonConstOp

source
pub trait NonConstOp<'tcx>: Debug {
    // Required method
    fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> Diag<'tcx>;

    // Provided methods
    fn status_in_item(&self, _ccx: &ConstCx<'_, 'tcx>) -> Status { ... }
    fn importance(&self) -> DiagImportance { ... }
}
Expand description

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

Required Methods§

source

fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> Diag<'tcx>

Provided Methods§

source

fn status_in_item(&self, _ccx: &ConstCx<'_, 'tcx>) -> Status

Returns an enum indicating whether this operation is allowed within the given item.

source

fn importance(&self) -> DiagImportance

Implementors§

source§

impl<'tcx> NonConstOp<'tcx> for Coroutine

source§

impl<'tcx> NonConstOp<'tcx> for EscapingCellBorrow

source§

impl<'tcx> NonConstOp<'tcx> for EscapingMutBorrow

source§

impl<'tcx> NonConstOp<'tcx> for FnCallIndirect

source§

impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx>

source§

impl<'tcx> NonConstOp<'tcx> for FnCallUnstable

source§

impl<'tcx> NonConstOp<'tcx> for HeapAllocation

source§

impl<'tcx> NonConstOp<'tcx> for InlineAsm

source§

impl<'tcx> NonConstOp<'tcx> for LiveDrop<'tcx>

source§

impl<'tcx> NonConstOp<'tcx> for PanicNonStr

source§

impl<'tcx> NonConstOp<'tcx> for RawPtrComparison

source§

impl<'tcx> NonConstOp<'tcx> for RawPtrToIntCast

source§

impl<'tcx> NonConstOp<'tcx> for ThreadLocalAccess