1
Fork 0

Specialize DestructuredConstant to its one user (pretty printing)

This commit is contained in:
Oli Scherer 2023-06-28 09:34:26 +00:00
parent 4dcf988360
commit a0eb348d38
3 changed files with 13 additions and 8 deletions

View file

@ -115,7 +115,7 @@ pub(crate) fn try_destructure_mir_constant<'tcx>(
.map(|i| {
let field_op = ecx.operand_field(&down, i)?;
let val = op_to_const(&ecx, &field_op);
Ok(mir::ConstantKind::Val(val, field_op.layout.ty))
Ok((val, field_op.layout.ty))
})
.collect::<InterpResult<'tcx, Vec<_>>>()?;
let fields = tcx.arena.alloc_from_iter(fields_iter);