Here’s my humorous attempt at predicting the future:
The year is 2020, Rust has been used in production on many high-profile applications. But one thing has been an issue since 2018: There’s no way to ? out of nested catch blocks.
As the user base grows, and a clear need for ? in nested catch blocks emerges, a proposal from 2018 is revived: labeled ?.
When the original proposal supporting ? with any labeled block is deemed controversial, it is then restricted to only work on catch blocks. This quickly gets accepted and stabilized, and all is well. Until…
One year later, result-producing loops become an important construct in Rust. These simple-sounding constructs have the form:
'one_label: catch {
'other_label: loop {
...;
... 'one_label?;
break 'other_label;
}
}
However, there’s still no clear way to ? out of a function, besides putting a labeled catch block inside the function. To help with this, function definitions are now allowed to take the form:
'label: fn make_me_a_sandwich() -> Result<Sandwich, PrivilegeError> {
Thus allowing exiting the function from nested catch blocks, with 'label?.
Sadly, it’s now 33 years too late, and the only solution seems to be to start over.