about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTaylor Foxhall <lxmachina@gmail.com>2024-07-23 12:36:52 -0400
committerGitHub <noreply@github.com>2024-07-23 12:36:52 -0400
commit1f59a8030d40d7a6e3a047ed7620f5813497b7ea (patch)
treee7e71715c8ead1cff12331c7c9f1913a47b953cd
parentd53dc752d2bc0a9e7f7e2e5f82aff03a6d222614 (diff)
downloadrust-1f59a8030d40d7a6e3a047ed7620f5813497b7ea.tar.gz
rust-1f59a8030d40d7a6e3a047ed7620f5813497b7ea.zip
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
```
-rw-r--r--library/std/src/sys/pal/unix/fs.rs6
1 files 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<SystemTime> {
-        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<SystemTime> {
-        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<SystemTime> {
-        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)
     }
 }