Skip to content

Commit

Permalink
Switch assertion order to be more helpful to ppl that encounter them
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 9, 2020
1 parent a4fa5bb commit c5c4fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ pub(super) fn op_to_const<'tcx>(
ConstValue::ByRef { alloc, offset: ptr.offset }
}
Scalar::Raw { data, .. } => {
assert!(mplace.layout.is_zst());
assert_eq!(
data,
mplace.layout.align.abi.bytes().into(),
"this MPlaceTy must come from `try_as_mplace` being used on a zst, so we know what
value this integer address must have",
);
assert!(mplace.layout.is_zst());
ConstValue::Scalar(Scalar::zst())
}
};
Expand Down

0 comments on commit c5c4fa8

Please sign in to comment.