See issue [1] for some discussion. The reason was that A) people are
bound to expect ret to return from the outer function, which we don't
support in most cases, and B) I am in the process of adding a case
(for loops on top of blocks) where we *do* support returning out of
the outer function from a block, and treating ret differently in
different kinds of blocks seems like a bad idea.

When going over the existing code that was using ret in blocks, I did
find two cases that had to be transformed with a big, right-drifting
if, but the rest were loops that would have benefited from proper
ret/cont/break support. So yeah, it's not all roses, but I'd argue
that huge blocks aren't very good style, and they might benefit from
being factored into a few top-level functions.

[1]: https://github.com/mozilla/rust/issues/1619

Best,
Marijn
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to