Skip to content

Commit 2b61f90

Browse files
committed
Fix returning non ZST uninhabited types
1 parent 01e9303 commit 2b61f90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/value_and_place.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,9 @@ impl<'a, 'tcx: 'a> CPlace<'tcx> {
327327
dst_layout,
328328
),
329329
CPlace::NoPlace(layout) => {
330-
assert_eq!(layout.size.bytes(), 0);
331-
assert_eq!(from.layout().size.bytes(), 0);
330+
if layout.abi != Abi::Uninhabited {
331+
assert_eq!(layout.size.bytes(), 0, "{:?}", layout);
332+
}
332333
return;
333334
}
334335
CPlace::Addr(_, _, _) => bug!("Can't write value to unsized place {:?}", self),

0 commit comments

Comments
 (0)