From db5ecd539c38a4a096f3bc7550698ec1480a2ec4 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 15 Sep 2021 14:58:53 -0400 Subject: [PATCH] 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). --- library/std/src/rt.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/rt.rs b/library/std/src/rt.rs index 72e6c23ee49..4d2d46f5aab 100644 --- a/library/std/src/rt.rs +++ b/library/std/src/rt.rs @@ -59,10 +59,10 @@ fn lang_start( 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 }