Make error_and_exit inline(never) and cold

This commit is contained in:
Richard Feldman 2024-06-30 06:47:54 -04:00
parent 6102e38f33
commit 39144a198d
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -32,6 +32,8 @@ const STD_ERROR_HANDLE: i32 = -12;
/// Print each of the given strings to stderr (if it's available; on wasm, nothing will
/// be printed) and then immediately exit the program with an error.
/// On wasm, this will trap, and on UNIX or Windows it will exit with a code of 1.
#[inline(never)]
#[cold]
#[cfg(any(unix, windows, target_arch = "wasm32"))]
pub fn error_and_exit(args: fmt::Arguments) -> ! {
use fmt::Write;