Rollup merge of #104357 - RalfJung:is-sized, r=cjgillot
add is_sized method on Abi and Layout, and use it This avoids the double negation of `!is_unsized()` that we have quite a lot.
This commit is contained in:
@@ -72,7 +72,7 @@ pub(crate) fn fat_pointer_kind<'ll, 'tcx>(
|
||||
layout.is_unsized()
|
||||
);
|
||||
|
||||
if !layout.is_unsized() {
|
||||
if layout.is_sized() {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ fn struct_llfields<'a, 'tcx>(
|
||||
prev_effective_align = effective_field_align;
|
||||
}
|
||||
let padding_used = result.len() > field_count;
|
||||
if !layout.is_unsized() && field_count > 0 {
|
||||
if layout.is_sized() && field_count > 0 {
|
||||
if offset > layout.size {
|
||||
bug!("layout: {:#?} stride: {:?} offset: {:?}", layout, layout.size, offset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user