1
Fork 0

add helper methods for accessing struct tail

This commit is contained in:
Lukas Markeffsky 2023-07-05 20:44:24 +02:00
parent e3de14e463
commit 7aa5f39d3b
9 changed files with 31 additions and 34 deletions

View file

@ -103,7 +103,7 @@ fn adt_sized_constraint(tcx: TyCtxt<'_>, def_id: DefId) -> &[Ty<'_>] {
let result = tcx.mk_type_list_from_iter(
def.variants()
.iter()
.filter_map(|v| v.fields.raw.last())
.filter_map(|v| v.tail_opt())
.flat_map(|f| sized_constraint_for_ty(tcx, def, tcx.type_of(f.did).subst_identity())),
);