@@ -9,10 +9,13 @@ use std::task::Poll;
99use std:: task:: Waker ;
1010use std:: { io, mem} ;
1111
12- #[ allow( dead_code) ]
1312#[ derive( Debug ) ]
1413pub ( crate ) enum CancelData {
15- Open ( Open ) ,
14+ Open (
15+ // This field isn't accessed directly, but it holds cancellation data,
16+ // so `#[allow(dead_code)]` is needed.
17+ #[ allow( dead_code) ] Open ,
18+ ) ,
1619}
1720
1821#[ derive( Debug ) ]
@@ -25,15 +28,17 @@ pub(crate) enum Lifecycle {
2528
2629 /// The submitter no longer has interest in the operation result. The state
2730 /// must be passed to the driver and held until the operation completes.
28- #[ allow( dead_code) ]
29- Cancelled ( CancelData ) ,
31+ Cancelled (
32+ // This field isn't accessed directly, but it holds cancellation data,
33+ // so `#[allow(dead_code)]` is needed.
34+ #[ allow( dead_code) ] CancelData ,
35+ ) ,
3036
3137 /// The operation has completed with a single cqe result
3238 Completed ( io_uring:: cqueue:: Entry ) ,
3339}
3440
3541pub ( crate ) enum State {
36- #[ allow( dead_code) ]
3742 Initialize ( Option < Entry > ) ,
3843 Polled ( usize ) ,
3944 Complete ,
@@ -53,7 +58,6 @@ impl<T: Cancellable> Op<T> {
5358 ///
5459 /// Callers must ensure that parameters of the entry (such as buffer) are valid and will
5560 /// be valid for the entire duration of the operation, otherwise it may cause memory problems.
56- #[ allow( dead_code) ]
5761 pub ( crate ) unsafe fn new ( entry : Entry , data : T ) -> Self {
5862 let handle = Handle :: current ( ) ;
5963 Self {
@@ -87,7 +91,6 @@ impl<T: Cancellable> Drop for Op<T> {
8791
8892/// A single CQE result
8993pub ( crate ) struct CqeResult {
90- #[ allow( dead_code) ]
9194 pub ( crate ) result : io:: Result < u32 > ,
9295}
9396
0 commit comments