Skip to content

Commit

Permalink
Use dest_ty as size of discriminant instead of ty. Fixes rust-lang#51086
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed May 30, 2018
1 parent 889d8dc commit bf2601a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
let ty = self.place_ty(place);
let place = self.eval_place(place)?;
let discr_val = self.read_discriminant_value(place, ty)?;
let defined = self.layout_of(ty).unwrap().size.bits() as u8;
let defined = self.layout_of(dest_ty).unwrap().size.bits() as u8;
self.write_scalar(dest, Scalar::Bits {
bits: discr_val,
defined,
Expand Down

0 comments on commit bf2601a

Please sign in to comment.