about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/util/alignment.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_const_eval/src/util/alignment.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_const_eval/src/util/alignment.rs')
-rw-r--r--compiler/rustc_const_eval/src/util/alignment.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/util/alignment.rs b/compiler/rustc_const_eval/src/util/alignment.rs
index 528274e6aba..5ad55968398 100644
--- a/compiler/rustc_const_eval/src/util/alignment.rs
+++ b/compiler/rustc_const_eval/src/util/alignment.rs
@@ -22,7 +22,7 @@ where
     };
 
     let ty = place.ty(local_decls, tcx).ty;
-    let unsized_tail = || tcx.struct_tail_with_normalize(ty, |ty| ty, || {});
+    let unsized_tail = || tcx.struct_tail_for_codegen(ty, param_env);
     match tcx.layout_of(param_env.and(ty)) {
         Ok(layout)
             if layout.align.abi <= pack