rust/library
bors 24a0eecf03 Auto merge of #96657 - cuviper:time64, r=joshtriplett
Use 64-bit time on 32-bit linux-gnu

The standard library suffered the [Year 2038 problem][Y2038] in two main places on targets with 32-bit `time_t`:

- In `std::time::SystemTime`, we stored a `timespec` that has `time_t` seconds. This is now changed to directly store 64-bit seconds and nanoseconds, and on 32-bit linux-gnu we try to use `__clock_gettime64` (glibc 2.34+) to get the larger timestamp.

- In `std::fs::Metadata`, we store a `stat64`, which has 64-bit `off_t` but still 32-bit `time_t`, and unfortunately that is baked in the API by the (deprecated) `MetadataExt::as_raw_stat()`. However, we can use `statx` for 64-bit `statx_timestamp` to store in addition to the `stat64`, as we already do to support creation time, and the rest of the `MetadataExt` methods can return those full values. Note that some filesystems may still be limited in their actual timestamp support, but that's not something Rust can change.

There remain a few places that need `timespec` for system call timeouts -- I leave that to future work.

[Y2038]: https://en.wikipedia.org/wiki/Year_2038_problem
2022-05-07 17:53:59 +00:00
..
alloc Auto merge of #95183 - ibraheemdev:arc-count-acquire, r=Amanieu 2022-05-06 14:53:24 +00:00
backtrace@b02ed04a7e
core Fix a minor typo in the description of Formatter 2022-05-07 19:32:54 +09:00
panic_abort fix some unused constant warning on some Windows targets 2022-04-08 08:36:56 -04:00
panic_unwind
portable-simd portable-simd: use simd_arith_offset to avoid ptr-int transmutation 2022-04-12 11:09:26 -04:00
proc_macro Show invisible delimeters (within comments) when pretty printing. 2022-05-04 10:06:06 +10:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #96657 - cuviper:time64, r=joshtriplett 2022-05-07 17:53:59 +00:00
stdarch@d215afe9d1 Bump stdarch 2022-04-11 21:40:31 -04:00
test Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrum 2022-04-07 07:34:04 +00:00
unwind Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrum 2022-04-07 07:34:04 +00:00