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.
This commit is contained in:
joboet 2026-01-15 14:57:03 +01:00
parent 29b16c0a55
commit 5978e19456
No known key found for this signature in database
GPG key ID: 704E0149B0194B3C
3 changed files with 10 additions and 6 deletions

View file

@ -1,5 +1,4 @@
pub mod os;
pub mod time;
#[expect(dead_code)]
#[path = "../unsupported/common.rs"]

View file

@ -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;

View file

@ -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);