about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-05 13:20:04 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-03-05 16:38:48 +0100
commit3e70c8ec2ffb17ad55d57032a9d47fe7463f2d6d (patch)
treebec6ba62c01da6b2c522408859fc9fbeeb458b46 /src/librustc_mir/interpret
parentc2bbe3349f3c93d63d6408d4df1d190c7890f512 (diff)
downloadrust-3e70c8ec2ffb17ad55d57032a9d47fe7463f2d6d.tar.gz
rust-3e70c8ec2ffb17ad55d57032a9d47fe7463f2d6d.zip
Use simple 'for i in x' loops instead of 'while let Some(x) = x.next()' loops on iterators. (clippy::while_let_on_iterator)
Diffstat (limited to 'src/librustc_mir/interpret')
-rw-r--r--src/librustc_mir/interpret/terminator.rs5
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