diff options
| author | Ralf Jung <post@ralfj.de> | 2025-03-17 12:10:43 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-03-25 08:22:35 +0100 |
| commit | c961d123d2df8d9fec6d997a6725b88eabe8d5de (patch) | |
| tree | 9b20dd43ddd5c6553d62d8f59c04afc404d54caa /compiler/rustc_target/src | |
| parent | be73c1f4617c97bce81b2694a767353300a75072 (diff) | |
| download | rust-c961d123d2df8d9fec6d997a6725b88eabe8d5de.tar.gz rust-c961d123d2df8d9fec6d997a6725b88eabe8d5de.zip | |
add FCW to warn about wasm ABI transition
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/callconv/wasm.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/callconv/wasm.rs b/compiler/rustc_target/src/callconv/wasm.rs index 364a6551131..881168c98c3 100644 --- a/compiler/rustc_target/src/callconv/wasm.rs +++ b/compiler/rustc_target/src/callconv/wasm.rs @@ -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; |
