1
Fork 0

Rollup merge of #135552 - amy-kwan:amy-kwan/reprc-struct-diagnostic-power-alignment, r=workingjubilee

[AIX] Lint on structs that have a different alignment in AIX's C ABI

This PR adds a linting diagnostic on AIX for repr(C) structs that are required to follow
the power alignment rule. A repr(C) struct needs to follow the power alignment rule if
the struct:
- Has a floating-point data type (greater than 4-bytes) as its first member, or
- The first member of the struct is an aggregate, whose recursively first member is a
   floating-point data type (greater than 4-bytes).

The power alignment rule for eligible structs is currently unimplemented, so a linting
diagnostic is produced when such a struct is encountered.
This commit is contained in:
Matthias Krüger 2025-01-23 09:49:19 +01:00 committed by GitHub
commit 9b40bd70de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 411 additions and 16 deletions

View file

@ -1694,6 +1694,10 @@ pub(crate) struct OverflowingLiteral<'a> {
pub lit: String,
}
#[derive(LintDiagnostic)]
#[diag(lint_uses_power_alignment)]
pub(crate) struct UsesPowerAlignment;
#[derive(LintDiagnostic)]
#[diag(lint_unused_comparisons)]
pub(crate) struct UnusedComparisons;