# Break with value alternatives

**URL:** <https://internals.rust-lang.org/t/break-with-value-alternatives/11240>\
**Category:** language design\
**Created:** [November 5, 2019, 2:18pm UTC](https://internals.rust-lang.org/t/break-with-value-alternatives/11240 "2019-11-05T14:18:56Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![RustyYato](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/rustyyato/32/13627_2.png) [@RustyYato](https://internals.rust-lang.org/u/RustyYato)\
**Post date:** [November 5, 2019, 4:04pm UTC](https://internals.rust-lang.org/t/break-with-value-alternatives/11240/14 "2019-11-05T16:04:29Z")

</div>

> [@Pre-RFC: Break with value in for/while loops](https://internals.rust-lang.org/t/pre-rfc-break-with-value-in-for-while-loops/11208/45):
>
> OK. Or maybe we could ask the mods to split it; I don't think there's any need for secrecy here. But I'm fine with either.

I just saw this, do you know if there is a way to change a PM to a new thread? I think that would work better. Sorry about any possible confusion on this front.

> [@RE: Pre-RFC: Break with value in for/while loops](https://internals.rust-lang.org/t/re-pre-rfc-break-with-value-in-for-while-loops/11238/4):
>
> Are you satisfied with this description?

Yes, this looks fine.

To me, having a feature live as a library as much as possible is more enticing than having it baked into the compiler. Given that we would want generators anyways as a means for co-routines, I think that extending for loops to handle generators would be nicer.

> [@Pre-RFC: Break with value in for/while loops](https://internals.rust-lang.org/t/pre-rfc-break-with-value-in-for-while-loops/11208/41):
>
> Well, much like @Yato, I'd prefer if `break` worked consistently, but I might accept this solution as a concession to backwards compatibility.

How would this work under your desugaring? Will it be a type-based desugaring?

---

_[View the full topic](https://internals.rust-lang.org/t/break-with-value-alternatives/11240)._
