Skip to content

Commit

Permalink
Allow dead code in sys/pal
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
krtab committed Mar 12, 2024
1 parent e788518 commit f60c4ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/std/src/sys/pal/sgx/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ pub mod netc {

#[derive(Copy, Clone)]
pub struct sockaddr_in {
#[allow(dead_code)]
pub sin_family: sa_family_t,
pub sin_port: u16,
pub sin_addr: in_addr,
Expand All @@ -536,6 +537,7 @@ pub mod netc {

#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
#[allow(dead_code)]
pub sin6_family: sa_family_t,
pub sin6_port: u16,
pub sin6_addr: in6_addr,
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/sys/pal/unsupported/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ pub mod netc {

#[derive(Copy, Clone)]
pub struct sockaddr_in {
#[allow(dead_code)]
pub sin_family: sa_family_t,
pub sin_port: u16,
pub sin_addr: in_addr,
Expand All @@ -358,6 +359,7 @@ pub mod netc {

#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
#[allow(dead_code)]
pub sin6_family: sa_family_t,
pub sin6_port: u16,
pub sin6_addr: in6_addr,
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/sys/pal/wasi/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ pub mod netc {

#[derive(Copy, Clone)]
pub struct sockaddr_in {
#[allow(dead_code)]
pub sin_family: sa_family_t,
pub sin_port: u16,
pub sin_addr: in_addr,
Expand All @@ -532,6 +533,7 @@ pub mod netc {

#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
#[allow(dead_code)]
pub sin6_family: sa_family_t,
pub sin6_port: u16,
pub sin6_addr: in6_addr,
Expand Down

0 comments on commit f60c4ed

Please sign in to comment.