mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Fix returning non ZST uninhabited types
This commit is contained in:
parent
01e9303857
commit
2b61f90c71
@ -327,8 +327,9 @@ impl<'a, 'tcx: 'a> CPlace<'tcx> {
|
||||
dst_layout,
|
||||
),
|
||||
CPlace::NoPlace(layout) => {
|
||||
assert_eq!(layout.size.bytes(), 0);
|
||||
assert_eq!(from.layout().size.bytes(), 0);
|
||||
if layout.abi != Abi::Uninhabited {
|
||||
assert_eq!(layout.size.bytes(), 0, "{:?}", layout);
|
||||
}
|
||||
return;
|
||||
}
|
||||
CPlace::Addr(_, _, _) => bug!("Can't write value to unsized place {:?}", self),
|
||||
|
Loading…
Reference in New Issue
Block a user