about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-06-26 11:35:41 +0200
committerGitHub <noreply@github.com>2018-06-26 11:35:41 +0200
commit2348dc5b3f8403b28d25e6b95a534b7bb5100fb9 (patch)
tree4800d14e600205fa60155182a0fc81c9de718496 /src/libstd/sys
parent932db193c2f00bbaf23bd8529aa0937e120bceae (diff)
parent490f49fd2ab15ae25a6ffeae2de8f667a521f19d (diff)
downloadrust-2348dc5b3f8403b28d25e6b95a534b7bb5100fb9.tar.gz
rust-2348dc5b3f8403b28d25e6b95a534b7bb5100fb9.zip
Rollup merge of #51786 - cuviper:stat64-pointers, r=Mark-Simulacrum
Remove unnecessary stat64 pointer casts

In effect, these just casted `&mut stat64` to `*mut stat64`, twice.
That's harmless, but it masked a problem when this was copied to new
code calling `fstatat`, which takes a pointer to `struct stat`.  That
will be fixed by #51785, but let's remove the unnecessary casts here
too.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/fs.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
index e186b115821..662a76d6725 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -803,7 +803,7 @@ pub fn stat(p: &Path) -> io::Result<FileAttr> {
     let p = cstr(p)?;
     let mut stat: stat64 = unsafe { mem::zeroed() };
     cvt(unsafe {
-        stat64(p.as_ptr(), &mut stat as *mut _ as *mut _)
+        stat64(p.as_ptr(), &mut stat)
     })?;
     Ok(FileAttr { stat: stat })
 }
@@ -812,7 +812,7 @@ pub fn lstat(p: &Path) -> io::Result<FileAttr> {
     let p = cstr(p)?;
     let mut stat: stat64 = unsafe { mem::zeroed() };
     cvt(unsafe {
-        lstat64(p.as_ptr(), &mut stat as *mut _ as *mut _)
+        lstat64(p.as_ptr(), &mut stat)
     })?;
     Ok(FileAttr { stat: stat })
 }