Skip to content

Commit ef6bb5c

Browse files
committed
make clearer that early-exit-from-any-block is not proposed, mention it in "Future possibilities"
1 parent ab63c4f commit ef6bb5c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

active/0000-trait-based-exception-handling.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ constructs, and is independently useful.
132132
The capability can be exposed either by generalizing `break` to take an optional
133133
value argument and break out of any block (not just loops), or by generalizing
134134
`return` to take an optional lifetime argument and return from any block, not
135-
just the outermost block of the function. This feature is independently useful
136-
and I believe it should be added, but as it is only used here in this RFC as an
137-
explanatory device, and implementing the RFC does not require exposing it, I am
135+
just the outermost block of the function. This feature is only used in this RFC as an
136+
explanatory device, and implementing the RFC does not require exposing it, so I am
138137
going to arbitrarily choose the `break` syntax for the following and won't
139138
discuss the question further.
140139

@@ -161,6 +160,8 @@ Here if we don't have a thing, we escape from the block early with `None`.
161160
If no value is specified, it defaults to `()`: in other words, the current behavior.
162161
We can also imagine there is a magical lifetime `'fn` which refers to the lifetime of the whole function: in this case, `break 'fn` is equivalent to `return`.
163162

163+
Again, this RFC does not propose generalizing `break` in this way at this time: it is only used as a way to explain the meaning of the constructs it does propose.
164+
164165

165166
## Definition of constructs
166167

@@ -318,6 +319,10 @@ Without any attempt at completeness, here are some things which should be true:
318319

319320
# Future possibilities
320321

322+
## Expose a generalized form of `break` or `return` as described
323+
324+
This RFC doesn't propose doing so at this time, but as it would be an independently useful feature, it could be added as well.
325+
321326
## An additional `catch` form to bind the caught exception irrefutably
322327

323328
The `catch` described above immediately passes the caught exception into a `match` block.

0 commit comments

Comments
 (0)