Skip to content
/ rust Public
forked from rust-lang/rust

Commit 17e4f80

Browse files
authored
Rollup merge of rust-lang#114082 - ericmarkmartin:smir-nullary-op, r=spastorino
add stable NullaryOp r? `@spastorino`
2 parents a926c73 + 933fc18 commit 17e4f80

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> {
156156
ops.0.stable(tables),
157157
ops.1.stable(tables),
158158
),
159-
NullaryOp(_, _) => todo!(),
159+
NullaryOp(null_op, ty) => {
160+
stable_mir::mir::Rvalue::NullaryOp(null_op.stable(tables), tables.intern_ty(*ty))
161+
}
160162
UnaryOp(un_op, op) => {
161163
stable_mir::mir::Rvalue::UnaryOp(un_op.stable(tables), op.stable(tables))
162164
}

compiler/rustc_smir/src/stable_mir/mir/body.rs

+3
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ pub enum Rvalue {
218218
/// nature of this operation?
219219
ThreadLocalRef(stable_mir::CrateItem),
220220

221+
/// Computes a value as described by the operation.
222+
NullaryOp(NullOp, Ty),
223+
221224
/// Exactly like `BinaryOp`, but less operands.
222225
///
223226
/// Also does two's-complement arithmetic. Negation requires a signed integer or a float;

0 commit comments

Comments
 (0)