Skip to content

Commit 074d692

Browse files
committed
Automatically enable cross-crate inlining for small functions
1 parent ad1c965 commit 074d692

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

alloc/src/raw_vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ fn alloc_guard(alloc_size: usize) -> Result<(), TryReserveError> {
530530
// ensure that the code generation related to these panics is minimal as there's
531531
// only one location which panics rather than a bunch throughout the module.
532532
#[cfg(not(no_global_oom_handling))]
533+
#[inline(never)]
533534
fn capacity_overflow() -> ! {
534535
panic!("capacity overflow");
535536
}

std/src/rt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ fn lang_start_internal(
155155
}
156156

157157
#[cfg(not(test))]
158+
#[inline(never)]
158159
#[lang = "start"]
159160
fn lang_start<T: crate::process::Termination + 'static>(
160161
main: fn() -> T,

0 commit comments

Comments
 (0)