3 ms·
You can use something like `no_panic`[1]. You could also do it statically, post-build, by looking for calls to the panic handler. [1]: https://docs.rs/no-pani
by woodruffw 2y ago
You can use something like `no_panic`[1].
You could also do it statically, post-build, by looking for calls to the panic handler.
[1]: https://docs.rs/no-panic/latest/no_panic/ https://docs.rs/no-panic/latest/no_panic/
- bpicolo 2y agoDoes annotating `main` with no_panic do the trick? How much does that tend to affect compile times, do you know?
- woodruffw 2y ago> Does annotating `main` with no_panic do the trick? I've never tried that, so maybe :-) > How much does that tend to affect compile times, do you know? IME, not very much -- there might be a small amount of overhead, but the "trick" behind the check is to fail the linker with a symbol error if the panic code is inserted into a function. So the compiler itself should be roughly as fast, and the error path in the linker is really the only thing that should change too much.