fn contained_non_local_types<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    in_crate: InCrate
) -> Vec<Ty<'tcx>>
Expand description

Returns a list of relevant non-local types for ty.

This is just ty itself unless ty is #[fundamental], in which case we recursively look into this type.

If ty is local itself, this method returns an empty Vec.

Examples

  • u32 is not local, so this returns [u32].
  • for Foo<u32>, where Foo is a local type, this returns [].
  • &mut u32 returns [u32], as &mut is a fundamental type, similar to Box.
  • Box<Foo<u32>> returns [], as Box is a fundamental type and Foo is local.