Skip to content

Commit f60c4ed

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 e788518 commit f60c4ed

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ pub mod netc {
524524

525525
#[derive(Copy, Clone)]
526526
pub struct sockaddr_in {
527+
#[allow(dead_code)]
527528
pub sin_family: sa_family_t,
528529
pub sin_port: u16,
529530
pub sin_addr: in_addr,
@@ -536,6 +537,7 @@ pub mod netc {
536537

537538
#[derive(Copy, Clone)]
538539
pub struct sockaddr_in6 {
540+
#[allow(dead_code)]
539541
pub sin6_family: sa_family_t,
540542
pub sin6_port: u16,
541543
pub sin6_addr: in6_addr,

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

+2
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

+2
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)