Originally posted by ultimA
View Post
Think what you would do in C++: Disable exceptions, of course. I have only found limited ways to disable panic, but I think this just has to become possible. I see no other way around it in the long term. Maybe as an emergency solution, you could have a custom prelude to (re)define the panic macro to something that doesn't compile or link.
And before anyone mentions the #[no_panic] attribute, adding an attribute to every single function – except the ones you forget – is obviously no solution.
I think Rust made the same mistake as C++ (noexcept) here: Strayed from the otherwise so pervasive principle of doing the safest thing by default: They should obviously have made a #[panics] attribute instead, which very few functions would need. Huge mistake!
Comment