fn closure_saved_names_of_captured_variables(
    tcx: TyCtxt<'_>,
    def_id: DefId
) -> SmallVec<[String; 16]>
Expand description

Returns names of captured upvars for closures and generators.

Here are some examples:

  • name__field1__field2 when the upvar is captured by value.
  • _ref__name__field when the upvar is captured by reference.

For generators this only contains upvars that are shared by all states.