args_iter doesn't need to borrow the MIR

This commit is contained in:
Jonas Schievink 2016-09-26 22:51:51 +02:00
parent bcfbdb871f
commit 66d2f34d40

View File

@ -214,8 +214,9 @@ impl<'tcx> Mir<'tcx> {
/// Returns an iterator over all function arguments.
#[inline]
pub fn args_iter<'a>(&'a self) -> impl Iterator<Item=Local> + 'a {
(1..self.arg_count+1).map(Local::new)
pub fn args_iter(&self) -> impl Iterator<Item=Local> {
let arg_count = self.arg_count;
(1..arg_count+1).map(Local::new)
}
/// Returns an iterator over all user-defined variables and compiler-generated temporaries (all