Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/layout.rs')
-rw-r--r--crates/hir-ty/src/layout.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/hir-ty/src/layout.rs b/crates/hir-ty/src/layout.rs
index 0cb868d273..81aa16bfdc 100644
--- a/crates/hir-ty/src/layout.rs
+++ b/crates/hir-ty/src/layout.rs
@@ -388,6 +388,15 @@ fn struct_tail_erasing_lifetimes(db: &dyn HirDatabase, pointee: Ty) -> Ty {
None => pointee,
}
}
+ TyKind::Tuple(_, subst) => {
+ if let Some(last_field_ty) =
+ subst.iter(Interner).last().and_then(|arg| arg.ty(Interner))
+ {
+ struct_tail_erasing_lifetimes(db, last_field_ty.clone())
+ } else {
+ pointee
+ }
+ }
_ => pointee,
}
}