# \[Pre-RFC\] pseudo-closures

**URL:** <https://internals.rust-lang.org/t/pre-rfc-pseudo-closures/9753>\
**Category:** language design\
**Created:** [April 2, 2019, 12:49am UTC](https://internals.rust-lang.org/t/pre-rfc-pseudo-closures/9753 "2019-04-02T00:49:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [April 2, 2019, 1:49am UTC](https://internals.rust-lang.org/t/pre-rfc-pseudo-closures/9753/5 "2019-04-02T01:49:55Z")

</div>

> [@Nokel81](#):
>
> Example 1: returning from parent function in a “non-moveable” closure construct

Probably not, see

> [@pre-RFC: Allow return, continue, and break to affect the captured environment](https://internals.rust-lang.org/t/pre-rfc-allow-return-continue-and-break-to-affect-the-captured-environment/4791):
>
> The general idea is that inside a closure, return; would return from the defining function instead of the closure. fn main() { // `return` would be a divergent expression and return from `main` let id: i32 = "321".parse().or\_else(|| return); } This would allow Rust to satisfy the Tennent’s Correspondence Principle. In short, Tennent’s Correspondence Principle says: For a given expression expr, || expr should be equivalent. You could wrap arbitrary parts function body (even the whole f…

> [@Nokel81](#):
>
> Example 2: using `continue` and `break` as “closures”

Same problem. Use `try_fold` instead of `fold`, and similar, instead.

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-pseudo-closures/9753)._
