From eb4c4b2efbdd216a9834a5b0b716b8fc0a30833a Mon Sep 17 00:00:00 2001 From: myl7 Date: Mon, 5 Aug 2024 15:04:21 +0800 Subject: [PATCH] Allow unused imports for some statements to remove warnings --- src/unix/linux_like/emscripten/lfs64.rs | 5 +++++ src/unix/linux_like/linux/musl/lfs64.rs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/unix/linux_like/emscripten/lfs64.rs b/src/unix/linux_like/emscripten/lfs64.rs index 1616cc90494be..a90a76695ffd2 100644 --- a/src/unix/linux_like/emscripten/lfs64.rs +++ b/src/unix/linux_like/emscripten/lfs64.rs @@ -106,7 +106,12 @@ pub unsafe extern "C" fn mmap64( // // These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an // argument, nor do their names clash with any declared types. +// +// Targets wasm32-unknown-emscripten in CI recognize them as unused imports. +// Like the same one at src/unix/linux_like/linux/musl/lfs64.rs, here they are also allowed. +#[allow(unused_imports)] pub use open as open64; +#[allow(unused_imports)] pub use openat as openat64; #[inline] diff --git a/src/unix/linux_like/linux/musl/lfs64.rs b/src/unix/linux_like/linux/musl/lfs64.rs index 27c1d25836d68..fdc80a72813ff 100644 --- a/src/unix/linux_like/linux/musl/lfs64.rs +++ b/src/unix/linux_like/linux/musl/lfs64.rs @@ -114,7 +114,12 @@ pub unsafe extern "C" fn mmap64( // // These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an // argument, nor do their names clash with any declared types. +// +// Targets i686-unknown-linux-musl and arm-unknown-linux-musleabihf in CI recognize them as unused imports. +// Since `dead_code` is already allowed at the crate level, here they are also allowed. +#[allow(unused_imports)] pub use open as open64; +#[allow(unused_imports)] pub use openat as openat64; #[inline]