Limit storage duration of inlined always live locals

This commit is contained in:
Tomasz Miąsko 2020-11-15 00:00:00 +00:00
parent 75042566d1
commit f27d56d1ff
7 changed files with 73 additions and 5 deletions

View file

@ -420,7 +420,9 @@ impl<'tcx> Body<'tcx> {
/// Returns an iterator over all user-defined variables and compiler-generated temporaries (all
/// locals that are neither arguments nor the return place).
#[inline]
pub fn vars_and_temps_iter(&self) -> impl Iterator<Item = Local> + ExactSizeIterator {
pub fn vars_and_temps_iter(
&self,
) -> impl DoubleEndedIterator<Item = Local> + ExactSizeIterator {
let arg_count = self.arg_count;
let local_count = self.local_decls.len();
(arg_count + 1..local_count).map(Local::new)