Skip to main content

ConstantExprKind

Enum ConstantExprKind 

Source
pub enum ConstantExprKind {
Show 28 variants Bool(bool), Integer(IntegerValue), Char(char), Float(FloatValue), Adt(Option<VariantId>, IndexVec<FieldId, ConstantExpr>), Array(Vec<ConstantExpr>), Ref(GlobalPlace, Option<UnsizingMetadata>), Ptr(RefKind, GlobalPlace, Option<UnsizingMetadata>), Str(String), ByteStr(Vec<u8>), FnDef(FnPtr), FnPtr(FnPtr), Cast(ConstantExpr, CastKind), PtrNoProvenance(u128), ExternSymbol(String), TypeId(Ty), RawMemory(Vec<Byte>), Var(ConstGenericDbVar), Global(GlobalDeclRef), Call(FnPtr, Vec<ConstantExpr>), TraitConst(TraitRef, AssocConstId), VTableRef(PolyTraitRef), Discriminant(TypeDeclRef, VariantId), Repeat { value: ConstantExpr, count: ConstantExpr, value_is_sized: Option<TraitRef>, }, SizeOf(Ty), AlignOf(Ty), OffsetOf(TypeDeclRef, Option<VariantId>, FieldId), Opaque(String),
}

Variants§

§

Bool(bool)

Boolean value.

§

Integer(IntegerValue)

Integer value.

§

Char(char)

Char value.

§

Float(FloatValue)

Float value.

§

Adt(Option<VariantId>, IndexVec<FieldId, ConstantExpr>)

Value of an ADT (struct or enum).

This is eliminated inside functions if --raw-consts is off.

§

Array(Vec<ConstantExpr>)

Array value.

This is eliminated inside functions if --raw-consts is off.

§

Ref(GlobalPlace, Option<UnsizingMetadata>)

A shared reference to a constant place.

This is eliminated inside functions if --raw-consts is off.

§

Ptr(RefKind, GlobalPlace, Option<UnsizingMetadata>)

A raw pointer to a constant place.

This is eliminated inside functions if --raw-consts is off.

§

Str(String)

str value. This represents an unsized value of type str (and not &str).

§

ByteStr(Vec<u8>)

Byte string value.

§

FnDef(FnPtr)

ZST constant corresponding to the unique value of the type of a function item.

§

FnPtr(FnPtr)

A function pointer value; this is a pointer (i.e. an address).

This is eliminated inside functions if --raw-consts is off.

§

Cast(ConstantExpr, CastKind)

Cast a constant value to another type (e.g. erase a vtable method pointer to *const ()).

§

PtrNoProvenance(u128)

A pointer with no provenance (e.g. 0 for the null pointer)

This is eliminated inside functions if --raw-consts is off.

§

ExternSymbol(String)

The address of a linker symbol, as a *const (). The address may be null, if the symbol wasn’t defined at link time.

§

TypeId(Ty)

The TypeId value for a type.

§

RawMemory(Vec<Byte>)

Raw memory value obtained from constant evaluation. Used when a more structured representation isn’t possible (e.g. for unions) or just isn’t implemented yet.

§

Var(ConstGenericDbVar)

A const generic var

§

Global(GlobalDeclRef)

The value of a constant/static.

This is eliminated inside functions if --raw-consts is off.

§

Call(FnPtr, Vec<ConstantExpr>)

A call to a const fn.

§

TraitConst(TraitRef, AssocConstId)

A trait associated constant.

E.g.:

impl Foo for Bar {
  const C : usize = 32; // <-
}
§

VTableRef(PolyTraitRef)

A reference to the vtable static item for this trait ref. This can be normalized if we emitted a vtable item.

This is eliminated if --raw-consts is off.

§

Discriminant(TypeDeclRef, VariantId)

The integer discriminant value corresponding to this enum variant.

§

Repeat

Make an array of count copies of value. value does not need to be Copy or Clone.

Fields

§value_is_sized: Option<TraitRef>

Proof that the element type is Sized; absent with --hide-marker-traits.

§

SizeOf(Ty)

The size of the given type.

§

AlignOf(Ty)

The alignment of the given type.

§

OffsetOf(TypeDeclRef, Option<VariantId>, FieldId)

The offset of the given field.

§

Opaque(String)

A constant expression that Charon doesn’t handle, along with the reason why.

Implementations§

Source§

impl ConstantExprKind

Source

pub fn is_bool(&self) -> bool

Returns true if this is a ConstantExprKind::Bool, otherwise false

Source

pub fn as_bool_mut(&mut self) -> Option<&mut bool>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Bool, otherwise None

Source

pub fn as_bool(&self) -> Option<&bool>

Optionally returns references to the inner fields if this is a ConstantExprKind::Bool, otherwise None

Source

pub fn into_bool(self) -> Result<bool, Self>

Returns the inner fields if this is a ConstantExprKind::Bool, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_bool_unchecked(self) -> bool

Unchecked return of the inner fields of ConstantExprKind::Bool.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_bool_unchecked(&self) -> &bool

Unchecked reference of the inner fields of ConstantExprKind::Bool.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_bool_mut_unchecked(&mut self) -> &mut bool

Unchecked mutable reference of the inner fields of ConstantExprKind::Bool.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_integer(&self) -> bool

Returns true if this is a ConstantExprKind::Integer, otherwise false

Source

pub fn as_integer_mut(&mut self) -> Option<&mut IntegerValue>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Integer, otherwise None

Source

pub fn as_integer(&self) -> Option<&IntegerValue>

Optionally returns references to the inner fields if this is a ConstantExprKind::Integer, otherwise None

Source

pub fn into_integer(self) -> Result<IntegerValue, Self>

Returns the inner fields if this is a ConstantExprKind::Integer, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_integer_unchecked(self) -> IntegerValue

Unchecked return of the inner fields of ConstantExprKind::Integer.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_integer_unchecked(&self) -> &IntegerValue

Unchecked reference of the inner fields of ConstantExprKind::Integer.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_integer_mut_unchecked(&mut self) -> &mut IntegerValue

Unchecked mutable reference of the inner fields of ConstantExprKind::Integer.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_char(&self) -> bool

Returns true if this is a ConstantExprKind::Char, otherwise false

Source

pub fn as_char_mut(&mut self) -> Option<&mut char>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Char, otherwise None

Source

pub fn as_char(&self) -> Option<&char>

Optionally returns references to the inner fields if this is a ConstantExprKind::Char, otherwise None

Source

pub fn into_char(self) -> Result<char, Self>

Returns the inner fields if this is a ConstantExprKind::Char, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_char_unchecked(self) -> char

Unchecked return of the inner fields of ConstantExprKind::Char.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_char_unchecked(&self) -> &char

Unchecked reference of the inner fields of ConstantExprKind::Char.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_char_mut_unchecked(&mut self) -> &mut char

Unchecked mutable reference of the inner fields of ConstantExprKind::Char.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_float(&self) -> bool

Returns true if this is a ConstantExprKind::Float, otherwise false

Source

pub fn as_float_mut(&mut self) -> Option<&mut FloatValue>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Float, otherwise None

Source

pub fn as_float(&self) -> Option<&FloatValue>

Optionally returns references to the inner fields if this is a ConstantExprKind::Float, otherwise None

Source

pub fn into_float(self) -> Result<FloatValue, Self>

Returns the inner fields if this is a ConstantExprKind::Float, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_float_unchecked(self) -> FloatValue

Unchecked return of the inner fields of ConstantExprKind::Float.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_float_unchecked(&self) -> &FloatValue

Unchecked reference of the inner fields of ConstantExprKind::Float.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_float_mut_unchecked(&mut self) -> &mut FloatValue

Unchecked mutable reference of the inner fields of ConstantExprKind::Float.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_adt(&self) -> bool

Returns true if this is a ConstantExprKind::Adt, otherwise false

Source

pub fn as_adt_mut( &mut self, ) -> Option<(&mut Option<VariantId>, &mut IndexVec<FieldId, ConstantExpr>)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Adt, otherwise None

Source

pub fn as_adt( &self, ) -> Option<(&Option<VariantId>, &IndexVec<FieldId, ConstantExpr>)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Adt, otherwise None

Source

pub fn into_adt( self, ) -> Result<(Option<VariantId>, IndexVec<FieldId, ConstantExpr>), Self>

Returns the inner fields if this is a ConstantExprKind::Adt, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_adt_unchecked( self, ) -> (Option<VariantId>, IndexVec<FieldId, ConstantExpr>)

Unchecked return of the inner fields of ConstantExprKind::Adt.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_adt_unchecked( &self, ) -> (&Option<VariantId>, &IndexVec<FieldId, ConstantExpr>)

Unchecked reference of the inner fields of ConstantExprKind::Adt.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_adt_mut_unchecked( &mut self, ) -> (&mut Option<VariantId>, &mut IndexVec<FieldId, ConstantExpr>)

Unchecked mutable reference of the inner fields of ConstantExprKind::Adt.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_array(&self) -> bool

Returns true if this is a ConstantExprKind::Array, otherwise false

Source

pub fn as_array_mut(&mut self) -> Option<&mut Vec<ConstantExpr>>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Array, otherwise None

Source

pub fn as_array(&self) -> Option<&Vec<ConstantExpr>>

Optionally returns references to the inner fields if this is a ConstantExprKind::Array, otherwise None

Source

pub fn into_array(self) -> Result<Vec<ConstantExpr>, Self>

Returns the inner fields if this is a ConstantExprKind::Array, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_array_unchecked(self) -> Vec<ConstantExpr>

Unchecked return of the inner fields of ConstantExprKind::Array.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_array_unchecked(&self) -> &Vec<ConstantExpr>

Unchecked reference of the inner fields of ConstantExprKind::Array.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_array_mut_unchecked(&mut self) -> &mut Vec<ConstantExpr>

Unchecked mutable reference of the inner fields of ConstantExprKind::Array.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_ref(&self) -> bool

Returns true if this is a ConstantExprKind::Ref, otherwise false

Source

pub fn as_ref_mut( &mut self, ) -> Option<(&mut GlobalPlace, &mut Option<UnsizingMetadata>)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Ref, otherwise None

Source

pub fn as_ref(&self) -> Option<(&GlobalPlace, &Option<UnsizingMetadata>)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Ref, otherwise None

Source

pub fn into_ref(self) -> Result<(GlobalPlace, Option<UnsizingMetadata>), Self>

Returns the inner fields if this is a ConstantExprKind::Ref, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_ref_unchecked( self, ) -> (GlobalPlace, Option<UnsizingMetadata>)

Unchecked return of the inner fields of ConstantExprKind::Ref.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ref_unchecked( &self, ) -> (&GlobalPlace, &Option<UnsizingMetadata>)

Unchecked reference of the inner fields of ConstantExprKind::Ref.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ref_mut_unchecked( &mut self, ) -> (&mut GlobalPlace, &mut Option<UnsizingMetadata>)

Unchecked mutable reference of the inner fields of ConstantExprKind::Ref.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_ptr(&self) -> bool

Returns true if this is a ConstantExprKind::Ptr, otherwise false

Source

pub fn as_ptr_mut( &mut self, ) -> Option<(&mut RefKind, &mut GlobalPlace, &mut Option<UnsizingMetadata>)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Ptr, otherwise None

Source

pub fn as_ptr( &self, ) -> Option<(&RefKind, &GlobalPlace, &Option<UnsizingMetadata>)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Ptr, otherwise None

Source

pub fn into_ptr( self, ) -> Result<(RefKind, GlobalPlace, Option<UnsizingMetadata>), Self>

Returns the inner fields if this is a ConstantExprKind::Ptr, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_ptr_unchecked( self, ) -> (RefKind, GlobalPlace, Option<UnsizingMetadata>)

Unchecked return of the inner fields of ConstantExprKind::Ptr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ptr_unchecked( &self, ) -> (&RefKind, &GlobalPlace, &Option<UnsizingMetadata>)

Unchecked reference of the inner fields of ConstantExprKind::Ptr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ptr_mut_unchecked( &mut self, ) -> (&mut RefKind, &mut GlobalPlace, &mut Option<UnsizingMetadata>)

Unchecked mutable reference of the inner fields of ConstantExprKind::Ptr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_str(&self) -> bool

Returns true if this is a ConstantExprKind::Str, otherwise false

Source

pub fn as_str_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Str, otherwise None

Source

pub fn as_str(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a ConstantExprKind::Str, otherwise None

Source

pub fn into_str(self) -> Result<String, Self>

Returns the inner fields if this is a ConstantExprKind::Str, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_str_unchecked(self) -> String

Unchecked return of the inner fields of ConstantExprKind::Str.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_str_unchecked(&self) -> &String

Unchecked reference of the inner fields of ConstantExprKind::Str.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_str_mut_unchecked(&mut self) -> &mut String

Unchecked mutable reference of the inner fields of ConstantExprKind::Str.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_byte_str(&self) -> bool

Returns true if this is a ConstantExprKind::ByteStr, otherwise false

Source

pub fn as_byte_str_mut(&mut self) -> Option<&mut Vec<u8>>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::ByteStr, otherwise None

Source

pub fn as_byte_str(&self) -> Option<&Vec<u8>>

Optionally returns references to the inner fields if this is a ConstantExprKind::ByteStr, otherwise None

Source

pub fn into_byte_str(self) -> Result<Vec<u8>, Self>

Returns the inner fields if this is a ConstantExprKind::ByteStr, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_byte_str_unchecked(self) -> Vec<u8> ⓘ

Unchecked return of the inner fields of ConstantExprKind::ByteStr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_byte_str_unchecked(&self) -> &Vec<u8> ⓘ

Unchecked reference of the inner fields of ConstantExprKind::ByteStr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_byte_str_mut_unchecked(&mut self) -> &mut Vec<u8> ⓘ

Unchecked mutable reference of the inner fields of ConstantExprKind::ByteStr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_fn_def(&self) -> bool

Returns true if this is a ConstantExprKind::FnDef, otherwise false

Source

pub fn as_fn_def_mut(&mut self) -> Option<&mut FnPtr>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::FnDef, otherwise None

Source

pub fn as_fn_def(&self) -> Option<&FnPtr>

Optionally returns references to the inner fields if this is a ConstantExprKind::FnDef, otherwise None

Source

pub fn into_fn_def(self) -> Result<FnPtr, Self>

Returns the inner fields if this is a ConstantExprKind::FnDef, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_fn_def_unchecked(self) -> FnPtr

Unchecked return of the inner fields of ConstantExprKind::FnDef.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_def_unchecked(&self) -> &FnPtr

Unchecked reference of the inner fields of ConstantExprKind::FnDef.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_def_mut_unchecked(&mut self) -> &mut FnPtr

Unchecked mutable reference of the inner fields of ConstantExprKind::FnDef.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_fn_ptr(&self) -> bool

Returns true if this is a ConstantExprKind::FnPtr, otherwise false

Source

pub fn as_fn_ptr_mut(&mut self) -> Option<&mut FnPtr>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::FnPtr, otherwise None

Source

pub fn as_fn_ptr(&self) -> Option<&FnPtr>

Optionally returns references to the inner fields if this is a ConstantExprKind::FnPtr, otherwise None

Source

pub fn into_fn_ptr(self) -> Result<FnPtr, Self>

Returns the inner fields if this is a ConstantExprKind::FnPtr, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_fn_ptr_unchecked(self) -> FnPtr

Unchecked return of the inner fields of ConstantExprKind::FnPtr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_ptr_unchecked(&self) -> &FnPtr

Unchecked reference of the inner fields of ConstantExprKind::FnPtr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_ptr_mut_unchecked(&mut self) -> &mut FnPtr

Unchecked mutable reference of the inner fields of ConstantExprKind::FnPtr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_cast(&self) -> bool

Returns true if this is a ConstantExprKind::Cast, otherwise false

Source

pub fn as_cast_mut(&mut self) -> Option<(&mut ConstantExpr, &mut CastKind)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Cast, otherwise None

Source

pub fn as_cast(&self) -> Option<(&ConstantExpr, &CastKind)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Cast, otherwise None

Source

pub fn into_cast(self) -> Result<(ConstantExpr, CastKind), Self>

Returns the inner fields if this is a ConstantExprKind::Cast, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_cast_unchecked(self) -> (ConstantExpr, CastKind)

Unchecked return of the inner fields of ConstantExprKind::Cast.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_cast_unchecked(&self) -> (&ConstantExpr, &CastKind)

Unchecked reference of the inner fields of ConstantExprKind::Cast.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_cast_mut_unchecked( &mut self, ) -> (&mut ConstantExpr, &mut CastKind)

Unchecked mutable reference of the inner fields of ConstantExprKind::Cast.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_ptr_no_provenance(&self) -> bool

Returns true if this is a ConstantExprKind::PtrNoProvenance, otherwise false

Source

pub fn as_ptr_no_provenance_mut(&mut self) -> Option<&mut u128>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::PtrNoProvenance, otherwise None

Source

pub fn as_ptr_no_provenance(&self) -> Option<&u128>

Optionally returns references to the inner fields if this is a ConstantExprKind::PtrNoProvenance, otherwise None

Source

pub fn into_ptr_no_provenance(self) -> Result<u128, Self>

Returns the inner fields if this is a ConstantExprKind::PtrNoProvenance, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_ptr_no_provenance_unchecked(self) -> u128

Unchecked return of the inner fields of ConstantExprKind::PtrNoProvenance.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ptr_no_provenance_unchecked(&self) -> &u128

Unchecked reference of the inner fields of ConstantExprKind::PtrNoProvenance.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ptr_no_provenance_mut_unchecked(&mut self) -> &mut u128

Unchecked mutable reference of the inner fields of ConstantExprKind::PtrNoProvenance.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_extern_symbol(&self) -> bool

Returns true if this is a ConstantExprKind::ExternSymbol, otherwise false

Source

pub fn as_extern_symbol_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::ExternSymbol, otherwise None

Source

pub fn as_extern_symbol(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a ConstantExprKind::ExternSymbol, otherwise None

Source

pub fn into_extern_symbol(self) -> Result<String, Self>

Returns the inner fields if this is a ConstantExprKind::ExternSymbol, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_extern_symbol_unchecked(self) -> String

Unchecked return of the inner fields of ConstantExprKind::ExternSymbol.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_extern_symbol_unchecked(&self) -> &String

Unchecked reference of the inner fields of ConstantExprKind::ExternSymbol.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_extern_symbol_mut_unchecked(&mut self) -> &mut String

Unchecked mutable reference of the inner fields of ConstantExprKind::ExternSymbol.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_type_id(&self) -> bool

Returns true if this is a ConstantExprKind::TypeId, otherwise false

Source

pub fn as_type_id_mut(&mut self) -> Option<&mut Ty>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::TypeId, otherwise None

Source

pub fn as_type_id(&self) -> Option<&Ty>

Optionally returns references to the inner fields if this is a ConstantExprKind::TypeId, otherwise None

Source

pub fn into_type_id(self) -> Result<Ty, Self>

Returns the inner fields if this is a ConstantExprKind::TypeId, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_type_id_unchecked(self) -> Ty

Unchecked return of the inner fields of ConstantExprKind::TypeId.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_type_id_unchecked(&self) -> &Ty

Unchecked reference of the inner fields of ConstantExprKind::TypeId.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_type_id_mut_unchecked(&mut self) -> &mut Ty

Unchecked mutable reference of the inner fields of ConstantExprKind::TypeId.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_raw_memory(&self) -> bool

Returns true if this is a ConstantExprKind::RawMemory, otherwise false

Source

pub fn as_raw_memory_mut(&mut self) -> Option<&mut Vec<Byte>>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::RawMemory, otherwise None

Source

pub fn as_raw_memory(&self) -> Option<&Vec<Byte>>

Optionally returns references to the inner fields if this is a ConstantExprKind::RawMemory, otherwise None

Source

pub fn into_raw_memory(self) -> Result<Vec<Byte>, Self>

Returns the inner fields if this is a ConstantExprKind::RawMemory, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_raw_memory_unchecked(self) -> Vec<Byte>

Unchecked return of the inner fields of ConstantExprKind::RawMemory.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_raw_memory_unchecked(&self) -> &Vec<Byte>

Unchecked reference of the inner fields of ConstantExprKind::RawMemory.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_raw_memory_mut_unchecked(&mut self) -> &mut Vec<Byte>

Unchecked mutable reference of the inner fields of ConstantExprKind::RawMemory.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_var(&self) -> bool

Returns true if this is a ConstantExprKind::Var, otherwise false

Source

pub fn as_var_mut(&mut self) -> Option<&mut ConstGenericDbVar>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Var, otherwise None

Source

pub fn as_var(&self) -> Option<&ConstGenericDbVar>

Optionally returns references to the inner fields if this is a ConstantExprKind::Var, otherwise None

Source

pub fn into_var(self) -> Result<ConstGenericDbVar, Self>

Returns the inner fields if this is a ConstantExprKind::Var, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_var_unchecked(self) -> ConstGenericDbVar

Unchecked return of the inner fields of ConstantExprKind::Var.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_var_unchecked(&self) -> &ConstGenericDbVar

Unchecked reference of the inner fields of ConstantExprKind::Var.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_var_mut_unchecked(&mut self) -> &mut ConstGenericDbVar

Unchecked mutable reference of the inner fields of ConstantExprKind::Var.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_global(&self) -> bool

Returns true if this is a ConstantExprKind::Global, otherwise false

Source

pub fn as_global_mut(&mut self) -> Option<&mut GlobalDeclRef>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Global, otherwise None

Source

pub fn as_global(&self) -> Option<&GlobalDeclRef>

Optionally returns references to the inner fields if this is a ConstantExprKind::Global, otherwise None

Source

pub fn into_global(self) -> Result<GlobalDeclRef, Self>

Returns the inner fields if this is a ConstantExprKind::Global, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_global_unchecked(self) -> GlobalDeclRef

Unchecked return of the inner fields of ConstantExprKind::Global.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_global_unchecked(&self) -> &GlobalDeclRef

Unchecked reference of the inner fields of ConstantExprKind::Global.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_global_mut_unchecked(&mut self) -> &mut GlobalDeclRef

Unchecked mutable reference of the inner fields of ConstantExprKind::Global.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_call(&self) -> bool

Returns true if this is a ConstantExprKind::Call, otherwise false

Source

pub fn as_call_mut(&mut self) -> Option<(&mut FnPtr, &mut Vec<ConstantExpr>)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Call, otherwise None

Source

pub fn as_call(&self) -> Option<(&FnPtr, &Vec<ConstantExpr>)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Call, otherwise None

Source

pub fn into_call(self) -> Result<(FnPtr, Vec<ConstantExpr>), Self>

Returns the inner fields if this is a ConstantExprKind::Call, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_call_unchecked(self) -> (FnPtr, Vec<ConstantExpr>)

Unchecked return of the inner fields of ConstantExprKind::Call.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_call_unchecked(&self) -> (&FnPtr, &Vec<ConstantExpr>)

Unchecked reference of the inner fields of ConstantExprKind::Call.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_call_mut_unchecked( &mut self, ) -> (&mut FnPtr, &mut Vec<ConstantExpr>)

Unchecked mutable reference of the inner fields of ConstantExprKind::Call.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_trait_const(&self) -> bool

Returns true if this is a ConstantExprKind::TraitConst, otherwise false

Source

pub fn as_trait_const_mut( &mut self, ) -> Option<(&mut TraitRef, &mut AssocConstId)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::TraitConst, otherwise None

Source

pub fn as_trait_const(&self) -> Option<(&TraitRef, &AssocConstId)>

Optionally returns references to the inner fields if this is a ConstantExprKind::TraitConst, otherwise None

Source

pub fn into_trait_const(self) -> Result<(TraitRef, AssocConstId), Self>

Returns the inner fields if this is a ConstantExprKind::TraitConst, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_trait_const_unchecked(self) -> (TraitRef, AssocConstId)

Unchecked return of the inner fields of ConstantExprKind::TraitConst.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_const_unchecked(&self) -> (&TraitRef, &AssocConstId)

Unchecked reference of the inner fields of ConstantExprKind::TraitConst.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_const_mut_unchecked( &mut self, ) -> (&mut TraitRef, &mut AssocConstId)

Unchecked mutable reference of the inner fields of ConstantExprKind::TraitConst.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_v_table_ref(&self) -> bool

Returns true if this is a ConstantExprKind::VTableRef, otherwise false

Source

pub fn as_v_table_ref_mut(&mut self) -> Option<&mut PolyTraitRef>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::VTableRef, otherwise None

Source

pub fn as_v_table_ref(&self) -> Option<&PolyTraitRef>

Optionally returns references to the inner fields if this is a ConstantExprKind::VTableRef, otherwise None

Source

pub fn into_v_table_ref(self) -> Result<PolyTraitRef, Self>

Returns the inner fields if this is a ConstantExprKind::VTableRef, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_v_table_ref_unchecked(self) -> PolyTraitRef

Unchecked return of the inner fields of ConstantExprKind::VTableRef.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_v_table_ref_unchecked(&self) -> &PolyTraitRef

Unchecked reference of the inner fields of ConstantExprKind::VTableRef.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_v_table_ref_mut_unchecked(&mut self) -> &mut PolyTraitRef

Unchecked mutable reference of the inner fields of ConstantExprKind::VTableRef.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_discriminant(&self) -> bool

Returns true if this is a ConstantExprKind::Discriminant, otherwise false

Source

pub fn as_discriminant_mut( &mut self, ) -> Option<(&mut TypeDeclRef, &mut VariantId)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Discriminant, otherwise None

Source

pub fn as_discriminant(&self) -> Option<(&TypeDeclRef, &VariantId)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Discriminant, otherwise None

Source

pub fn into_discriminant(self) -> Result<(TypeDeclRef, VariantId), Self>

Returns the inner fields if this is a ConstantExprKind::Discriminant, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_discriminant_unchecked(self) -> (TypeDeclRef, VariantId)

Unchecked return of the inner fields of ConstantExprKind::Discriminant.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_discriminant_unchecked(&self) -> (&TypeDeclRef, &VariantId)

Unchecked reference of the inner fields of ConstantExprKind::Discriminant.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_discriminant_mut_unchecked( &mut self, ) -> (&mut TypeDeclRef, &mut VariantId)

Unchecked mutable reference of the inner fields of ConstantExprKind::Discriminant.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_repeat(&self) -> bool

Returns true if this is a ConstantExprKind::Repeat, otherwise false

Source

pub fn as_repeat_mut( &mut self, ) -> Option<(&mut ConstantExpr, &mut ConstantExpr, &mut Option<TraitRef>)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Repeat, otherwise None

Source

pub fn as_repeat( &self, ) -> Option<(&ConstantExpr, &ConstantExpr, &Option<TraitRef>)>

Optionally returns references to the inner fields if this is a ConstantExprKind::Repeat, otherwise None

Source

pub fn into_repeat( self, ) -> Result<(ConstantExpr, ConstantExpr, Option<TraitRef>), Self>

Returns the inner fields if this is a ConstantExprKind::Repeat, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_repeat_unchecked( self, ) -> (ConstantExpr, ConstantExpr, Option<TraitRef>)

Unchecked return of the inner fields of ConstantExprKind::Repeat.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_repeat_unchecked( &self, ) -> (&ConstantExpr, &ConstantExpr, &Option<TraitRef>)

Unchecked reference of the inner fields of ConstantExprKind::Repeat.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_repeat_mut_unchecked( &mut self, ) -> (&mut ConstantExpr, &mut ConstantExpr, &mut Option<TraitRef>)

Unchecked mutable reference of the inner fields of ConstantExprKind::Repeat.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_size_of(&self) -> bool

Returns true if this is a ConstantExprKind::SizeOf, otherwise false

Source

pub fn as_size_of_mut(&mut self) -> Option<&mut Ty>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::SizeOf, otherwise None

Source

pub fn as_size_of(&self) -> Option<&Ty>

Optionally returns references to the inner fields if this is a ConstantExprKind::SizeOf, otherwise None

Source

pub fn into_size_of(self) -> Result<Ty, Self>

Returns the inner fields if this is a ConstantExprKind::SizeOf, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_size_of_unchecked(self) -> Ty

Unchecked return of the inner fields of ConstantExprKind::SizeOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_size_of_unchecked(&self) -> &Ty

Unchecked reference of the inner fields of ConstantExprKind::SizeOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_size_of_mut_unchecked(&mut self) -> &mut Ty

Unchecked mutable reference of the inner fields of ConstantExprKind::SizeOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_align_of(&self) -> bool

Returns true if this is a ConstantExprKind::AlignOf, otherwise false

Source

pub fn as_align_of_mut(&mut self) -> Option<&mut Ty>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::AlignOf, otherwise None

Source

pub fn as_align_of(&self) -> Option<&Ty>

Optionally returns references to the inner fields if this is a ConstantExprKind::AlignOf, otherwise None

Source

pub fn into_align_of(self) -> Result<Ty, Self>

Returns the inner fields if this is a ConstantExprKind::AlignOf, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_align_of_unchecked(self) -> Ty

Unchecked return of the inner fields of ConstantExprKind::AlignOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_align_of_unchecked(&self) -> &Ty

Unchecked reference of the inner fields of ConstantExprKind::AlignOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_align_of_mut_unchecked(&mut self) -> &mut Ty

Unchecked mutable reference of the inner fields of ConstantExprKind::AlignOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_offset_of(&self) -> bool

Returns true if this is a ConstantExprKind::OffsetOf, otherwise false

Source

pub fn as_offset_of_mut( &mut self, ) -> Option<(&mut TypeDeclRef, &mut Option<VariantId>, &mut FieldId)>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::OffsetOf, otherwise None

Source

pub fn as_offset_of( &self, ) -> Option<(&TypeDeclRef, &Option<VariantId>, &FieldId)>

Optionally returns references to the inner fields if this is a ConstantExprKind::OffsetOf, otherwise None

Source

pub fn into_offset_of( self, ) -> Result<(TypeDeclRef, Option<VariantId>, FieldId), Self>

Returns the inner fields if this is a ConstantExprKind::OffsetOf, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_offset_of_unchecked( self, ) -> (TypeDeclRef, Option<VariantId>, FieldId)

Unchecked return of the inner fields of ConstantExprKind::OffsetOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_offset_of_unchecked( &self, ) -> (&TypeDeclRef, &Option<VariantId>, &FieldId)

Unchecked reference of the inner fields of ConstantExprKind::OffsetOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_offset_of_mut_unchecked( &mut self, ) -> (&mut TypeDeclRef, &mut Option<VariantId>, &mut FieldId)

Unchecked mutable reference of the inner fields of ConstantExprKind::OffsetOf.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_opaque(&self) -> bool

Returns true if this is a ConstantExprKind::Opaque, otherwise false

Source

pub fn as_opaque_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Opaque, otherwise None

Source

pub fn as_opaque(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a ConstantExprKind::Opaque, otherwise None

Source

pub fn into_opaque(self) -> Result<String, Self>

Returns the inner fields if this is a ConstantExprKind::Opaque, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_opaque_unchecked(self) -> String

Unchecked return of the inner fields of ConstantExprKind::Opaque.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_opaque_unchecked(&self) -> &String

Unchecked reference of the inner fields of ConstantExprKind::Opaque.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_opaque_mut_unchecked(&mut self) -> &mut String

Unchecked mutable reference of the inner fields of ConstantExprKind::Opaque.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source§

impl ConstantExprKind

Source

pub fn from_bits(scalar_ty: &ScalarTy, bits: u128) -> Option<Self>

Trait Implementations§

Source§

impl AstVisitable for ConstantExprKind

Source§

fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn name(&self) -> &'static str

The name of the type, used for debug logging.
Source§

fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))
where Self: Sized,

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))
where Self: Sized,

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

impl Clone for ConstantExprKind

Source§

fn clone(&self) -> ConstantExprKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConstantExprKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, __State: ?Sized> DeserializeState<'de, __State> for ConstantExprKind
where bool: DeserializeState<'de, __State>, IntegerValue: Deserialize<'de>, char: DeserializeState<'de, __State>, FloatValue: Deserialize<'de>, Option<VariantId>: DeserializeState<'de, __State>, IndexVec<FieldId, ConstantExpr>: DeserializeState<'de, __State>, Vec<ConstantExpr>: DeserializeState<'de, __State>, GlobalPlace: DeserializeState<'de, __State>, Option<UnsizingMetadata>: DeserializeState<'de, __State>, RefKind: DeserializeState<'de, __State>, String: DeserializeState<'de, __State>, Vec<u8>: DeserializeState<'de, __State>, FnPtr: DeserializeState<'de, __State>, ConstantExpr: DeserializeState<'de, __State>, CastKind: DeserializeState<'de, __State>, u128: DeserializeState<'de, __State>, Ty: DeserializeState<'de, __State>, Vec<Byte>: DeserializeState<'de, __State>, ConstGenericDbVar: DeserializeState<'de, __State>, GlobalDeclRef: DeserializeState<'de, __State>, TraitRef: DeserializeState<'de, __State>, AssocConstId: DeserializeState<'de, __State>, PolyTraitRef: DeserializeState<'de, __State>, TypeDeclRef: DeserializeState<'de, __State>, VariantId: DeserializeState<'de, __State>, Option<TraitRef>: DeserializeState<'de, __State>, FieldId: DeserializeState<'de, __State>,

Source§

fn deserialize_state<__D>( __state: &__State, __deserializer: __D, ) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Source§

impl<'s, V> Drive<'s, V> for ConstantExprKind
where V: Visitor + Visit<'s, bool> + Visit<'s, IntegerValue> + Visit<'s, char> + Visit<'s, FloatValue> + Visit<'s, Option<VariantId>> + Visit<'s, IndexVec<FieldId, ConstantExpr>> + Visit<'s, Vec<ConstantExpr>> + Visit<'s, GlobalPlace> + Visit<'s, Option<UnsizingMetadata>> + Visit<'s, RefKind> + Visit<'s, String> + Visit<'s, Vec<u8>> + Visit<'s, FnPtr> + Visit<'s, ConstantExpr> + Visit<'s, CastKind> + Visit<'s, u128> + Visit<'s, Ty> + Visit<'s, Vec<Byte>> + Visit<'s, ConstGenericDbVar> + Visit<'s, GlobalDeclRef> + Visit<'s, TraitRef> + Visit<'s, AssocConstId> + Visit<'s, PolyTraitRef> + Visit<'s, TypeDeclRef> + Visit<'s, VariantId> + Visit<'s, Option<TraitRef>> + Visit<'s, FieldId>,

Source§

fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self.
Source§

impl<'s, V> DriveMut<'s, V> for ConstantExprKind
where V: Visitor + VisitMut<'s, bool> + VisitMut<'s, IntegerValue> + VisitMut<'s, char> + VisitMut<'s, FloatValue> + VisitMut<'s, Option<VariantId>> + VisitMut<'s, IndexVec<FieldId, ConstantExpr>> + VisitMut<'s, Vec<ConstantExpr>> + VisitMut<'s, GlobalPlace> + VisitMut<'s, Option<UnsizingMetadata>> + VisitMut<'s, RefKind> + VisitMut<'s, String> + VisitMut<'s, Vec<u8>> + VisitMut<'s, FnPtr> + VisitMut<'s, ConstantExpr> + VisitMut<'s, CastKind> + VisitMut<'s, u128> + VisitMut<'s, Ty> + VisitMut<'s, Vec<Byte>> + VisitMut<'s, ConstGenericDbVar> + VisitMut<'s, GlobalDeclRef> + VisitMut<'s, TraitRef> + VisitMut<'s, AssocConstId> + VisitMut<'s, PolyTraitRef> + VisitMut<'s, TypeDeclRef> + VisitMut<'s, VariantId> + VisitMut<'s, Option<TraitRef>> + VisitMut<'s, FieldId>,

Source§

fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self.
Source§

impl<'s, V> DriveTwo<'s, V> for ConstantExprKind
where V: Visitor<Break: Default> + VisitTwo<'s, bool> + VisitTwo<'s, IntegerValue> + VisitTwo<'s, char> + VisitTwo<'s, FloatValue> + VisitTwo<'s, Option<VariantId>> + VisitTwo<'s, IndexVec<FieldId, ConstantExpr>> + VisitTwo<'s, Vec<ConstantExpr>> + VisitTwo<'s, GlobalPlace> + VisitTwo<'s, Option<UnsizingMetadata>> + VisitTwo<'s, RefKind> + VisitTwo<'s, String> + VisitTwo<'s, Vec<u8>> + VisitTwo<'s, FnPtr> + VisitTwo<'s, ConstantExpr> + VisitTwo<'s, CastKind> + VisitTwo<'s, u128> + VisitTwo<'s, Ty> + VisitTwo<'s, Vec<Byte>> + VisitTwo<'s, ConstGenericDbVar> + VisitTwo<'s, GlobalDeclRef> + VisitTwo<'s, TraitRef> + VisitTwo<'s, AssocConstId> + VisitTwo<'s, PolyTraitRef> + VisitTwo<'s, TypeDeclRef> + VisitTwo<'s, VariantId> + VisitTwo<'s, Option<TraitRef>> + VisitTwo<'s, FieldId>,

Source§

fn drive_two_inner( &'s self, other: &'s Self, visitor: &mut V, ) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self and other, if they correspond. If the values don’t match up, this returns Break(Default::default()).
Source§

impl Eq for ConstantExprKind

Source§

impl From<DeBruijnVar<ConstGenericVarId>> for ConstantExprKind

Source§

fn from(x: ConstGenericDbVar) -> Self

Converts to this type from the input type.
Source§

impl Hash for ConstantExprKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ConstantExprKind

Source§

fn cmp(&self, other: &ConstantExprKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for ConstantExprKind

Source§

fn eq(&self, other: &ConstantExprKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for ConstantExprKind

Source§

fn partial_cmp(&self, other: &ConstantExprKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<__State: ?Sized> SerializeState<__State> for ConstantExprKind
where bool: SerializeState<__State>, IntegerValue: Serialize, char: SerializeState<__State>, FloatValue: Serialize, Option<VariantId>: SerializeState<__State>, IndexVec<FieldId, ConstantExpr>: SerializeState<__State>, Vec<ConstantExpr>: SerializeState<__State>, GlobalPlace: SerializeState<__State>, Option<UnsizingMetadata>: SerializeState<__State>, RefKind: SerializeState<__State>, String: SerializeState<__State>, Vec<u8>: SerializeState<__State>, FnPtr: SerializeState<__State>, ConstantExpr: SerializeState<__State>, CastKind: SerializeState<__State>, u128: SerializeState<__State>, Ty: SerializeState<__State>, Vec<Byte>: SerializeState<__State>, ConstGenericDbVar: SerializeState<__State>, GlobalDeclRef: SerializeState<__State>, TraitRef: SerializeState<__State>, AssocConstId: SerializeState<__State>, PolyTraitRef: SerializeState<__State>, TypeDeclRef: SerializeState<__State>, VariantId: SerializeState<__State>, Option<TraitRef>: SerializeState<__State>, FieldId: SerializeState<__State>,

Source§

fn serialize_state<__S>( &self, __state: &__State, __serializer: __S, ) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Source§

impl StructuralPartialEq for ConstantExprKind

Source§

impl TryFrom<ConstantExprKind> for ConstGenericDbVar

Source§

type Error = ()

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

fn try_from(e: ConstantExprKind) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> Dedup for T
where T: Mappable + Clone + Eq + Hash,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HashConsable for T
where T: Hash + PartialEq + Eq + Clone + Mappable,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Mappable for T
where T: Any + Send + Sync,

Source§

impl<T> MergeValue for T
where T: PartialEq + Debug,

Source§

fn merge(&mut self, other: T)

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

impl<T> TyVisitable for T
where T: AstVisitable,

Source§

fn type_info(&self) -> TypeInfo

Compute various bits of information about the contents of this value. See methods on TypeInfo.
Source§

fn visit_vars(&mut self, v: &mut impl VarsVisitor)

Visit the variables contained in self, as seen from the outside of self. This means that any variable bound inside self will be skipped, and all the seen De Bruijn indices will count from the outside of self.
Source§

fn substitute(self, generics: &GenericArgs) -> Self

Substitute the generic variables inside self by replacing them with the provided values. Note: if self is an item that comes from a TraitDecl, you must use substitute_with_self or substitute_inner_binder, otherwise you’ll get panics.
Source§

fn substitute_inner_binder(self, generics: &GenericArgs) -> Self

Substitute the generic variables inside self by replacing them with the provided values. This is appropriate when substituting an inner binder.
Source§

fn substitute_explicits(self, generics: &GenericArgs) -> Self

Substitute only the type, region and const generic args.
Source§

fn substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Self

Substitute the generic variables as well as the TraitRefKind::SelfId trait ref.
Source§

fn substitute_with_tref(self, tref: &TraitRef) -> Self

Substitute the generic variables as well as the TraitRefKind::SelfId trait ref.
Source§

fn try_substitute_with_tref( self, tref: &TraitRef, ) -> Result<Self, GenericsMismatch>

Substitute the generic variables as well as the TraitRefKind::SelfId trait ref.
Source§

fn try_substitute( self, generics: &GenericArgs, ) -> Result<Self, GenericsMismatch>

Source§

fn try_substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Result<Self, GenericsMismatch>

Source§

fn move_under_binder(self) -> Self

Move under one binder.
Source§

fn move_under_binders(self, depth: DeBruijnId) -> Self

Move under depth binders.
Source§

fn move_from_under_binder(self) -> Option<Self>

Move from under one binder.
Source§

fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>

Move the value out of depth binders. Returns None if it contains a variable bound in one of these depth binders.
Source§

fn visit_db_id<B>( &mut self, f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>, ) -> ControlFlow<B>

Visit the de Bruijn ids contained in self, as seen from the outside of self. This means that any variable bound inside self will be skipped, and all the seen indices will count from the outside of self.
Source§

fn has_escaping_region_var(&self) -> bool

Whether this value mentions any region var of its environment.
Source§

fn collect_regions(&self) -> SeqHashSet<Region>

Collect the regions contained in self.
Source§

fn replace_regions(self, f: impl FnMut() -> Region) -> Self

Replace all the regions by the output of the provided function. Binders levels are handled automatically.
Source§

fn replace_erased_regions(self, f: impl FnMut() -> Region) -> Self

Replace all the erased regions by the output of the provided function. Binders levels are handled automatically.
Source§

fn eq_modulo_regions(&self, other: &Self) -> bool

Compare two values, ignoring regions mismatches.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more