News for hackers. Stuff that matters.
Re:The Inevitability of the Borrow Checker by brokencode on Friday February 07, 2025 @08:37PM (#42979532)
The situation in Rust seems to be a bit complicated. But I did find that panicking within a thread you spawn kills just that thread and not the whole program. And it seems that Tokio has the same behavior.

https://github.com/tokio-rs/tokio/issues/2002#issuecomment-6...

And web frameworks like Tower provide standard ways of handling panics and turning them into error responses.

https://docs.rs/tower-http/latest/tower_http/catch_panic/ind...

So I don’t think panics are necessarily meant to be program-killing in Rust, even if Result types are heavily recommended instead.

There are no comments on this comment yet.