about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/layout.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-09 11:36:01 +0000
committerbors <bors@rust-lang.org>2024-08-09 11:36:01 +0000
commit899eb03926be23f2e5d2ffcaa1d6f9ac40af7f13 (patch)
tree2aac6c7fe8d9f24c259b4ae7211433da2537c301 /compiler/rustc_ty_utils/src/layout.rs
parent97e72524a34994541810438258115802f8b85543 (diff)
parentb9164319769c52bd98607d80b4c7c53e06bf6887 (diff)
downloadrust-899eb03926be23f2e5d2ffcaa1d6f9ac40af7f13.tar.gz
rust-899eb03926be23f2e5d2ffcaa1d6f9ac40af7f13.zip
Auto merge of #128703 - compiler-errors:normalizing-tails, r=lcnr
Miscellaneous improvements to struct tail normalization

1. Make checks for foreign tails more accurate by normalizing the struct tail. I didn't write a test for this one.
2. Normalize when computing struct tail for `offset_of` for slice/str. This fixes the new solver only.
3. Normalizing when computing tails for disaligned reference check. This fixes both solvers.

r? lcnr
Diffstat (limited to 'compiler/rustc_ty_utils/src/layout.rs')
-rw-r--r--compiler/rustc_ty_utils/src/layout.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index 3ef10f4e43c..1eb03fc3bd6 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -244,7 +244,7 @@ fn layout_of_uncached<'tcx>(
 
                 metadata
             } else {
-                let unsized_part = tcx.struct_tail_erasing_lifetimes(pointee, param_env);
+                let unsized_part = tcx.struct_tail_for_codegen(pointee, param_env);
 
                 match unsized_part.kind() {
                     ty::Foreign(..) => {