don't lint while_let_on_iterator on nested loops

The problem is with a nested loop, the iterator may well be reused. This
changeset introduces a false negative, when the iterator is initialized
within the outer loop. A further PR could get rid of this false negative
by checking if the iterator is indeed initialized within the outer loop.
This commit is contained in:
Andre Bogus
2017-06-23 18:29:18 +02:00
parent 06ec3d310f
commit 88aa04dfa5
3 changed files with 27 additions and 4 deletions

View File

@@ -250,7 +250,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
reg.register_late_lint_pass(box shadow::Pass);
reg.register_late_lint_pass(box types::LetPass);
reg.register_late_lint_pass(box types::UnitCmp);
reg.register_late_lint_pass(box loops::Pass);
reg.register_late_lint_pass(box loops::Pass::default());
reg.register_late_lint_pass(box lifetimes::LifetimePass);
reg.register_late_lint_pass(box entry::HashMapLint);
reg.register_late_lint_pass(box ranges::StepByZero);