Update Tokio to Rust 2018 (#1082)

This commit is contained in:
Carl Lerche
2019-05-14 10:27:36 -07:00
committed by GitHub
parent 79d8820050
commit cb4aea394e
343 changed files with 1725 additions and 2813 deletions
+5 -7
View File
@@ -8,7 +8,7 @@
//! section. If no permits are available, then acquiring the semaphore returns
//! `NotReady`. The task is notified once a permit becomes available.
use loom::{
use crate::loom::{
futures::AtomicTask,
sync::{
atomic::{AtomicPtr, AtomicUsize},
@@ -16,9 +16,7 @@ use loom::{
},
yield_now,
};
use futures::Poll;
use std::fmt;
use std::ptr::{self, NonNull};
use std::sync::atomic::Ordering::{self, AcqRel, Acquire, Relaxed, Release};
@@ -531,7 +529,7 @@ impl Semaphore {
}
impl fmt::Debug for Semaphore {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("Semaphore")
.field("state", &SemState::load(&self.state, Relaxed))
.field("head", &self.head.with(|ptr| ptr))
@@ -683,7 +681,7 @@ fn to_try_acquire(_: AcquireError) -> TryAcquireError {
}
impl fmt::Display for AcquireError {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
use std::error::Error;
write!(fmt, "{}", self.description())
}
@@ -729,7 +727,7 @@ impl TryAcquireError {
}
impl fmt::Display for TryAcquireError {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
use std::error::Error;
write!(fmt, "{}", self.description())
}
@@ -1073,7 +1071,7 @@ impl SemState {
}
impl fmt::Debug for SemState {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut fmt = fmt.debug_struct("SemState");
if self.is_waiter() {