add stable NullaryOp

This commit is contained in:
Eric Mark Martin 2023-07-26 00:15:29 -04:00
parent bd1ae282f1
commit 933fc180bd
2 changed files with 6 additions and 1 deletions

View File

@ -156,7 +156,9 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> {
ops.0.stable(tables),
ops.1.stable(tables),
),
NullaryOp(_, _) => todo!(),
NullaryOp(null_op, ty) => {
stable_mir::mir::Rvalue::NullaryOp(null_op.stable(tables), tables.intern_ty(*ty))
}
UnaryOp(un_op, op) => {
stable_mir::mir::Rvalue::UnaryOp(un_op.stable(tables), op.stable(tables))
}

View File

@ -218,6 +218,9 @@ pub enum Rvalue {
/// nature of this operation?
ThreadLocalRef(stable_mir::CrateItem),
/// Computes a value as described by the operation.
NullaryOp(NullOp, Ty),
/// Exactly like `BinaryOp`, but less operands.
///
/// Also does two's-complement arithmetic. Negation requires a signed integer or a float;