Skip to content

Commit db5ecd5

Browse files
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).
1 parent 2c7bc5e commit db5ecd5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/rt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ fn lang_start<T: crate::process::Termination + 'static>(
5959
argc: isize,
6060
argv: *const *const u8,
6161
) -> isize {
62-
lang_start_internal(
62+
let Ok(v) = lang_start_internal(
6363
&move || crate::sys_common::backtrace::__rust_begin_short_backtrace(main).report(),
6464
argc,
6565
argv,
66-
)
67-
.into_ok()
66+
);
67+
v
6868
}

0 commit comments

Comments
 (0)