Skip to content

Commit 599a061

Browse files
Rollup merge of #143020 - RalfJung:codegen_fn_attrs, r=oli-obk
codegen_fn_attrs: make comment more precise Follow-up to #142854. r? ``@oli-obk`` or ``@workingjubilee``
2 parents 3c3a174 + 1365d3b commit 599a061

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
@@ -396,7 +396,9 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
396396
}
397397
}
398398

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

0 commit comments

Comments
 (0)