These are not exceptions, and I guarantee that you and your users will be very, very miserable if you try to use them as such. :P This is primarily for preventing undefined behavior at FFI boundaries, there are no affordances in the language that make this mechanism anywhere comparable to a real exceptions system from, say, Python.
So much snark.
Error handling is something Rust does really well. Having used exception languages quite a bit I much prefer the forced handled return values.
Exceptions don't map well to the type of handling patterns like and_then(...), or_else(...) and the like which I find much more ergonomic and clean.
Re:Announcing Rust 1.9
by valarauca1 on Thursday May 26, 2016 @03:45PM
(#11780899)
Exceptions can also be a pain to deal with in lazy Iterators. Either every lambda needs to be a try statement, or you need state.
Re:Announcing Rust 1.9
by tatterdemalion on Thursday May 26, 2016 @03:19PM
(#11780725)
Users are strongly and emphatically discouraged from using this for expection-style control flow. This is for managing crashes at the thread or FFI boundary.
In general, we're very happy with monadic error handling and don't want exceptions.
I must say I came into Rust and didn't like the lack of exceptions - and these still aren't. The community explained it to me, and now I'm noticing more cases in other code (C,C#) where the forced error code system (handle or panic) would be far superior.
Having it at the thread boundary is good enough so you can write, say, a webserver, without letting user code or a mishandled request killing the process.
Re:Announcing Rust 1.9
by steveklabnik on Thursday May 26, 2016 @03:20PM
(#11780734)
These are not exceptions, and are not intended to be used like exceptions. They may have an implementation that's kinda sorta similar to exceptions, but that doesn't make them exceptions.
Exceptions, at last! Not very good exceptions, though. About at the level of Go's "recover()". If this is done right, so that locks unlock, destructors run, and reference counts are updated, it's all the complexity of exceptions for some of the benefits.
I'd rather have real exceptions than sort-of exceptions.