Skip to content

Commit

Permalink
Ignore dead_code warning for tuple struct
Browse files Browse the repository at this point in the history
This lint does not take into account destructors.

```
error: field `0` is never read
    --> src\iocp\mod.rs:1155:13
     |
1155 |     Waiting(WaitHandle),
     |     ------- ^^^^^^^^^^
     |     |
     |     field in this variant
     |
     = note: `-D dead-code` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
     |
1155 |     Waiting(()),
     |             ~~
```
  • Loading branch information
taiki-e committed Jan 7, 2024
1 parent 94c5ebf commit 0c794fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/iocp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ enum WaitableStatus {
Idle,

/// We are waiting on this handle to become signaled.
Waiting(WaitHandle),
Waiting(#[allow(dead_code)] WaitHandle),

/// This handle has been cancelled.
Cancelled,
Expand Down

0 comments on commit 0c794fc

Please sign in to comment.