You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@[align(N)] struct: reading the padded field prints <unsupported> #1445
Reading an @[align(N)] struct field whose alignment inserts padding prints <unsupported> (and a later field of enum type printed <invalid enum> in a larger repro): the field read resolves the padding member's type, not the field's.
type A {
a: i8,
@[align(16)]
b: i64,
c: i64,
}
fn main:
let v = A { a: 5, b: 1111111111111, c: 2222222222222 }
let b = v.b
print(f"a={v.a} b={b} c={v.c} size={size_of[A]()}")
Prints a=5 b=<unsupported> c=2222222222222 size=32; expected b=1111111111111. The size is right (the padded body { i8, [15 x i8], i64, i64 }); declare_struct_type records the LLVM field index in struct_llvm_field_indices, so some read path is indexing the LLVM body by the source field index (or taking the type of LLVM element 1, the padding array).
Activity
Codegen: a field after an @[align(N)] padding member is read by its L…
Codegen: a field after an @[align(N)] padding member is read by its L…
ehartford commentedon Sep 26, 2026
Verified fixed on main 55739d4 (release binary): @[align] padded field prints a=5 b=… size=32.