Pre-RFC: Break with value in for/while loops

Generator<Return=!> is a quite natural way to model an endless counter or an event source. Making it awkward to break an loop based on it will make generators a much less attractive feature.

You keep bringing up examples with generators returning Result<_, E>. But what if the loop body wants to raise an error not covered by E? (For example, the loop body receives a raw packet of data from the generator and wants to raise a ParseError, as opposed to an io::Error that the original generator can raise.) You'd have to keep using combinators just to to extend the range of possible errors; in other words, you'd be fighting the type checker instead of working with it. This design doesn't work all that well even for your own use case, never mind others.

And like I said before, if you don't mind adding combinators, you might as well add an iteration combinator instead of extending the semantics of the for loop.

I think a more expressive language is worth the price of occasionally having to type a seemingly superfluous semicolon. It's just syntax after all. If I cannot convince you of this, then I believe there is no point in continuing this line of discussion.

(Pedantic point: every match yields a value, and every function has a return type. Sometimes the type is (), but that's still a type like any other.)