add FCW to warn about wasm ABI transition

This commit is contained in:
Ralf Jung 2025-03-17 12:10:43 +01:00
parent be73c1f461
commit c961d123d2
8 changed files with 259 additions and 13 deletions

View file

@ -10,6 +10,9 @@ where
if val.layout.is_aggregate() {
if let Some(unit) = val.layout.homogeneous_aggregate(cx).ok().and_then(|ha| ha.unit()) {
let size = val.layout.size;
// This size check also catches over-aligned scalars as `size` will be rounded up to a
// multiple of the alignment, and the default alignment of all scalar types on wasm
// equals their size.
if unit.size == size {
val.cast_to(unit);
return true;