Skip to content

Commit 3cc3b28

Browse files
DarksonnThomasdezeeuw
authored andcommitted
Update comment on SockFilter dead_code warning
1 parent 8e2bf28 commit 3cc3b28

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sys/unix.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,10 +2823,8 @@ impl crate::Socket {
28232823
#[cfg(all(feature = "all", any(target_os = "linux", target_os = "android")))]
28242824
#[repr(transparent)]
28252825
pub struct SockFilter {
2826-
// For some reason Rust 1.70 thinks this field is unused, while it's clearly
2827-
// used in `SockFilter::new`. This issue seems fixed in later Rust versions,
2828-
// but we still need to support 1.70, adding allow(dead_code) ignores the
2829-
// issue.
2826+
// This field is only read indirectly by transmutes / pointer casts, so
2827+
// rustc emits a spurious warning saying that the field is never read.
28302828
#[allow(dead_code)]
28312829
filter: libc::sock_filter,
28322830
}

0 commit comments

Comments
 (0)