Support #[align(…)] on fns in extern blocks

This commit is contained in:
Jules Bertholet
2025-06-29 13:01:41 -04:00
parent 97a7b9b1b4
commit a1cefee8d5
2 changed files with 15 additions and 1 deletions

View File

@@ -1915,7 +1915,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
/// Checks if the `#[align]` attributes on `item` are valid.
fn check_align(&self, span: Span, target: Target, align: Align, repr_span: Span) {
match target {
Target::Fn | Target::Method(_) => {}
Target::Fn | Target::Method(_) | Target::ForeignFn => {}
Target::Struct | Target::Union | Target::Enum => {
self.dcx().emit_err(errors::AlignShouldBeReprAlign {
span: repr_span,