Function rupta::util::type_util::closure_field_types
source · pub fn closure_field_types<'tcx>(ty: Ty<'tcx>) -> Vec<Ty<'tcx>>Expand description
Closures bring enclosed variables with them that are effectively additional parameters. There is no convenient way to look up their types later on. I.e. unlike ordinary parameters whose types can be looked up in mir.local_decls, these extra parameters need their types extracted from the closure type definitions via the tricky logic below.