From d92083d2ec4ae9c4113ddb352aff51c841c8c266 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Thu, 31 Aug 2023 07:29:36 +0200 Subject: [PATCH] Disable `SystemTime` test on `wasm32-wasi` --- src/datetime/tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/datetime/tests.rs b/src/datetime/tests.rs index 4621260f..2077b99a 100644 --- a/src/datetime/tests.rs +++ b/src/datetime/tests.rs @@ -1185,8 +1185,11 @@ fn test_subsecond_part() { assert_eq!(1234567, datetime.timestamp_subsec_nanos()); } +// Some targets, such as `wasm32-wasi`, have a problematic definition of `SystemTime`, such as an +// `i32` (year 2035 problem), or an `u64` (no values before `UNIX-EPOCH`). +// See https://github.com/rust-lang/rust/issues/44394. #[test] -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(all(target_arch = "wasm32", target_os = "wasi"))))] fn test_from_system_time() { use std::time::{Duration, SystemTime, UNIX_EPOCH};