Skip to content

Commit

Permalink
Use write_immediate.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Sep 11, 2023
1 parent 7493ad0 commit 6984030
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
sym::discriminant_value => {
let place = self.deref_pointer(&args[0])?;
let variant = self.read_discriminant(&place)?;
let discr = self.discriminant_for_variant(place.layout, variant)?.to_scalar();
self.write_scalar(discr, dest)?;
let discr = self.discriminant_for_variant(place.layout, variant)?;
self.write_immediate(*discr, dest)?;
}
sym::exact_div => {
let l = self.read_immediate(&args[0])?;
Expand Down

0 comments on commit 6984030

Please sign in to comment.