Rollup merge of #142715 - folkertdev:fn-align-corrections, r=jdonszelmann

correct template for `#[align]` attribute

Tracking issue: https://github.com/rust-lang/rust/issues/82232
related: https://github.com/rust-lang/rust/pull/142507

I didn't fully understand what `template!` did, clearly. An empty `#[align]` attribute was still rejected later, but without this change it does get suggested in certain cases.

I've also updated some outdated references to `#[repr(align)]` on functions.

r? ``@jdonszelmann``
This commit is contained in:
Jakub Beránek
2025-06-20 20:03:21 +02:00
committed by GitHub
6 changed files with 35 additions and 33 deletions

View File

@@ -273,7 +273,7 @@ pub(crate) struct AlignParser(Option<(Align, Span)>);
impl AlignParser {
const PATH: &'static [Symbol] = &[sym::align];
const TEMPLATE: AttributeTemplate = template!(Word, List: "<alignment in bytes>");
const TEMPLATE: AttributeTemplate = template!(List: "<alignment in bytes>");
fn parse<'c, S: Stage>(
&mut self,