-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve dead code warnings on various platforms #1423
Merged
GuillaumeGomez
merged 7 commits into
GuillaumeGomez:master
from
dtolnay-contrib:warnings
Dec 8, 2024
Merged
Resolve dead code warnings on various platforms #1423
GuillaumeGomez
merged 7 commits into
GuillaumeGomez:master
from
dtolnay-contrib:warnings
Dec 8, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
dtolnay
commented
Dec 7, 2024
•
edited
Loading
edited
dtolnay
force-pushed
the
warnings
branch
2 times, most recently
from
December 7, 2024 22:30
2be51d1
to
9a089f5
Compare
dtolnay
changed the title
Resolve warnings on iOS
Resolve dead code warnings on various platforms
Dec 7, 2024
`cargo check --target=aarch64-apple-ios` warning: unused variable: `processes_to_update` --> src/unix/apple/system.rs:234:9 | 234 | processes_to_update: ProcessesToUpdate<'_>, | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_processes_to_update` | = note: `#[warn(unused_variables)]` on by default warning: field `bsd_name` is never read --> src/unix/apple/disk.rs:28:5 | 25 | pub(crate) struct DiskInner { | --------- field in this struct ... 28 | bsd_name: Option<Vec<u8>>, | ^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: type alias `RetainedCFString` is never used --> src/unix/apple/disk.rs:341:17 | 341 | pub(crate) type RetainedCFString = CFReleaser<core_foundation_sys::string::__CFString>; | ^^^^^^^^^^^^^^^^
`cargo check --target=x86_64-apple-darwin --features=apple-sandbox` warning: constant `KIO_RETURN_SUCCESS` is never used --> src/unix/apple/macos/ffi.rs:171:11 | 171 | pub const KIO_RETURN_SUCCESS: i32 = 0; | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `IOServiceMatching` is never used --> src/unix/apple/macos/ffi.rs:133:12 | 133 | pub fn IOServiceMatching(a: *const c_char) -> CFMutableDictionaryRef; | ^^^^^^^^^^^^^^^^^ warning: function `IORegistryEntryGetName` is never used --> src/unix/apple/macos/ffi.rs:159:12 | 159 | pub fn IORegistryEntryGetName(entry: io_registry_entry_t, name: io_name_t) -> kern_return_t; | ^^^^^^^^^^^^^^^^^^^^^^
`cargo check --target=x86_64-unknown-linux-gnu --no-default-features` warning: function `get_all_utf8_data_from_file` is never used --> src/unix/linux/utils.rs:15:15 | 15 | pub(crate) fn get_all_utf8_data_from_file(file: &mut File, size: usize) -> io::Result<String> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `get_all_utf8_data` is never used --> src/unix/linux/utils.rs:22:15 | 22 | pub(crate) fn get_all_utf8_data<P: AsRef<Path>>(file_path: P, size: usize) -> io::Result<String> { | ^^^^^^^^^^^^^^^^^ warning: function `to_cpath` is never used --> src/unix/linux/utils.rs:88:15 | 88 | pub(crate) fn to_cpath(path: &std::path::Path) -> Vec<u8> { | ^^^^^^^^
`cargo check --target=aarch64-apple-ios --no-default-features --features=disk` warning: unused import: `self::ios as inner` --> src/unix/apple/mod.rs:15:24 | 15 | pub(crate) use self::ios as inner; | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
`cargo check --target=x86_64-pc-windows-msvc --features=debug` warning: function `display_ntstatus_error` is never used --> src/windows/process.rs:229:11 | 229 | unsafe fn display_ntstatus_error(ntstatus: windows::core::HRESULT) { | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
`cargo check --target=x86_64-pc-windows-msvc --no-default-features --features=system` warning: method `account_name` is never used --> src/windows/sid.rs:59:19 | 20 | impl Sid { | -------- method in this implementation ... 59 | pub(crate) fn account_name(&self) -> Option<String> { | ^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
dtolnay
commented
Dec 7, 2024
@@ -225,17 +225,6 @@ fn windows_8_1_or_newer() -> &'static bool { | |||
}) | |||
} | |||
|
|||
#[cfg(feature = "debug")] | |||
unsafe fn display_ntstatus_error(ntstatus: windows::core::HRESULT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last use of this function was deleted in #1316.
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.