1
Fork 0

Rollup merge of #79027 - tmiasko:inline-always-live-locals, r=oli-obk

Limit storage duration of inlined always live locals

Closes #76375.
This commit is contained in:
Mara Bos 2020-11-17 10:06:21 +01:00 committed by GitHub
commit 336dc18aa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)