diff --git a/compiler/load/src/file.rs b/compiler/load/src/file.rs index 6c84a94d0a..0e515ec254 100644 --- a/compiler/load/src/file.rs +++ b/compiler/load/src/file.rs @@ -51,7 +51,7 @@ use crate::work::{Dependencies, Phase}; #[cfg(not(target_family = "wasm"))] use std::time::{Duration, SystemTime}; #[cfg(target_family = "wasm")] -use wasm_system_time::{Duration, SystemTime}; +use crate::wasm_system_time::{Duration, SystemTime}; /// Default name for the binary generated for an app, if an invalid one was specified. const DEFAULT_APP_OUTPUT_PATH: &str = "app"; @@ -650,7 +650,7 @@ impl ModuleTiming { end_time, } = self; - let calculate = |t: Result| -> Option { + let calculate = |t: Result| -> Option { t.ok()? .checked_sub(*make_specializations)? .checked_sub(*find_specializations)? diff --git a/compiler/load/src/wasm_system_time.rs b/compiler/load/src/wasm_system_time.rs index 9709c1e22d..4fa9728871 100644 --- a/compiler/load/src/wasm_system_time.rs +++ b/compiler/load/src/wasm_system_time.rs @@ -11,13 +11,13 @@ Instead we use these dummy implementations, which should just disappear at compi pub struct SystemTime; impl SystemTime { - fn now() -> Self { + pub fn now() -> Self { SystemTime } - fn duration_since(&self, _: SystemTime) -> Result { + pub fn duration_since(&self, _: SystemTime) -> Result { Ok(Duration) } - fn elapsed(&self) -> Result { + pub fn elapsed(&self) -> Result { Ok(Duration) } } @@ -26,7 +26,7 @@ impl SystemTime { pub struct Duration; impl Duration { - fn checked_sub(&self, _: Duration) -> Option { + pub fn checked_sub(&self, _: Duration) -> Option { Some(Duration) } } diff --git a/compiler/types/src/subs.rs b/compiler/types/src/subs.rs index 7dac3c50c7..3227c58796 100644 --- a/compiler/types/src/subs.rs +++ b/compiler/types/src/subs.rs @@ -1633,7 +1633,7 @@ roc_error_macros::assert_sizeof_all!(FlatType, 3 * 8); roc_error_macros::assert_sizeof_aarch64!((Variable, Option), 4 * 8); roc_error_macros::assert_sizeof_wasm!((Variable, Option), 4 * 4); -roc_error_macros::assert_sizeof_all!((Variable, Option), 4 * 8); +roc_error_macros::assert_sizeof_default!((Variable, Option), 4 * 8); #[derive(Clone, Debug)] pub enum Content {