Function adt_sizedness_constraint

Source
fn adt_sizedness_constraint<'tcx>(
    tcx: TyCtxt<'tcx>,
    (def_id, sizedness): (DefId, SizedTraitKind),
) -> Option<EarlyBinder<'tcx, Ty<'tcx>>>
Expand description

Returns the type of the last field of a struct (“the constraint”) which must implement the sizedness trait for the whole ADT to be considered to implement that sizedness trait. def_id is assumed to be the AdtDef of a struct and will panic otherwise.

For Sized, there are only a few options for the types in the constraint: - an meta-sized type (str, slices, trait objects, etc) - an pointee-sized type (extern types) - a type parameter or projection whose sizedness can’t be known

For MetaSized, there are only a few options for the types in the constraint: - an pointee-sized type (extern types) - a type parameter or projection whose sizedness can’t be known