Wasm sized and decode for void values

This commit is contained in:
Ayaz Hafiz 2022-07-18 12:37:48 -04:00
parent 6802c3e2b1
commit efc11bd7ed
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 11 additions and 0 deletions

View file

@ -31,6 +31,11 @@ impl Wasm32Sized for () {
const ALIGN_OF_WASM: usize = 0;
}
impl Wasm32Sized for std::convert::Infallible {
const SIZE_OF_WASM: usize = 0;
const ALIGN_OF_WASM: usize = 0;
}
impl Wasm32Sized for RocStr {
const SIZE_OF_WASM: usize = 12;
const ALIGN_OF_WASM: usize = 4;

View file

@ -182,3 +182,9 @@ impl<T: FromWasm32Memory, U: FromWasm32Memory, V: FromWasm32Memory> FromWasm32Me
(t, u, v)
}
}
impl FromWasm32Memory for std::convert::Infallible {
fn decode(_memory_bytes: &[u8], _offset: u32) -> Self {
unreachable!()
}
}