about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-06-25 18:33:01 +0200
committerRalf Jung <post@ralfj.de>2025-06-27 08:39:17 +0200
commit1365d3ba1fda7c5be7bb8d13042bee8ae724d748 (patch)
treed26e177087cbe8ba1ec6ce18668a3f1d560d5515 /compiler/rustc_codegen_ssa/src
parente61dd437f33b5a640e67dc3628397689c664c17f (diff)
downloadrust-1365d3ba1fda7c5be7bb8d13042bee8ae724d748.tar.gz
rust-1365d3ba1fda7c5be7bb8d13042bee8ae724d748.zip
codegen_fn_attrs: make comment more precise
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/codegen_attrs.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
index 94df5e8b361..8d1973058b0 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -430,7 +430,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);