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
Array value constants with tuple elements fail MIR import #382
Bare array constants support primitive elements and nested arrays, but an array whose element is a tuple is rejected during MIR import.
constTABLE:[(u8,u32);2] = [(1,0x1122_3344),(2,0x5566_7788)];#[inline(never)]fnlookup(i:usize) -> u32{let(tag, value) = TABLE[i &1];
value + tag asu32}
Actual: byte lowering rejects the tuple element type
Expected: tuple elements are decoded using rustc's array stride and field offsets
The example intentionally places padding between u8 and u32. Treating tuple fields as tightly packed reads the second field from padding even if tuple construction itself succeeds.
Correctness boundary
Tuple decoding must use rustc layout. Constants containing pointer provenance must not reinterpret relocation placeholder bytes as exposed-provenance pointers; they should fail clearly until relocation-aware aggregate materialization exists.
Acceptance criteria
Arrays of tuples with supported scalar, enum, nested-tuple, and ZST fields lower correctly.
Internal field padding and trailing element-stride padding are preserved.
Direct padded tuple constants use the same layout-aware decoder.
Pointer-bearing tuple arrays fail with a stable, actionable diagnostic.
Existing primitive, nested-array, and pointer-to-array constant behavior remains unchanged.
Supported-feature documentation records the new support and its limitations.
Activity