Rollup merge of #143020 - RalfJung:codegen_fn_attrs, r=oli-obk

codegen_fn_attrs: make comment more precise

Follow-up to https://github.com/rust-lang/rust/pull/142854.

r? ``@oli-obk`` or ``@workingjubilee``
This commit is contained in:
Guillaume Gomez
2025-06-27 15:04:54 +02:00
committed by GitHub

View File

@@ -396,7 +396,9 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
}
}
// Apply the minimum function alignment here, so that individual backends don't have to.
// Apply the minimum function alignment here. This ensures that a function's alignment is
// determined by the `-C` flags of the crate it is defined in, not the `-C` flags of the crate
// it happens to be codegen'd (or const-eval'd) in.
codegen_fn_attrs.alignment =
Ord::max(codegen_fn_attrs.alignment, tcx.sess.opts.unstable_opts.min_function_alignment);