Skip to content

Commit c5c4fa8

Browse files
committed
Switch assertion order to be more helpful to ppl that encounter them
1 parent a4fa5bb commit c5c4fa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/const_eval/eval_queries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ pub(super) fn op_to_const<'tcx>(
124124
ConstValue::ByRef { alloc, offset: ptr.offset }
125125
}
126126
Scalar::Raw { data, .. } => {
127+
assert!(mplace.layout.is_zst());
127128
assert_eq!(
128129
data,
129130
mplace.layout.align.abi.bytes().into(),
130131
"this MPlaceTy must come from `try_as_mplace` being used on a zst, so we know what
131132
value this integer address must have",
132133
);
133-
assert!(mplace.layout.is_zst());
134134
ConstValue::Scalar(Scalar::zst())
135135
}
136136
};

0 commit comments

Comments
 (0)