@@ -40,6 +40,7 @@ impl SpinLock {
40
40
}
41
41
42
42
#[ inline]
43
+ #[ allow( clippy:: new_without_default) ]
43
44
pub const fn new ( ) -> Self {
44
45
Self {
45
46
inner : AtomicBool :: new ( false ) ,
@@ -90,6 +91,8 @@ impl<T> CMutex<T> {
90
91
park ( ) ;
91
92
sguard = self . spin_lock . acquire ( ) ;
92
93
}
94
+ // This does have an effect, as the ListHead inside wait_entry implements Drop!
95
+ #[ expect( clippy:: drop_non_drop) ]
93
96
drop ( wait_entry) ;
94
97
}
95
98
self . locked . set ( true ) ;
@@ -101,6 +104,7 @@ impl<T> CMutex<T> {
101
104
}
102
105
}
103
106
107
+ #[ allow( dead_code) ]
104
108
pub fn get_data_mut ( self : Pin < & mut Self > ) -> & mut T {
105
109
// SAFETY: we have an exclusive reference and thus nobody has access to data.
106
110
unsafe { & mut * self . data . get ( ) }
@@ -115,7 +119,7 @@ pub struct CMutexGuard<'a, T> {
115
119
_pin : PhantomPinned ,
116
120
}
117
121
118
- impl < ' a , T > Drop for CMutexGuard < ' a , T > {
122
+ impl < T > Drop for CMutexGuard < ' _ , T > {
119
123
#[ inline]
120
124
fn drop ( & mut self ) {
121
125
let sguard = self . mtx . spin_lock . acquire ( ) ;
@@ -128,7 +132,7 @@ impl<'a, T> Drop for CMutexGuard<'a, T> {
128
132
}
129
133
}
130
134
131
- impl < ' a , T > Deref for CMutexGuard < ' a , T > {
135
+ impl < T > Deref for CMutexGuard < ' _ , T > {
132
136
type Target = T ;
133
137
134
138
#[ inline]
@@ -137,7 +141,7 @@ impl<'a, T> Deref for CMutexGuard<'a, T> {
137
141
}
138
142
}
139
143
140
- impl < ' a , T > DerefMut for CMutexGuard < ' a , T > {
144
+ impl < T > DerefMut for CMutexGuard < ' _ , T > {
141
145
#[ inline]
142
146
fn deref_mut ( & mut self ) -> & mut Self :: Target {
143
147
unsafe { & mut * self . mtx . data . get ( ) }
0 commit comments