Rust Iterators vs Manual Loops: When Zero-Cost Abstractions Actually Cost Zero
Rust's Iterator adaptors often compile to the same machine code as hand-written loops—but only when the optimizer can prove bounds safety. Here's how to verify it, where it breaks, and when to choose each style.