mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
test_gen: support RocResult for Wasm tests
This commit is contained in:
parent
617e18af98
commit
a9aee13086
4 changed files with 49 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
use roc_std::{RocDec, RocList, RocOrder, RocStr};
|
||||
use roc_std::{RocDec, RocList, RocOrder, RocStr, RocResult};
|
||||
|
||||
pub trait Wasm32Sized: Sized {
|
||||
const SIZE_OF_WASM: usize;
|
||||
|
@ -41,6 +41,11 @@ impl<T: Wasm32Sized> Wasm32Sized for RocList<T> {
|
|||
const ALIGN_OF_WASM: usize = 4;
|
||||
}
|
||||
|
||||
impl<T: Wasm32Sized, E: Wasm32Sized> Wasm32Sized for RocResult<T, E> {
|
||||
const ALIGN_OF_WASM: usize = max2(T::ALIGN_OF_WASM, E::ALIGN_OF_WASM);
|
||||
const SIZE_OF_WASM: usize = max2(T::ACTUAL_WIDTH, E::ACTUAL_WIDTH) + 1;
|
||||
}
|
||||
|
||||
impl<T: Wasm32Sized> Wasm32Sized for &'_ T {
|
||||
const SIZE_OF_WASM: usize = 4;
|
||||
const ALIGN_OF_WASM: usize = 4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue