diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2016-09-26 22:51:51 +0200 |
|---|---|---|
| committer | Jonas Schievink <jonasschievink@gmail.com> | 2016-09-26 22:51:51 +0200 |
| commit | 66d2f34d4060d2447b12769460120f5123879b6c (patch) | |
| tree | bbcbae2f40cae7f5f10d6bb3697cc2add9d2eddb | |
| parent | bcfbdb871fa1cf1083687ac4b5e57acc8039f637 (diff) | |
| download | rust-66d2f34d4060d2447b12769460120f5123879b6c.tar.gz rust-66d2f34d4060d2447b12769460120f5123879b6c.zip | |
args_iter doesn't need to borrow the MIR
| -rw-r--r-- | src/librustc/mir/repr.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc/mir/repr.rs b/src/librustc/mir/repr.rs index 24224edf7be..9616ad708b4 100644 --- a/src/librustc/mir/repr.rs +++ b/src/librustc/mir/repr.rs @@ -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 |
