@@ -127,7 +127,10 @@ macro_rules! make_channel {
127
127
128
128
// SAFETY: This is safe as we hide the static mut from others to access it.
129
129
// Only this point is where the mutable access happens.
130
- unsafe { CHANNEL . split( ) }
130
+ #[ allow( static_mut_refs) ]
131
+ unsafe {
132
+ CHANNEL . split( )
133
+ }
131
134
} } ;
132
135
}
133
136
@@ -184,7 +187,7 @@ where
184
187
/// A `Sender` can send to the channel and can be cloned.
185
188
pub struct Sender < ' a , T , const N : usize > ( & ' a Channel < T , N > ) ;
186
189
187
- unsafe impl < ' a , T , const N : usize > Send for Sender < ' a , T , N > { }
190
+ unsafe impl < T , const N : usize > Send for Sender < ' _ , T , N > { }
188
191
189
192
/// This is needed to make the async closure in `send` accept that we "share"
190
193
/// the link possible between threads.
@@ -202,20 +205,20 @@ unsafe impl Send for LinkPtr {}
202
205
203
206
unsafe impl Sync for LinkPtr { }
204
207
205
- impl < ' a , T , const N : usize > core:: fmt:: Debug for Sender < ' a , T , N > {
208
+ impl < T , const N : usize > core:: fmt:: Debug for Sender < ' _ , T , N > {
206
209
fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
207
210
write ! ( f, "Sender" )
208
211
}
209
212
}
210
213
211
214
#[ cfg( feature = "defmt-03" ) ]
212
- impl < ' a , T , const N : usize > defmt:: Format for Sender < ' a , T , N > {
215
+ impl < T , const N : usize > defmt:: Format for Sender < ' _ , T , N > {
213
216
fn format ( & self , f : defmt:: Formatter ) {
214
217
defmt:: write!( f, "Sender" , )
215
218
}
216
219
}
217
220
218
- impl < ' a , T , const N : usize > Sender < ' a , T , N > {
221
+ impl < T , const N : usize > Sender < ' _ , T , N > {
219
222
#[ inline( always) ]
220
223
fn send_footer ( & mut self , idx : u8 , val : T ) {
221
224
// Write the value to the slots, note; this memcpy is not under a critical section.
@@ -360,7 +363,7 @@ impl<'a, T, const N: usize> Sender<'a, T, N> {
360
363
}
361
364
}
362
365
363
- impl < ' a , T , const N : usize > Drop for Sender < ' a , T , N > {
366
+ impl < T , const N : usize > Drop for Sender < ' _ , T , N > {
364
367
fn drop ( & mut self ) {
365
368
// Count down the reference counter
366
369
let num_senders = critical_section:: with ( |cs| {
@@ -376,7 +379,7 @@ impl<'a, T, const N: usize> Drop for Sender<'a, T, N> {
376
379
}
377
380
}
378
381
379
- impl < ' a , T , const N : usize > Clone for Sender < ' a , T , N > {
382
+ impl < T , const N : usize > Clone for Sender < ' _ , T , N > {
380
383
fn clone ( & self ) -> Self {
381
384
// Count up the reference counter
382
385
critical_section:: with ( |cs| * self . 0 . access ( cs) . num_senders += 1 ) ;
@@ -390,16 +393,16 @@ impl<'a, T, const N: usize> Clone for Sender<'a, T, N> {
390
393
/// A receiver of the channel. There can only be one receiver at any time.
391
394
pub struct Receiver < ' a , T , const N : usize > ( & ' a Channel < T , N > ) ;
392
395
393
- unsafe impl < ' a , T , const N : usize > Send for Receiver < ' a , T , N > { }
396
+ unsafe impl < T , const N : usize > Send for Receiver < ' _ , T , N > { }
394
397
395
- impl < ' a , T , const N : usize > core:: fmt:: Debug for Receiver < ' a , T , N > {
398
+ impl < T , const N : usize > core:: fmt:: Debug for Receiver < ' _ , T , N > {
396
399
fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
397
400
write ! ( f, "Receiver" )
398
401
}
399
402
}
400
403
401
404
#[ cfg( feature = "defmt-03" ) ]
402
- impl < ' a , T , const N : usize > defmt:: Format for Receiver < ' a , T , N > {
405
+ impl < T , const N : usize > defmt:: Format for Receiver < ' _ , T , N > {
403
406
fn format ( & self , f : defmt:: Formatter ) {
404
407
defmt:: write!( f, "Receiver" , )
405
408
}
@@ -415,7 +418,7 @@ pub enum ReceiveError {
415
418
Empty ,
416
419
}
417
420
418
- impl < ' a , T , const N : usize > Receiver < ' a , T , N > {
421
+ impl < T , const N : usize > Receiver < ' _ , T , N > {
419
422
/// Receives a value if there is one in the channel, non-blocking.
420
423
pub fn try_recv ( & mut self ) -> Result < T , ReceiveError > {
421
424
// Try to get a ready slot.
@@ -487,7 +490,7 @@ impl<'a, T, const N: usize> Receiver<'a, T, N> {
487
490
}
488
491
}
489
492
490
- impl < ' a , T , const N : usize > Drop for Receiver < ' a , T , N > {
493
+ impl < T , const N : usize > Drop for Receiver < ' _ , T , N > {
491
494
fn drop ( & mut self ) {
492
495
// Mark the receiver as dropped and wake all waiters
493
496
critical_section:: with ( |cs| * self . 0 . access ( cs) . receiver_dropped = true ) ;
0 commit comments