about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-08-11 19:21:33 -0400
committerMichael Goulet <michael@errs.io>2024-08-11 19:40:03 -0400
commitf15997ffeca4c7da66e7de9e348ccb8d3cccc946 (patch)
tree2662511eb64f7bb5fab35bb545e6bc1448c696c0 /compiler/rustc_ty_utils/src
parentb5d2079fb9c9ac9f0fe594f65452b4097e71c2de (diff)
downloadrust-f15997ffeca4c7da66e7de9e348ccb8d3cccc946.tar.gz
rust-f15997ffeca4c7da66e7de9e348ccb8d3cccc946.zip
Remove struct_tail_no_normalization
Diffstat (limited to 'compiler/rustc_ty_utils/src')
-rw-r--r--compiler/rustc_ty_utils/src/layout.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index 1eb03fc3bd6..244a6afcf97 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -219,9 +219,13 @@ fn layout_of_uncached<'tcx>(
                             // its struct tail cannot be normalized either, so try to get a
                             // more descriptive layout error here, which will lead to less confusing
                             // diagnostics.
+                            //
+                            // We use the raw struct tail function here to get the first tail
+                            // that is an alias, which is likely the cause of the normalization
+                            // error.
                             match tcx.try_normalize_erasing_regions(
                                 param_env,
-                                tcx.struct_tail_without_normalization(pointee),
+                                tcx.struct_tail_raw(pointee, |ty| ty, || {}),
                             ) {
                                 Ok(_) => {}
                                 Err(better_err) => {