Skip to content

Commit d5dbf42

Browse files
committed
Allow dead code in sys/pal
The dead_code lint was previously eroneously missing this dead code. Since this lint bug has been fixed, the unused field need to be removed or marked as `#[allow(dead_code)]`. These structures API is common to all platforms so the code cannot be removed and is hence marked allow(dead_code).
1 parent bd6edd6 commit d5dbf42

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

library/std/src/sys/pal/unsupported/net.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ pub mod netc {
346346

347347
#[derive(Copy, Clone)]
348348
pub struct sockaddr_in {
349+
#[allow(dead_code)]
349350
pub sin_family: sa_family_t,
350351
pub sin_port: u16,
351352
pub sin_addr: in_addr,
@@ -358,6 +359,7 @@ pub mod netc {
358359

359360
#[derive(Copy, Clone)]
360361
pub struct sockaddr_in6 {
362+
#[allow(dead_code)]
361363
pub sin6_family: sa_family_t,
362364
pub sin6_port: u16,
363365
pub sin6_addr: in6_addr,

library/std/src/sys/pal/wasi/net.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ pub mod netc {
520520

521521
#[derive(Copy, Clone)]
522522
pub struct sockaddr_in {
523+
#[allow(dead_code)]
523524
pub sin_family: sa_family_t,
524525
pub sin_port: u16,
525526
pub sin_addr: in_addr,
@@ -532,6 +533,7 @@ pub mod netc {
532533

533534
#[derive(Copy, Clone)]
534535
pub struct sockaddr_in6 {
536+
#[allow(dead_code)]
535537
pub sin6_family: sa_family_t,
536538
pub sin6_port: u16,
537539
pub sin6_addr: in6_addr,

0 commit comments

Comments
 (0)