about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2018-06-25 12:34:33 -0700
committerJosh Stone <jistone@redhat.com>2018-06-25 12:34:33 -0700
commit490f49fd2ab15ae25a6ffeae2de8f667a521f19d (patch)
tree76dd931fd5f828e8ac6ca857952cdecce9126863 /src/libstd/sys
parent8acec1f9d0b40dde142e6c26d7358b9ab232d2b4 (diff)
downloadrust-490f49fd2ab15ae25a6ffeae2de8f667a521f19d.tar.gz
rust-490f49fd2ab15ae25a6ffeae2de8f667a521f19d.zip
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 774340388e1..93e2f4425b6 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -787,7 +787,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 })
 }
@@ -796,7 +796,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 })
 }