about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/traits
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_ssa/src/traits
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_ssa/src/traits')
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/type_.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/type_.rs b/compiler/rustc_codegen_ssa/src/traits/type_.rs
index 80dad79179a..7c042c0c621 100644
--- a/compiler/rustc_codegen_ssa/src/traits/type_.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/type_.rs
@@ -91,7 +91,7 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
             return false;
         }
 
-        let tail = self.tcx().struct_tail_erasing_lifetimes(ty, param_env);
+        let tail = self.tcx().struct_tail_for_codegen(ty, param_env);
         match tail.kind() {
             ty::Foreign(..) => false,
             ty::Str | ty::Slice(..) | ty::Dynamic(..) => true,