add dedicated error variant for writing the discriminant of an uninhabited enum variant
This commit is contained in:
parent
eeb16a2a89
commit
c5a68cf0a6
3 changed files with 20 additions and 1 deletions
|
@ -618,6 +618,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
}
|
||||
|
||||
/// Read discriminant, return the runtime value as well as the variant index.
|
||||
/// Can also legally be called on non-enums (e.g. through the discriminant_value intrinsic)!
|
||||
pub fn read_discriminant(
|
||||
&self,
|
||||
op: &OpTy<'tcx, M::PointerTag>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue