some more is_zst that should be is_1zst
This commit is contained in:
parent
0b84f18b24
commit
d1c4fe94c3
4 changed files with 8 additions and 8 deletions
|
@ -592,13 +592,13 @@ fn make_thin_self_ptr<'tcx>(
|
|||
for i in 0..fat_pointer_layout.fields.count() {
|
||||
let field_layout = fat_pointer_layout.field(cx, i);
|
||||
|
||||
if !field_layout.is_zst() {
|
||||
if !field_layout.is_1zst() {
|
||||
fat_pointer_layout = field_layout;
|
||||
continue 'descend_newtypes;
|
||||
}
|
||||
}
|
||||
|
||||
bug!("receiver has no non-zero-sized fields {:?}", fat_pointer_layout);
|
||||
bug!("receiver has no non-1-ZST fields {:?}", fat_pointer_layout);
|
||||
}
|
||||
|
||||
fat_pointer_layout.ty
|
||||
|
|
|
@ -192,7 +192,7 @@ fn layout_of_uncached<'tcx>(
|
|||
|
||||
let metadata_layout = cx.layout_of(metadata_ty)?;
|
||||
// If the metadata is a 1-zst, then the pointer is thin.
|
||||
if metadata_layout.is_zst() && metadata_layout.align.abi.bytes() == 1 {
|
||||
if metadata_layout.is_1zst() {
|
||||
return Ok(tcx.mk_layout(LayoutS::scalar(cx, data_ptr)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue