rust/library/std
Jonathan Brouwer f1922ffe3b
Rollup merge of #151004 - apple-sleep-until, r=ChrisDenton
std: implement `sleep_until` on Apple platforms

On Apple platforms, `nanosleep` is internally [implemented](55b54c0a0c/gen/nanosleep.c (L281)) using `mach_wait_until`, a function that waits until a deadline specified in terms of `mach_absolute_time`. Since `mach_wait_until` is [public](f6217f891a/osfmk/mach/mach_time.h (L50-L51))[^1], we can use it to implement `sleep_until` by converting `Instant`s (which are measured against `CLOCK_UPTIME_RAW`, which is equivalent to `mach_absolute_time`) into `mach_absolute_time` values.

Related tracking issue: https://github.com/rust-lang/rust/issues/113752

[^1]: It's badly documented, but it's defined in the same header as `mach_absolute_time`, which  `std` used to use for `Instant` before rust-lang/rust#116238.
2026-01-19 20:53:21 +01:00
..
benches benchmark path.components() iteration 2025-10-25 14:46:58 +02:00
src Rollup merge of #151004 - apple-sleep-until, r=ChrisDenton 2026-01-19 20:53:21 +01:00
tests time: Add saturating arithmetic for SystemTime 2026-01-16 11:52:01 +01:00
build.rs Update to new API, allowing to remove check_doc_cfg.rs file from librustdoc 2025-12-10 12:28:08 +01:00
Cargo.toml Remove std_detect_file_io and std_detect_dlsym_getauxval features 2026-01-08 14:50:12 +00:00