title: What is a stable way to iterate on a range with custom step?
body: <p>How should I go if I want to iterate with a custom step in stable Rust? Essentially something like the C/C++</p>
  
  <pre class="lang-none prettyprint-override"><code>for (int i = 0; i &lt; n; i += 2) {
  
  }
  </code></pre>
  
  <p>I've already tried using <code>range_step_inclusive</code> and the solutions in <a href="https://stackoverflow.com/q/27893223/155423">How do I iterate over a range with a custom step?</a>:</p>
  
  <pre><code>use std::iter::range_step_inclusive;
  for i in range_step_inclusive(0, n, 2) {
      println!("i: {}", i);
  }
  </code></pre>
  
  <p>But it seems like it isn't available in Rust 1.1:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: unresolved import `std::iter::range_step_inclusive`. There is no `range_step_inclusive` in `std::iter`
  </code></pre>
  
  <p>What would be an alternative? Possibly the idiomatic way for creating custom ranges.</p>