diff --git a/tokio/src/sync/batch_semaphore.rs b/tokio/src/sync/batch_semaphore.rs index 6305485b0..148e83160 100644 --- a/tokio/src/sync/batch_semaphore.rs +++ b/tokio/src/sync/batch_semaphore.rs @@ -133,7 +133,7 @@ impl Semaphore { pub(crate) const fn const_new(mut permits: usize) -> Self { // NOTE: assertions and by extension panics are still being worked on: https://github.com/rust-lang/rust/issues/74925 // currently we just clamp the permit count when it exceeds the max - permits = permits & Self::MAX_PERMITS; + permits &= Self::MAX_PERMITS; Self { permits: AtomicUsize::new(permits << Self::PERMIT_SHIFT), diff --git a/tokio/src/sync/oneshot.rs b/tokio/src/sync/oneshot.rs index 17767e7f7..32506bc34 100644 --- a/tokio/src/sync/oneshot.rs +++ b/tokio/src/sync/oneshot.rs @@ -124,7 +124,6 @@ struct State(usize); /// } /// ``` pub fn channel() -> (Sender, Receiver) { - #[allow(deprecated)] let inner = Arc::new(Inner { state: AtomicUsize::new(State::new().as_usize()), value: UnsafeCell::new(None),