We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e0bc6e commit 316c70fCopy full SHA for 316c70f
compiler/rustc_transmute/src/layout/tree.rs
@@ -495,7 +495,10 @@ pub(crate) mod rustc {
495
(ty, layout): (Ty<'tcx>, Layout<'tcx>),
496
i: FieldIdx,
497
) -> Ty<'tcx> {
498
- // FIXME: Why does this not just use `ty_and_layout_field`?
+ // We cannot use `ty_and_layout_field` to retrieve the field type, since
499
+ // `ty_and_layout_field` erases regions in the returned type. We must
500
+ // not erase regions here, since we may need to ultimately emit outlives
501
+ // obligations as a consequence of the transmutability analysis.
502
match ty.kind() {
503
ty::Adt(def, args) => {
504
match layout.variants {
0 commit comments