From d259f4364738d911128d6e8ad863d0066733a343 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 20 Jun 2018 00:04:59 +0200 Subject: Fix doc build on unknown windows target --- src/libstd/sys/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/mod.rs b/src/libstd/sys/mod.rs index 1231898ed7e..b5bf4044be4 100644 --- a/src/libstd/sys/mod.rs +++ b/src/libstd/sys/mod.rs @@ -67,6 +67,7 @@ cfg_if! { // (missing things in `libc` which is empty) so just omit everything // with an empty module #[unstable(issue = "0", feature = "std_internals")] + #[allow(missing_docs)] pub mod unix_ext {} } else { // On other platforms like Windows document the bare bones of unix @@ -80,6 +81,7 @@ cfg_if! { cfg_if! { if #[cfg(windows)] { // On windows we'll just be documenting what's already available + #[allow(missing_docs)] pub use self::ext as windows_ext; } else if #[cfg(any(target_os = "cloudabi", target_arch = "wasm32"))] { // On CloudABI and wasm right now the shim below doesn't compile, so -- cgit 1.4.1-3-g733a5 From 3c6c18d095b7cdafadffcc7ae3c39b037e4e793d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 25 Jun 2018 20:38:29 +0200 Subject: Add missing \[allow(missing_docs)\] --- src/libstd/sys/mod.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/mod.rs b/src/libstd/sys/mod.rs index b5bf4044be4..c44db3b1072 100644 --- a/src/libstd/sys/mod.rs +++ b/src/libstd/sys/mod.rs @@ -87,6 +87,7 @@ cfg_if! { // On CloudABI and wasm right now the shim below doesn't compile, so // just omit it #[unstable(issue = "0", feature = "std_internals")] + #[allow(missing_docs)] pub mod windows_ext {} } else { // On all other platforms (aka linux/osx/etc) then pull in a "minimal" -- cgit 1.4.1-3-g733a5 From 490f49fd2ab15ae25a6ffeae2de8f667a521f19d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 25 Jun 2018 12:34:33 -0700 Subject: 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. --- src/libstd/sys/unix/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd/sys') 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 { 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 { 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 }) } -- cgit 1.4.1-3-g733a5