mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Fix Wasm compile errors
This commit is contained in:
parent
e56a5695ba
commit
3e511acbcc
3 changed files with 7 additions and 7 deletions
|
@ -51,7 +51,7 @@ use crate::work::{Dependencies, Phase};
|
||||||
#[cfg(not(target_family = "wasm"))]
|
#[cfg(not(target_family = "wasm"))]
|
||||||
use std::time::{Duration, SystemTime};
|
use std::time::{Duration, SystemTime};
|
||||||
#[cfg(target_family = "wasm")]
|
#[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.
|
/// Default name for the binary generated for an app, if an invalid one was specified.
|
||||||
const DEFAULT_APP_OUTPUT_PATH: &str = "app";
|
const DEFAULT_APP_OUTPUT_PATH: &str = "app";
|
||||||
|
@ -650,7 +650,7 @@ impl ModuleTiming {
|
||||||
end_time,
|
end_time,
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
let calculate = |t: Result<Duration, std::time::SystemTimeError>| -> Option<Duration> {
|
let calculate = |t: Result<Duration, _>| -> Option<Duration> {
|
||||||
t.ok()?
|
t.ok()?
|
||||||
.checked_sub(*make_specializations)?
|
.checked_sub(*make_specializations)?
|
||||||
.checked_sub(*find_specializations)?
|
.checked_sub(*find_specializations)?
|
||||||
|
|
|
@ -11,13 +11,13 @@ Instead we use these dummy implementations, which should just disappear at compi
|
||||||
pub struct SystemTime;
|
pub struct SystemTime;
|
||||||
|
|
||||||
impl SystemTime {
|
impl SystemTime {
|
||||||
fn now() -> Self {
|
pub fn now() -> Self {
|
||||||
SystemTime
|
SystemTime
|
||||||
}
|
}
|
||||||
fn duration_since(&self, _: SystemTime) -> Result<Duration, String> {
|
pub fn duration_since(&self, _: SystemTime) -> Result<Duration, String> {
|
||||||
Ok(Duration)
|
Ok(Duration)
|
||||||
}
|
}
|
||||||
fn elapsed(&self) -> Result<Duration, String> {
|
pub fn elapsed(&self) -> Result<Duration, String> {
|
||||||
Ok(Duration)
|
Ok(Duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ impl SystemTime {
|
||||||
pub struct Duration;
|
pub struct Duration;
|
||||||
|
|
||||||
impl Duration {
|
impl Duration {
|
||||||
fn checked_sub(&self, _: Duration) -> Option<Duration> {
|
pub fn checked_sub(&self, _: Duration) -> Option<Duration> {
|
||||||
Some(Duration)
|
Some(Duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1633,7 +1633,7 @@ roc_error_macros::assert_sizeof_all!(FlatType, 3 * 8);
|
||||||
|
|
||||||
roc_error_macros::assert_sizeof_aarch64!((Variable, Option<Lowercase>), 4 * 8);
|
roc_error_macros::assert_sizeof_aarch64!((Variable, Option<Lowercase>), 4 * 8);
|
||||||
roc_error_macros::assert_sizeof_wasm!((Variable, Option<Lowercase>), 4 * 4);
|
roc_error_macros::assert_sizeof_wasm!((Variable, Option<Lowercase>), 4 * 4);
|
||||||
roc_error_macros::assert_sizeof_all!((Variable, Option<Lowercase>), 4 * 8);
|
roc_error_macros::assert_sizeof_default!((Variable, Option<Lowercase>), 4 * 8);
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum Content {
|
pub enum Content {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue