3 ms·
That's not all it does. It "breaks" to the nearest "try" barrier. It's basically the desugaring of the Err branch in the ? operator, that you can't currently ex
by CryZe 4y ago
That's not all it does. It "breaks" to the nearest "try" barrier. It's basically the desugaring of the Err branch in the ? operator, that you can't currently express yourself. It's mostly relevant for try blocks. I guess you'd most commonly see this in "control flow like" macros that are similar to the ? operator, like various assertion macros that want to "yeet" an error in case the assertion fails (instead of panicking like those in std).
So in a sense it actually is very similar to `throw` in traditional languages, as it can be caught inside the same function and isn't forced to `return` the error outside the function.