Skip to content

Commit

Permalink
Unrolled build for rust-lang#123057
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rust-timer authored Mar 27, 2024
2 parents 47ecded + 7b4e507 commit 7abf3e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7abf3e8

Please sign in to comment.