Skip to content

Commit b375787

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 146fe45 + 9d11fd0 commit b375787

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
@@ -412,7 +412,9 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
412412

413413
mixed_export_name_no_mangle_lint_state.lint_if_mixed(tcx);
414414

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

0 commit comments

Comments
 (0)