Skip to content

Commit

Permalink
args_iter doesn't need to borrow the MIR
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Sep 26, 2016
1 parent bcfbdb8 commit 66d2f34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc/mir/repr.rs
Expand Up @@ -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
Expand Down

0 comments on commit 66d2f34

Please sign in to comment.