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 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 can be enabled with a feature gate.

Source

fn importance(&self) -> DiagImportance

Implementors§

Source§

impl<'tcx> NonConstOp<'tcx> for ConditionallyConstCall<'tcx>

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 IntrinsicNonConst

Source§

impl<'tcx> NonConstOp<'tcx> for IntrinsicUnstable

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