Step_by with 0 should return an infinite iterator like repeat

Now I know why the decision was taken to avoid step_by(0). I am just clarifying some misunderstandings:

  1. I didn't want step_by to behave just like repeat. I wanted it to accept 0 as an argument. Currently it accepts numeric iterators, and I would like it to stay that way.
  2. Also, I understand that the capacity overflow issue is from Vec, I only wanted improved static analysis if possible. Since you mentioned the short circuits I got inspired to create this thread: Applying take() on an infinite iterator should make it exactsizediterator - language design - Rust Internals (rust-lang.org). Once this is finalized, the static analysis on the iterators can be improved further.

Maybe you can comment on this bug report I opened regarding the error message issue: Confusing error message on using step_by and take on infinite iterator · Issue #123637 · rust-lang/rust (github.com)