From ec22fb984317536f3846e74ae581361b65627e16 Mon Sep 17 00:00:00 2001 From: Yilin Chen Date: Sun, 10 Feb 2019 06:16:31 +0800 Subject: [PATCH] reactor: replace ATOMIC_USIZE_INIT with AtomicUsize::new(0) (#889) ATOMIC_BOOL_INIT is deprecated since 1.34 because the const fn AtomicUsize::new is now preferred. As deny(warnings) is set, tokio fails to build on latest nightly. This will fix it. Signed-off-by: Yilin Chen --- tokio-reactor/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio-reactor/src/lib.rs b/tokio-reactor/src/lib.rs index 938ce8e47..87063dd6c 100644 --- a/tokio-reactor/src/lib.rs +++ b/tokio-reactor/src/lib.rs @@ -71,7 +71,7 @@ use std::io; use std::mem; use std::cell::RefCell; use std::sync::atomic::Ordering::{Relaxed, SeqCst}; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT}; +use std::sync::atomic::AtomicUsize; use std::sync::{Arc, Weak}; use std::time::{Duration, Instant}; @@ -165,7 +165,7 @@ pub(crate) enum Direction { } /// The global fallback reactor. -static HANDLE_FALLBACK: AtomicUsize = ATOMIC_USIZE_INIT; +static HANDLE_FALLBACK: AtomicUsize = AtomicUsize::new(0); /// Tracks the reactor for the current execution context. thread_local!(static CURRENT_REACTOR: RefCell> = RefCell::new(None));