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

    // Provided methods
    fn status_in_item(&self, _ccx: &ConstCx<'_, 'tcx>) -> Status { ... }
    fn importance(&self) -> DiagnosticImportance { ... }
}
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 ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>

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) -> DiagnosticImportance

Implementors§

source§

impl<'tcx> NonConstOp<'tcx> for CellBorrow

source§

impl<'tcx> NonConstOp<'tcx> for FloatingPointOp

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 Generator

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 MutBorrow

source§

impl<'tcx> NonConstOp<'tcx> for MutDeref

source§

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

source§

impl<'tcx> NonConstOp<'tcx> for RawMutPtrDeref

source§

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

source§

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

source§

impl<'tcx> NonConstOp<'tcx> for StaticAccess

source§

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

source§

impl<'tcx> NonConstOp<'tcx> for TransientCellBorrow

source§

impl<'tcx> NonConstOp<'tcx> for TransientMutBorrow

source§

impl<'tcx> NonConstOp<'tcx> for MutRef