News for hackers. Stuff that matters.
Re:The Year of C++ Successor Languages by cyber_kinetist on Monday January 02, 2023 @06:26AM (#34216773)
No, you do have to worry about that too in Rust. (If you're writing only Safe Rust then probably not, but then that also applies to C++ if you're adhering to the rule of zero and extensively use the STL containers for all your memory allocation needs).

Exceptions do exist in Rust, and you do need to catch it explicitly at the FFI boundary. [1][2] And the programmer needs to take care their abstractions are safe with stack unwinding when writing any kind of unsafe code in Rust. (For an example: [3])

[1] https://doc.rust-lang.org/nomicon/unwinding.html

[2] https://doc.rust-lang.org/std/panic/fn.catch_unwind.html

[3] https://doc.rust-lang.org/nomicon/exception-safety.html

There are no comments on this comment yet.