struct Validator<'a, 'tcx> {
    ccx: &'a ConstCx<'a, 'tcx>,
    temps: &'a mut IndexSlice<Local, TempState>,
}
Expand description

Checks whether locals that appear in a promotion context (Candidate) are actually promotable.

This wraps an Item, and has access to all fields of that Item via Deref coercion.

Fields§

§ccx: &'a ConstCx<'a, 'tcx>§temps: &'a mut IndexSlice<Local, TempState>

Implementations§

source§

impl<'tcx> Validator<'_, 'tcx>

source

fn validate_candidate( &mut self, candidate: Candidate ) -> Result<(), Unpromotable>

source

fn qualif_local<Q: Qualif>(&mut self, local: Local) -> bool

source

fn validate_local(&mut self, local: Local) -> Result<(), Unpromotable>

source

fn validate_place(&mut self, place: PlaceRef<'tcx>) -> Result<(), Unpromotable>

source

fn validate_operand( &mut self, operand: &Operand<'tcx> ) -> Result<(), Unpromotable>

source

fn validate_ref( &mut self, kind: BorrowKind, place: &Place<'tcx> ) -> Result<(), Unpromotable>

source

fn validate_rvalue(&mut self, rvalue: &Rvalue<'tcx>) -> Result<(), Unpromotable>

source

fn validate_call( &mut self, callee: &Operand<'tcx>, args: &[Operand<'tcx>] ) -> Result<(), Unpromotable>

Methods from Deref<Target = ConstCx<'a, 'tcx>>§

source

pub fn def_id(&self) -> LocalDefId

source

pub fn const_kind(&self) -> ConstContext

Returns the kind of const context this Item represents (const, static, etc.).

Panics if this Item is not const.

source

pub fn is_const_stable_const_fn(&self) -> bool

source

fn is_async(&self) -> bool

source

pub fn fn_sig(&self) -> PolyFnSig<'tcx>

Trait Implementations§

source§

impl<'a, 'tcx> Deref for Validator<'a, 'tcx>

§

type Target = ConstCx<'a, 'tcx>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, 'tcx> !RefUnwindSafe for Validator<'a, 'tcx>

§

impl<'a, 'tcx> !Send for Validator<'a, 'tcx>

§

impl<'a, 'tcx> !Sync for Validator<'a, 'tcx>

§

impl<'a, 'tcx> Unpin for Validator<'a, 'tcx>

§

impl<'a, 'tcx> !UnwindSafe for Validator<'a, 'tcx>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes