find_generic_in_ty

Function find_generic_in_ty 

Source
pub fn find_generic_in_ty<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    type_ident: &str,
) -> Option<Ty<'tcx>>
Expand description

Recursively walk a Ty tree looking for a type whose name matches type_ident.

This handles parameter types, pointers, references, slices, arrays, tuples, and ADT fields.