Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_mir_transform/src/cross_crate_inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ fn cross_crate_inlinable(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
// #[inline(never)] to force code generation.
match codegen_fn_attrs.inline {
InlineAttr::Never => return false,
InlineAttr::Hint | InlineAttr::Always | InlineAttr::Force { .. } => return true,
// For -Copt-level=0, we won't inline functions anyways, so there's no reason to codegen them as LocalCopy.
InlineAttr::Hint if tcx.sess.opts.optimize != OptLevel::No => return true,
InlineAttr::Always | InlineAttr::Force { .. } => return true,
_ => {}
}

Expand Down
Loading