Skip to content

Commit 1365d3b

Browse files
committed
codegen_fn_attrs: make comment more precise
1 parent e61dd43 commit 1365d3b

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
@@ -430,7 +430,9 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
430430
}
431431
}
432432

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

0 commit comments

Comments
 (0)