Avoid codegen for Result::into_ok in lang_start

Otherwise, we end up pulling in an extra module as part of codegen, and that
costs us a sizeable amount of work (both in LLVM and outside).
This commit is contained in:
Mark Rousskov 2021-09-15 14:58:53 -04:00
parent 2c7bc5e33c
commit db5ecd539c

View File

@ -59,10 +59,10 @@ fn lang_start<T: crate::process::Termination + 'static>(
argc: isize,
argv: *const *const u8,
) -> isize {
lang_start_internal(
let Ok(v) = lang_start_internal(
&move || crate::sys_common::backtrace::__rust_begin_short_backtrace(main).report(),
argc,
argv,
)
.into_ok()
);
v
}