about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-12 22:17:05 +0000
committerbors <bors@rust-lang.org>2024-08-12 22:17:05 +0000
commitdb5704ffca0e4f7a55f49160c336d43be7c104e2 (patch)
treee8a79424591200ed5fedbe653e8e93841fb20a38 /compiler/rustc_ty_utils/src
parent91376f416222a238227c84a848d168835ede2cc3 (diff)
parent522d43673a6998be3d494645c0e4e3ecb37baaa1 (diff)
downloadrust-db5704ffca0e4f7a55f49160c336d43be7c104e2.tar.gz
rust-db5704ffca0e4f7a55f49160c336d43be7c104e2.zip
Auto merge of #129024 - matthiaskrgr:rollup-uj1pd0x, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #128712 (Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver)
 - #128912 (Store `do_not_recommend`-ness in impl header)
 - #129000 (bootstrap: clear miri ui-test deps when miri sysroot gets rebuilt)
 - #129013 (Remove unused script from run-make tests)
 - #129017 (Replace `std::fmt:FormatterFn` with `std::fmt::from_fn`)

r? `@ghost`
`@rustbot` modify labels: rollup
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) => {