about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-27 15:04:54 +0200
committerGitHub <noreply@github.com>2025-06-27 15:04:54 +0200
commit599a061b93cf65fc28f6b15c72ee5eaa39f625be (patch)
tree1012aa2c37c016294189b3d73b2f976c469e9874 /compiler/rustc_codegen_ssa/src
parent3c3a17457b0321a35a74441b07b0f315727ab223 (diff)
parent1365d3ba1fda7c5be7bb8d13042bee8ae724d748 (diff)
downloadrust-599a061b93cf65fc28f6b15c72ee5eaa39f625be.tar.gz
rust-599a061b93cf65fc28f6b15c72ee5eaa39f625be.zip
Rollup merge of #143020 - RalfJung:codegen_fn_attrs, r=oli-obk
codegen_fn_attrs: make comment more precise

Follow-up to https://github.com/rust-lang/rust/pull/142854.

r? ``@oli-obk`` or ``@workingjubilee``
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 716b2d76c62..acdda32d58a 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -396,7 +396,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);