diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-13 17:37:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-13 17:37:38 +0100 |
| commit | 8076b5903ac4d232524ce311a70f1b82d91b6ebd (patch) | |
| tree | c94ad416cda41d219544a7f9437a1258d499649a /compiler/rustc_codegen_llvm/src | |
| parent | eefea28dea51fe55ebfb436743d60cd84c891c66 (diff) | |
| parent | c78021709a3e0265e6ac3c82fe50c1d4fc67467f (diff) | |
| download | rust-8076b5903ac4d232524ce311a70f1b82d91b6ebd.tar.gz rust-8076b5903ac4d232524ce311a70f1b82d91b6ebd.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/utils.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/type_of.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs b/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs index a40cfc8b23f..5cd0e1cb63a 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs @@ -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; } diff --git a/compiler/rustc_codegen_llvm/src/type_of.rs b/compiler/rustc_codegen_llvm/src/type_of.rs index dc1165835e7..182adf81785 100644 --- a/compiler/rustc_codegen_llvm/src/type_of.rs +++ b/compiler/rustc_codegen_llvm/src/type_of.rs @@ -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); } |
