librustc: Properly tag upvars in proc's to stop misleading unused_mut warnings.
Add tests.
auto merge of #16675 : luqmana/rust/pmu, r=alexcrichton

Fixes #16671.