Re:Making Rust binaries smaller by default
by josephg on Wednesday January 24, 2024 @06:10AM
(#39115977)
Oh no, I didn't know this. I'm adding panic = "abort" to all my projects. If I wanted exceptions I wouldn't be using rust.
[ Parent
| on HN ]
Re:Making Rust binaries smaller by default
by lifthrasiir on Wednesday January 24, 2024 @06:21AM
(#39116024)
That's actually not too bad if you know you don't need to recover from panic. I kinda hope that `panic = "abort"` is indeed default unless overridden by dependencies, say, tokio...
Re:Making Rust binaries smaller by default
by formerly_proven on Wednesday January 24, 2024 @06:33AM
(#39116108)
You can catch them locally (https://doc.rust-lang.org/std/panic/fn.catch_unwind.html) or with a global exception handler (https://doc.rust-lang.org/std/panic/fn.set_hook.html)