File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -5570,4 +5570,5 @@ Released 2018-09-13
55705570[ `allow-one-hash-in-raw-strings` ] : https://doc.rust-lang.org/clippy/lint_configuration.html#allow-one-hash-in-raw-strings
55715571[ `absolute-paths-max-segments` ] : https://doc.rust-lang.org/clippy/lint_configuration.html#absolute-paths-max-segments
55725572[ `absolute-paths-allowed-crates` ] : https://doc.rust-lang.org/clippy/lint_configuration.html#absolute-paths-allowed-crates
5573+ [ `enforce-iter-loop-reborrow` ] : https://doc.rust-lang.org/clippy/lint_configuration.html#enforce-iter-loop-reborrow
55735574<!-- end autogenerated links to configuration documentation -->
Original file line number Diff line number Diff line change @@ -751,3 +751,27 @@ Which crates to allow absolute paths from
751751* [ ` absolute_paths ` ] ( https://rust-lang.github.io/rust-clippy/master/index.html#absolute_paths )
752752
753753
754+ ## ` enforce-iter-loop-reborrow `
755+ #### Example
756+ ```
757+ let mut vec = vec![1, 2, 3];
758+ let rmvec = &mut vec;
759+ for _ in rmvec.iter() {}
760+ for _ in rmvec.iter_mut() {}
761+ ```
762+
763+ Use instead:
764+ ```
765+ let mut vec = vec![1, 2, 3];
766+ let rmvec = &mut vec;
767+ for _ in &*rmvec {}
768+ for _ in &mut *rmvec {}
769+ ```
770+
771+ ** Default Value:** ` false ` (` bool ` )
772+
773+ ---
774+ ** Affected lints:**
775+ * [ ` explicit_iter_loop ` ] ( https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop )
776+
777+
You can’t perform that action at this time.
0 commit comments