Skip to content

Commit 66d2f34

Browse files
args_iter doesn't need to borrow the MIR
1 parent bcfbdb8 commit 66d2f34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc/mir/repr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ impl<'tcx> Mir<'tcx> {
214214

215215
/// Returns an iterator over all function arguments.
216216
#[inline]
217-
pub fn args_iter<'a>(&'a self) -> impl Iterator<Item=Local> + 'a {
218-
(1..self.arg_count+1).map(Local::new)
217+
pub fn args_iter(&self) -> impl Iterator<Item=Local> {
218+
let arg_count = self.arg_count;
219+
(1..arg_count+1).map(Local::new)
219220
}
220221

221222
/// Returns an iterator over all user-defined variables and compiler-generated temporaries (all

0 commit comments

Comments
 (0)