Skip to content

Commit 6242470

Browse files
authored
Rollup merge of rust-lang#128106 - hallfox:patch-1, r=ChrisDenton
Fix return type of FileAttr methods on AIX target At some point it seems `SystemTime::new` changed from returning `SystemTime` to `io::Result<SystemTime>`. This seems to have been addressed on other platforms, but was never changed for AIX. This was caught by running ``` python3 x.py build --host x86_64-unknown-linux-gnu --target powerpc64-ibm-aix ```
2 parents de086ea + 45f80e6 commit 6242470

File tree

1 file changed

+3
-3
lines changed
  • std/src/sys/pal/unix

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,15 @@ impl FileAttr {
463463
#[cfg(target_os = "aix")]
464464
impl FileAttr {
465465
pub fn modified(&self) -> io::Result<SystemTime> {
466-
Ok(SystemTime::new(self.stat.st_mtime.tv_sec as i64, self.stat.st_mtime.tv_nsec as i64))
466+
SystemTime::new(self.stat.st_mtime.tv_sec as i64, self.stat.st_mtime.tv_nsec as i64)
467467
}
468468

469469
pub fn accessed(&self) -> io::Result<SystemTime> {
470-
Ok(SystemTime::new(self.stat.st_atime.tv_sec as i64, self.stat.st_atime.tv_nsec as i64))
470+
SystemTime::new(self.stat.st_atime.tv_sec as i64, self.stat.st_atime.tv_nsec as i64)
471471
}
472472

473473
pub fn created(&self) -> io::Result<SystemTime> {
474-
Ok(SystemTime::new(self.stat.st_ctime.tv_sec as i64, self.stat.st_ctime.tv_nsec as i64))
474+
SystemTime::new(self.stat.st_ctime.tv_sec as i64, self.stat.st_ctime.tv_nsec as i64)
475475
}
476476
}
477477

0 commit comments

Comments
 (0)