Skip to content

Commit 23b0c47

Browse files
committed
Ensure we don't accidentally turn non-zsts into zsts
1 parent 4fbe434 commit 23b0c47

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_mir/const_eval/eval_queries.rs

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ pub(super) fn op_to_const<'tcx>(
125125
}
126126
Scalar::Raw { data, .. } => {
127127
assert_eq!(data, mplace.layout.align.abi.bytes().into());
128+
assert!(mplace.layout.is_zst());
128129
ConstValue::Scalar(Scalar::zst())
129130
}
130131
};

0 commit comments

Comments
 (0)