add helper methods for accessing struct tail
This commit is contained in:
parent
e3de14e463
commit
7aa5f39d3b
9 changed files with 31 additions and 34 deletions
|
@ -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())),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue