Skip to content

Commit 38f0a16

Browse files
Rollup merge of rust-lang#143020 - RalfJung:codegen_fn_attrs, r=oli-obk
codegen_fn_attrs: make comment more precise Follow-up to rust-lang#142854. r? `@oli-obk` or `@workingjubilee`
2 parents e0f9483 + 9d11fd0 commit 38f0a16

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
446446

447447
mixed_export_name_no_mangle_lint_state.lint_if_mixed(tcx);
448448

449-
// Apply the minimum function alignment here, so that individual backends don't have to.
449+
// Apply the minimum function alignment here. This ensures that a function's alignment is
450+
// determined by the `-C` flags of the crate it is defined in, not the `-C` flags of the crate
451+
// it happens to be codegen'd (or const-eval'd) in.
450452
codegen_fn_attrs.alignment =
451453
Ord::max(codegen_fn_attrs.alignment, tcx.sess.opts.unstable_opts.min_function_alignment);
452454

0 commit comments

Comments
 (0)