pub struct ConstOperand<'tcx> {
pub ty: Ty,
pub span: Span,
pub const_: Const<'tcx>,
}Expand description
The representation of constants in the mir is complicated. This struct is a thin wrapper around that representation. We don’t support all constants, but we ensure that at least the type of the constant is supported. Thus, we can always fallback to give a constant an unrefined type.
Fields§
§ty: TyThis is the lowered type of the constant.
NOTE: rustc_middle::mir::ConstOperand has a user_ty field. That type is
unrelated
span: Span§const_: Const<'tcx>Auto Trait Implementations§
impl<'tcx> Freeze for ConstOperand<'tcx>
impl<'tcx> !RefUnwindSafe for ConstOperand<'tcx>
impl<'tcx> Send for ConstOperand<'tcx>
impl<'tcx> Sync for ConstOperand<'tcx>
impl<'tcx> Unpin for ConstOperand<'tcx>
impl<'tcx> !UnwindSafe for ConstOperand<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more