about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/common.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_codegen_cranelift/src/common.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_codegen_cranelift/src/common.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/common.rs b/compiler/rustc_codegen_cranelift/src/common.rs
index 09317139936..a1b29a42225 100644
--- a/compiler/rustc_codegen_cranelift/src/common.rs
+++ b/compiler/rustc_codegen_cranelift/src/common.rs
@@ -107,7 +107,7 @@ pub(crate) fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
         return false;
     }
 
-    let tail = tcx.struct_tail_erasing_lifetimes(ty, ParamEnv::reveal_all());
+    let tail = tcx.struct_tail_for_codegen(ty, ParamEnv::reveal_all());
     match tail.kind() {
         ty::Foreign(..) => false,
         ty::Str | ty::Slice(..) | ty::Dynamic(..) => true,