File tree Expand file tree Collapse file tree 12 files changed +27
-22
lines changed
Expand file tree Collapse file tree 12 files changed +27
-22
lines changed Original file line number Diff line number Diff line change 1+ msrv = " 1.45"
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ jobs:
265265 steps :
266266 - uses : actions/checkout@v2
267267 - name : Install Rust
268- run : rustup update ${{ env.minrust }} && rustup default ${{ env.minrust }}
268+ run : rustup update 1.52.1 && rustup default 1.52.1
269269 - name : Install clippy
270270 run : rustup component add clippy
271271
Original file line number Diff line number Diff line change 1+ #![ allow( clippy:: diverging_sub_expression) ]
2+
13use std:: rc:: Rc ;
24
35#[ allow( dead_code) ]
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ use tokio_util::sync::PollSemaphore;
66
77type SemRet = Option < OwnedSemaphorePermit > ;
88
9- fn semaphore_poll < ' a > (
10- sem : & ' a mut PollSemaphore ,
11- ) -> tokio_test:: task:: Spawn < impl Future < Output = SemRet > + ' a > {
9+ fn semaphore_poll (
10+ sem : & mut PollSemaphore ,
11+ ) -> tokio_test:: task:: Spawn < impl Future < Output = SemRet > + ' _ > {
1212 let fut = futures:: future:: poll_fn ( move |cx| sem. poll_acquire ( cx) ) ;
1313 tokio_test:: task:: spawn ( fut)
1414}
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ macro_rules! select {
398398 // set the appropriate bit in `disabled`.
399399 $(
400400 if !$c {
401- let mask = 1 << $crate:: count!( $( $skip) * ) ;
401+ let mask: util :: Mask = 1 << $crate:: count!( $( $skip) * ) ;
402402 disabled |= mask;
403403 }
404404 ) *
Original file line number Diff line number Diff line change @@ -29,12 +29,15 @@ const LIFECYCLE_MASK: usize = 0b11;
2929const NOTIFIED : usize = 0b100 ;
3030
3131/// The join handle is still around
32+ #[ allow( clippy:: unusual_byte_groupings) ] // https://github.com/rust-lang/rust-clippy/issues/6556
3233const JOIN_INTEREST : usize = 0b1_000 ;
3334
3435/// A join handle waker has been set
36+ #[ allow( clippy:: unusual_byte_groupings) ] // https://github.com/rust-lang/rust-clippy/issues/6556
3537const JOIN_WAKER : usize = 0b10_000 ;
3638
3739/// The task has been forcibly cancelled.
40+ #[ allow( clippy:: unusual_byte_groupings) ] // https://github.com/rust-lang/rust-clippy/issues/6556
3841const CANCELLED : usize = 0b100_000 ;
3942
4043/// All bits
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ pub(crate) unsafe trait Link {
5050 type Target ;
5151
5252 /// Convert the handle to a raw pointer without consuming the handle
53+ #[ allow( clippy:: wrong_self_convention) ]
5354 fn as_raw ( handle : & Self :: Handle ) -> NonNull < Self :: Target > ;
5455
5556 /// Convert the raw pointer to a handle
Original file line number Diff line number Diff line change @@ -54,11 +54,7 @@ unsafe fn inc_ref_count<T: Wake>(data: *const ()) {
5454 let arc = ManuallyDrop :: new ( Arc :: < T > :: from_raw ( data as * const T ) ) ;
5555
5656 // Now increase refcount, but don't drop new refcount either
57- let arc_clone: ManuallyDrop < _ > = arc. clone ( ) ;
58-
59- // Drop explicitly to avoid clippy warnings
60- drop ( arc) ;
61- drop ( arc_clone) ;
57+ let _arc_clone: ManuallyDrop < _ > = arc. clone ( ) ;
6258}
6359
6460unsafe fn clone_arc_raw < T : Wake > ( data : * const ( ) ) -> RawWaker {
Original file line number Diff line number Diff line change 11#![ warn( rust_2018_idioms) ]
22#![ cfg( feature = "full" ) ]
3- #![ allow( clippy:: type_complexity) ]
3+ #![ allow( clippy:: type_complexity, clippy :: diverging_sub_expression ) ]
44
55use std:: cell:: Cell ;
66use std:: future:: Future ;
Original file line number Diff line number Diff line change @@ -537,3 +537,13 @@ async fn biased_eventually_ready() {
537537
538538 assert_eq ! ( count, 3 ) ;
539539}
540+
541+ // https://github.com/tokio-rs/tokio/issues/3830
542+ // https://github.com/rust-lang/rust-clippy/issues/7304
543+ #[ warn( clippy:: default_numeric_fallback) ]
544+ pub async fn default_numeric_fallback ( ) {
545+ tokio:: select! {
546+ _ = async { } => ( ) ,
547+ else => ( ) ,
548+ }
549+ }
You can’t perform that action at this time.
0 commit comments