4 ms·
Are generics not inlined when appropriate even without #[inline] or LTO?
by ben0x539 11y ago
Are generics not inlined when appropriate even without #[inline] or LTO?
- kibwen 11y agoYou don't need the #[inline] attribute when generics are involved, because Rust already has to cross-crate-export function metadata when generics are involved because otherwise it would be impossible to monomorphize. At that point, LLVM will inline the monomorphized functions as it deems fit.