Skip to content

Commit 18f05eb

Browse files
committed
codegen_fn_attrs: make comment more precise
1 parent e61dd43 commit 18f05eb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,11 @@ 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+
mixed_export_name_no_mangle_lint_state.lint_if_mixed(tcx);
434+
435+
// Apply the minimum function alignment here. This ensures that a function's alignment is
436+
// determined by the `-C` flags of the crate it is defined in, not the `-C` flags of the crate
437+
// it happens to be codegen'd (or const-eval'd) in.
434438
codegen_fn_attrs.alignment =
435439
Ord::max(codegen_fn_attrs.alignment, tcx.sess.opts.unstable_opts.min_function_alignment);
436440

0 commit comments

Comments
 (0)