mirror of
https://github.com/rust-osdev/uefi-rs
synced 2026-08-26 18:26:05 -04:00
xtask: allow align 8 in check-raw
We need this for the layout fix for MemoryDescriptor.
This commit is contained in:
parent
e72d1269c9
commit
0cfe38cf30
1 changed files with 20 additions and 1 deletions
|
|
@ -323,7 +323,12 @@ fn check_fields(fields: &Punctuated<Field, Comma>, 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! {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue