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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user