diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2016-09-27 02:03:35 +0200 |
|---|---|---|
| committer | Jonas Schievink <jonasschievink@gmail.com> | 2016-09-27 02:03:35 +0200 |
| commit | e3293b84af91d37ba2cd1a5f6ed246b23590e5d3 (patch) | |
| tree | bdd4b9ead2b2608a1715411c615dae9e0e029ef1 /src/librustc/mir | |
| parent | a0fa2048a8a7695ded7e932a6f7acf4182f9ef73 (diff) | |
| download | rust-e3293b84af91d37ba2cd1a5f6ed246b23590e5d3.tar.gz rust-e3293b84af91d37ba2cd1a5f6ed246b23590e5d3.zip | |
Address review comments
Diffstat (limited to 'src/librustc/mir')
| -rw-r--r-- | src/librustc/mir/repr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc/mir/repr.rs b/src/librustc/mir/repr.rs index 9616ad708b4..34b46ed66a2 100644 --- a/src/librustc/mir/repr.rs +++ b/src/librustc/mir/repr.rs @@ -222,8 +222,10 @@ impl<'tcx> Mir<'tcx> { /// Returns an iterator over all user-defined variables and compiler-generated temporaries (all /// locals that are neither arguments nor the return pointer). #[inline] - pub fn vars_and_temps_iter<'a>(&'a self) -> impl Iterator<Item=Local> + 'a { - (self.arg_count+1..self.local_decls.len()).map(Local::new) + pub fn vars_and_temps_iter(&self) -> impl Iterator<Item=Local> { + let arg_count = self.arg_count; + let local_count = self.local_decls.len(); + (arg_count+1..local_count).map(Local::new) } /// Changes a statement to a nop. This is both faster than deleting instructions and avoids |
