From 5978e194564d628afe2e54cc1068d0791a7e2e8d Mon Sep 17 00:00:00 2001 From: joboet Date: Thu, 15 Jan 2026 14:57:03 +0100 Subject: [PATCH] std: move time implementations to `sys` (VEX) Now that the `unsupported` module exists, we can use it for VEX. VEX actually supports `Instant` though, so the implementation-select needs to combine that with the `unsupported` module. --- library/std/src/sys/pal/vexos/mod.rs | 1 - library/std/src/sys/time/mod.rs | 10 ++++++++++ .../std/src/sys/{pal/vexos/time.rs => time/vexos.rs} | 5 ----- 3 files changed, 10 insertions(+), 6 deletions(-) rename library/std/src/sys/{pal/vexos/time.rs => time/vexos.rs} (83%) diff --git a/library/std/src/sys/pal/vexos/mod.rs b/library/std/src/sys/pal/vexos/mod.rs index 0abfc2fd7986..16aa3f088f04 100644 --- a/library/std/src/sys/pal/vexos/mod.rs +++ b/library/std/src/sys/pal/vexos/mod.rs @@ -1,5 +1,4 @@ pub mod os; -pub mod time; #[expect(dead_code)] #[path = "../unsupported/common.rs"] diff --git a/library/std/src/sys/time/mod.rs b/library/std/src/sys/time/mod.rs index 81c568bf9320..0e3376e2f910 100644 --- a/library/std/src/sys/time/mod.rs +++ b/library/std/src/sys/time/mod.rs @@ -6,6 +6,16 @@ cfg_select! { mod sgx; use sgx as imp; } + target_os = "vexos" => { + mod vexos; + #[expect(unused)] + mod unsupported; + + mod imp { + pub use super::vexos::Instant; + pub use super::unsupported::{SystemTime, UNIX_EPOCH}; + } + } target_os = "xous" => { mod xous; use xous as imp; diff --git a/library/std/src/sys/pal/vexos/time.rs b/library/std/src/sys/time/vexos.rs similarity index 83% rename from library/std/src/sys/pal/vexos/time.rs rename to library/std/src/sys/time/vexos.rs index f95d96cd27ac..966c239699ce 100644 --- a/library/std/src/sys/pal/vexos/time.rs +++ b/library/std/src/sys/time/vexos.rs @@ -1,10 +1,5 @@ use crate::time::Duration; -#[expect(dead_code)] -#[path = "../unsupported/time.rs"] -mod unsupported_time; -pub use unsupported_time::{SystemTime, UNIX_EPOCH}; - #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] pub struct Instant(Duration);