Skip to content

Commit ac5ffa5

Browse files
authored
Rollup merge of rust-lang#123057 - sthibaul:systemtime, r=jhpratt
unix fs: Make hurd using explicit new rather than From 408c0ea ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd build (and probably the horizon build) Fixes rust-lang#123032
2 parents b8e8d65 + 7b4e507 commit ac5ffa5

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)