add dedicated error variant for writing the discriminant of an uninhabited enum variant

This commit is contained in:
Ralf Jung 2021-10-13 16:53:09 -04:00
parent eeb16a2a89
commit c5a68cf0a6
3 changed files with 20 additions and 1 deletions

View file

@ -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>,