diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-03-05 22:04:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-05 22:04:10 +0100 |
| commit | 67d735c4bf99dbbbe2eea9a90a0149ffa942f492 (patch) | |
| tree | 9c326d06402d57d5165e349e36ee6d018df3085f /src/librustc_mir/interpret | |
| parent | 558115b86ccc60aa2132f0e66527bc24842d1ade (diff) | |
| parent | 84577c86bf5e1908acfc2cd097684f11e828518c (diff) | |
| download | rust-67d735c4bf99dbbbe2eea9a90a0149ffa942f492.tar.gz rust-67d735c4bf99dbbbe2eea9a90a0149ffa942f492.zip | |
Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPC
even more clippy cleanups * Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed) * Use more efficient &&str to String conversion (clippy::inefficient_to_string) * Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call) * Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg) * Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator) * Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes) * Remove redundant patterns when matching ( x @ _ to x) (clippy::redundant_pattern)
Diffstat (limited to 'src/librustc_mir/interpret')
| -rw-r--r-- | src/librustc_mir/interpret/terminator.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_mir/interpret/terminator.rs b/src/librustc_mir/interpret/terminator.rs index 08d4ae34afb..ea8378574a3 100644 --- a/src/librustc_mir/interpret/terminator.rs +++ b/src/librustc_mir/interpret/terminator.rs @@ -311,9 +311,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { // taking into account the `spread_arg`. If we could write // this is a single iterator (that handles `spread_arg`), then // `pass_argument` would be the loop body. It takes care to - // not advance `caller_iter` for ZSTs. - let mut locals_iter = body.args_iter(); - while let Some(local) = locals_iter.next() { + // not advance `caller_iter` for ZSTs + for local in body.args_iter() { let dest = self.eval_place(&mir::Place::from(local))?; if Some(local) == body.spread_arg { // Must be a tuple |
