rustc_builtin_macros::deriving::generic

Function find_type_parameters

Source
fn find_type_parameters(
    ty: &Ty,
    ty_param_names: &[Symbol],
    cx: &ExtCtxt<'_>,
) -> Vec<TypeParameter>
Expand description

This method helps to extract all the type parameters referenced from a type. For a type parameter <T>, it looks for either a TyPath that is not global and starts with T, or a TyQPath. Also include bound generic params from the input type.