Re:Rust for C++ programmers – part 2: control flow
by pcwalton on Sunday April 20, 2014 @04:11AM
(#7616216)
Yeah, I would rather have "for" defined only to operate on Iterables. If we modified the trait matching rules we could probably do that backwards compatibly post 1.0.
Iterator implements Iterable as a trivial self-return (by default), and `for` only and always takes an Iterable?
> what if you implement both?
Depends what sort of weirdness you're trying to do I guess.
> I believe it didn't work with the trait matching rules.
Ah. Too bad.