Skip to content

Commit d02fc8e

Browse files
sthibaulcuviper
authored andcommitted
unix fs: Make hurd and horizon using explicit new rather than From
408c0ea ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd and horizon builds. Fixes rust-lang#123032 (cherry picked from commit 7b4e507)
1 parent 986e6f7 commit d02fc8e

File tree

1 file changed

+2
-2
lines changed
  • library/std/src/sys/pal/unix

1 file changed

+2
-2
lines changed

library/std/src/sys/pal/unix/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ impl FileAttr {
517517

518518
#[cfg(any(target_os = "horizon", target_os = "hurd"))]
519519
pub fn modified(&self) -> io::Result<SystemTime> {
520-
Ok(SystemTime::from(self.stat.st_mtim))
520+
SystemTime::new(self.stat.st_mtim.tv_sec as i64, self.stat.st_mtim.tv_nsec as i64)
521521
}
522522

523523
#[cfg(not(any(
@@ -545,7 +545,7 @@ impl FileAttr {
545545

546546
#[cfg(any(target_os = "horizon", target_os = "hurd"))]
547547
pub fn accessed(&self) -> io::Result<SystemTime> {
548-
Ok(SystemTime::from(self.stat.st_atim))
548+
SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64)
549549
}
550550

551551
#[cfg(any(

0 commit comments

Comments
 (0)