diff --git a/xtask/src/check_raw.rs b/xtask/src/check_raw.rs index 6f638ff4..d5c326eb 100644 --- a/xtask/src/check_raw.rs +++ b/xtask/src/check_raw.rs @@ -323,7 +323,12 @@ fn check_fields(fields: &Punctuated, src: &Path) -> Result<(), Err } /// List with allowed combinations of representations (see [`Repr`]). -const ALLOWED_REPRS: &[&[Repr]] = &[&[Repr::C], &[Repr::C, Repr::Packed], &[Repr::Transparent]]; +const ALLOWED_REPRS: &[&[Repr]] = &[ + &[Repr::C], + &[Repr::C, Repr::Packed], + &[Repr::Align(8), Repr::C], + &[Repr::Transparent], +]; fn check_type_attrs(attrs: &[Attribute], spanned: &dyn Spanned, src: &Path) -> Result<(), Error> { let attrs = parse_attrs(attrs, src)?; @@ -606,6 +611,20 @@ mod tests { .is_ok() ); + // Valid `repr(C, align(8))` struct. + assert!( + check_struct( + &parse_quote! { + #[repr(C, align(8))] + pub struct S { + pub f: u32, + } + }, + src(), + ) + .is_ok() + ); + // Missing `pub` on struct. check_item_err( parse_quote! {