Skip to content

Commit afdaa2e

Browse files
authored
Rollup merge of #88532 - ptrojahn:single_use, r=davidtwco
Remove single use variables
2 parents ea82d06 + 99a3d64 commit afdaa2e

File tree

1 file changed

+2
-5
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+2
-5
lines changed

compiler/rustc_middle/src/mir/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,7 @@ impl<'tcx> Body<'tcx> {
411411
/// Returns an iterator over all function arguments.
412412
#[inline]
413413
pub fn args_iter(&self) -> impl Iterator<Item = Local> + ExactSizeIterator {
414-
let arg_count = self.arg_count;
415-
(1..arg_count + 1).map(Local::new)
414+
(1..self.arg_count + 1).map(Local::new)
416415
}
417416

418417
/// Returns an iterator over all user-defined variables and compiler-generated temporaries (all
@@ -421,9 +420,7 @@ impl<'tcx> Body<'tcx> {
421420
pub fn vars_and_temps_iter(
422421
&self,
423422
) -> impl DoubleEndedIterator<Item = Local> + ExactSizeIterator {
424-
let arg_count = self.arg_count;
425-
let local_count = self.local_decls.len();
426-
(arg_count + 1..local_count).map(Local::new)
423+
(self.arg_count + 1..self.local_decls.len()).map(Local::new)
427424
}
428425

429426
#[inline]

0 commit comments

Comments
 (0)