From 1f59a8030d40d7a6e3a047ed7620f5813497b7ea Mon Sep 17 00:00:00 2001 From: Taylor Foxhall Date: Tue, 23 Jul 2024 12:36:52 -0400 Subject: [PATCH] Fix return type of FileAttr methods on AIX target At some point it seems `SystemTime::new` changed from returning `SystemTime` to `io::Result`. 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 ``` --- library/std/src/sys/pal/unix/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index 8308a48f16a..b323da8d859 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -463,15 +463,15 @@ impl FileAttr { #[cfg(target_os = "aix")] impl FileAttr { pub fn modified(&self) -> io::Result { - Ok(SystemTime::new(self.stat.st_mtime.tv_sec as i64, self.stat.st_mtime.tv_nsec as i64)) + SystemTime::new(self.stat.st_mtime.tv_sec as i64, self.stat.st_mtime.tv_nsec as i64) } pub fn accessed(&self) -> io::Result { - Ok(SystemTime::new(self.stat.st_atime.tv_sec as i64, self.stat.st_atime.tv_nsec as i64)) + SystemTime::new(self.stat.st_atime.tv_sec as i64, self.stat.st_atime.tv_nsec as i64) } pub fn created(&self) -> io::Result { - Ok(SystemTime::new(self.stat.st_ctime.tv_sec as i64, self.stat.st_ctime.tv_nsec as i64)) + SystemTime::new(self.stat.st_ctime.tv_sec as i64, self.stat.st_ctime.tv_nsec as i64) } }