about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-13 17:29:00 +0000
committerbors <bors@rust-lang.org>2023-11-13 17:29:00 +0000
commit531cb83fcfaa7568e2475c11e4e13ff4d9e06c01 (patch)
tree82dcb517ba5f32d6c3d75a00bc7979f2124bbadb /compiler/rustc_ty_utils/src
parent4bd2fd5c831a3ce74dc0ffd37b93af775d71ae70 (diff)
parentb0a68a441447b571c0a4b0f7f9a3fc12e69537e9 (diff)
Auto merge of #117881 - TaKO8Ki:rollup-n7jtmgj, r=TaKO8Ki
Rollup of 5 pull requests

Successful merges:

 - #117737 (Remove `-Zkeep-hygiene-data`.)
 - #117830 (Small improvements in object lifetime default code)
 - #117858 (Compute layout with spans for better cycle errors in coroutines)
 - #117863 (Remove some unused stuff from `rustc_index`)
 - #117872 (Cranelift isn't available on non-nightly channels)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_ty_utils/src')
-rw-r--r--compiler/rustc_ty_utils/src/layout.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index 283862b5e1c..52f723eba80 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -740,11 +740,11 @@ fn coroutine_layout<'tcx>(
     };
     let tag_layout = cx.tcx.mk_layout(LayoutS::scalar(cx, tag));
 
-    let promoted_layouts = ineligible_locals
-        .iter()
-        .map(|local| subst_field(info.field_tys[local].ty))
-        .map(|ty| Ty::new_maybe_uninit(tcx, ty))
-        .map(|ty| Ok(cx.layout_of(ty)?.layout));
+    let promoted_layouts = ineligible_locals.iter().map(|local| {
+        let field_ty = subst_field(info.field_tys[local].ty);
+        let uninit_ty = Ty::new_maybe_uninit(tcx, field_ty);
+        Ok(cx.spanned_layout_of(uninit_ty, info.field_tys[local].source_info.span)?.layout)
+    });
     let prefix_layouts = args
         .as_coroutine()
         .prefix_tys()