Skip to content

Commit c0e1191

Browse files
committed
Don't build a ty::Const just to take it apart again
1 parent 5b6ddd5 commit c0e1191

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_mir/src/interpret/intrinsics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
171171
};
172172
let val =
173173
self.tcx.const_eval_global_id(self.param_env, gid, Some(self.tcx.span))?;
174-
let const_ = ty::Const { val: ty::ConstKind::Value(val), ty };
175-
let val = self.const_to_op(&const_, None)?;
174+
let val = self.const_val_to_op(val, ty, None)?;
176175
self.copy_op(&val, dest)?;
177176
}
178177

0 commit comments

Comments
 (0)