summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-26 21:23:50 +0100
committerGitHub <noreply@github.com>2024-03-26 21:23:50 +0100
commitac5ffa51cd6bfdaa0edfc8774b150ae3c175682f (patch)
treef522ce01f910b1061da43449f0c7e67d7e8dcef7 /library/std/src
parentb8e8d658a7baa97408a8aece986e84577685af08 (diff)
parent7b4e5079619f99a1bff8a2f388b498be5687d280 (diff)
downloadrust-ac5ffa51cd6bfdaa0edfc8774b150ae3c175682f.tar.gz
rust-ac5ffa51cd6bfdaa0edfc8774b150ae3c175682f.zip
Rollup merge of #123057 - sthibaul:systemtime, r=jhpratt
unix fs: Make hurd using explicit new rather than From

408c0ea2162b ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd build (and probably the horizon build)

Fixes #123032
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/pal/unix/fs.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs
index b968f8df34c..99b6da60c14 100644
--- a/library/std/src/sys/pal/unix/fs.rs
+++ b/library/std/src/sys/pal/unix/fs.rs
@@ -517,7 +517,7 @@ impl FileAttr {
 
     #[cfg(any(target_os = "horizon", target_os = "hurd"))]
     pub fn modified(&self) -> io::Result<SystemTime> {
-        Ok(SystemTime::from(self.stat.st_mtim))
+        SystemTime::new(self.stat.st_mtim.tv_sec as i64, self.stat.st_mtim.tv_nsec as i64)
     }
 
     #[cfg(not(any(
@@ -545,7 +545,7 @@ impl FileAttr {
 
     #[cfg(any(target_os = "horizon", target_os = "hurd"))]
     pub fn accessed(&self) -> io::Result<SystemTime> {
-        Ok(SystemTime::from(self.stat.st_atim))
+        SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64)
     }
 
     #[cfg(any(