Skip to content

Update comment on SockFilter dead_code warning #602

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

Merged
merged 1 commit into from
Jul 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/sys/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2823,10 +2823,8 @@ impl crate::Socket {
#[cfg(all(feature = "all", any(target_os = "linux", target_os = "android")))]
#[repr(transparent)]
pub struct SockFilter {
// For some reason Rust 1.70 thinks this field is unused, while it's clearly
// used in `SockFilter::new`. This issue seems fixed in later Rust versions,
// but we still need to support 1.70, adding allow(dead_code) ignores the
// issue.
// This field is only read indirectly by transmutes / pointer casts, so
// rustc emits a spurious warning saying that the field is never read.
#[allow(dead_code)]
filter: libc::sock_filter,
}
Expand Down