Skip to content

Commit

Permalink
add stable NullaryOp
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmarkmartin committed Jul 26, 2023
1 parent bd1ae28 commit 933fc18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_smir/src/rustc_smir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_smir/src/stable_mir/mir/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 933fc18

Please sign in to comment.