I've been using abort strategy before to reduce size of the binary in places where I don't need unwinding, but recently I found out about panic_immediate_abort flag after reading the source code of new Windows editor.
Using panic = "abort" instead of panic = "unwind" removes unwinding support β functions no longer need to handle dropping values in reaction to a panic within them. The panic hook is still called, but after it returns, the process is aborted.
Using panic_immediate_abort removes the panic hook, panic messages, and related string formatting, because as soon as a panic is started, the process aborts.
Just like panic = abort, it allows controlling the behavior of other panic sites, like the ones built in to std. You canβt do that by inserting exit in your own code. Even if you set up a #[panic_handler] (which you can't do in std) that exits, panic sites that call the panic handler will still contain the string formatting. This appears to be the original PR:
It stop asserts and panics from libstd to automatically include string output and formatting code.
Use case: developing static executables smaller than 50 kilobytes, where usual formatting code is excessive while keeping debuggability in debug mode.