no-mutated-range-bound Disallow mutating range bounds during iteration over that range A range captures its bounds before iteration, so mutating their source storage cannot change the active traversal. Instead, you SHOULD leave captured bounds unchanged or use a conditional loop when each iteration must observe an updated bound. - Category: suspicious - Level: warning - Fix: none - Scope: module Reported function visit(limit: int32): void { let end = limit; for (const value of 0..end) { end -= 1; value; } } Accepted function visit(limit: int32): void { let end = limit; for (const value of 0..end) { value; } } Prior art - Clippy ยท mutrangebound language/linter/src/rules/suspicious/nomutatedrangebound.rs:8