Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
# TODO: switch back to nightly
- sh rustup.sh -y --default-toolchain nightly-2019-07-17
- sh rustup.sh -y --default-toolchain nightly-2019-08-01
- . $HOME/.cargo/env
- rustup target add i686-unknown-freebsd
- |
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ trigger: ["master", "std-future"]
pr: ["master", "std-future"]

variables:
nightly: nightly-2019-07-17
nightly: nightly-2019-08-01

jobs:
# Check formatting
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2019-07-17
nightly-2019-08-01
2 changes: 1 addition & 1 deletion tokio-codec/tests/framed_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl AsyncRead for Mock {
// TODO this newtype is necessary because `&[u8]` does not currently implement `AsyncRead`
struct Slice<'a>(&'a [u8]);

impl<'a> AsyncRead for Slice<'a> {
impl AsyncRead for Slice<'_> {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
Expand Down
10 changes: 5 additions & 5 deletions tokio-current-thread/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl<P: Park + Default> Default for CurrentThread<P> {

// ===== impl Entered =====

impl<'a, P: Park> Entered<'a, P> {
impl<P: Park> Entered<'_, P> {
/// Spawn the future on the executor.
///
/// This internally queues the future to be executed once `run` is called.
Expand Down Expand Up @@ -594,7 +594,7 @@ impl<'a, P: Park> Entered<'a, P> {
}
}

impl<'a, P: Park> fmt::Debug for Entered<'a, P> {
impl<P: Park> fmt::Debug for Entered<'_, P> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("Entered")
.field("executor", &self.executor)
Expand Down Expand Up @@ -739,7 +739,7 @@ where

// ===== impl Borrow =====

impl<'a, U: Unpark> Borrow<'a, U> {
impl<U: Unpark> Borrow<'_, U> {
fn enter<F, R>(&mut self, f: F) -> R
where
F: FnOnce() -> R,
Expand All @@ -751,7 +751,7 @@ impl<'a, U: Unpark> Borrow<'a, U> {
}
}

impl<'a, U: Unpark> SpawnLocal for Borrow<'a, U> {
impl<U: Unpark> SpawnLocal for Borrow<'_, U> {
fn spawn_local(&mut self, future: Pin<Box<dyn Future<Output = ()>>>, already_counted: bool) {
if !already_counted {
// NOTE: we have a borrow of the Runtime, so we know that it isn't shut down.
Expand All @@ -771,7 +771,7 @@ impl CurrentRunner {
{
struct Reset<'a>(&'a CurrentRunner);

impl<'a> Drop for Reset<'a> {
impl Drop for Reset<'_> {
fn drop(&mut self) {
self.0.spawn.set(None);
self.0.id.set(None);
Expand Down
4 changes: 2 additions & 2 deletions tokio-current-thread/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ where
node: Option<Arc<Node<U>>>,
}

impl<'a, U: Unpark> Drop for Bomb<'a, U> {
impl<U: Unpark> Drop for Bomb<'_, U> {
fn drop(&mut self) {
if let Some(node) = self.node.take() {
self.borrow.enter(|| release_node(node))
Expand Down Expand Up @@ -329,7 +329,7 @@ where
}
}

impl<'a, U: Unpark> Scheduled<'a, U> {
impl<U: Unpark> Scheduled<'_, U> {
/// Polls the task, returns `true` if the task has completed.
pub fn tick(&mut self) -> bool {
let waker = unsafe {
Expand Down
2 changes: 0 additions & 2 deletions tokio-current-thread/tests/current_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ mod and_turn {
},
);
}

}

mod in_drop {
Expand Down Expand Up @@ -441,7 +440,6 @@ mod in_drop {
},
);
}

}

/*
Expand Down
2 changes: 1 addition & 1 deletion tokio-executor/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ where
// when leaving the scope. This handles cases that involve panicking.
struct Reset<'a>(&'a Cell<State>, State);

impl<'a> Drop for Reset<'a> {
impl Drop for Reset<'_> {
fn drop(&mut self) {
self.0.set(self.1);
}
Expand Down
2 changes: 1 addition & 1 deletion tokio-executor/tests/enter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(warnings, rust_2018_idioms)]
#![feature(await_macro, async_await)]
#![feature(async_await)]

#[test]
fn block_on_ready() {
Expand Down
2 changes: 1 addition & 1 deletion tokio-executor/tests/executor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(warnings, rust_2018_idioms)]
#![feature(await_macro, async_await)]
#![feature(async_await)]

use tokio_executor::{self, DefaultExecutor};

Expand Down
14 changes: 4 additions & 10 deletions tokio-io/src/async_buf_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ pub trait AsyncBufRead: AsyncRead {
///
/// [`poll_read`]: AsyncRead::poll_read
/// [`consume`]: AsyncBufRead::consume
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>>;
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>>;

/// Tells this buffer that `amt` bytes have been consumed from the buffer,
/// so they should no longer be returned in calls to [`poll_read`].
Expand All @@ -56,8 +53,8 @@ pub trait AsyncBufRead: AsyncRead {

macro_rules! deref_async_buf_read {
() => {
fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, cx: &mut Context<'_>)
-> Poll<io::Result<&'a [u8]>>
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>)
-> Poll<io::Result<&[u8]>>
{
Pin::new(&mut **self.get_mut()).poll_fill_buf(cx)
}
Expand All @@ -81,10 +78,7 @@ where
P: DerefMut + Unpin,
P::Target: AsyncBufRead,
{
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
self.get_mut().as_mut().poll_fill_buf(cx)
}

Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/io/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ where
}
}

impl<'a, R, W> Future for Copy<'a, R, W>
impl<R, W> Future for Copy<'_, R, W>
where
R: AsyncRead + Unpin + ?Sized,
W: AsyncWrite + Unpin + ?Sized,
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/io/flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
Flush { a }
}

impl<'a, A> Unpin for Flush<'a, A> where A: Unpin + ?Sized {}
impl<A> Unpin for Flush<'_, A> where A: Unpin + ?Sized {}

impl<A> Future for Flush<'_, A>
where
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/io/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Read<'a, R: ?Sized> {
}

// forward Unpin
impl<'a, R: Unpin + ?Sized> Unpin for Read<'_, R> {}
impl<R: Unpin + ?Sized> Unpin for Read<'_, R> {}

impl<R> Future for Read<'_, R>
where
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/io/read_exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn eof() -> io::Error {
}

// forward Unpin
impl<'a, A: Unpin + ?Sized> Unpin for ReadExact<'_, A> {}
impl<A: Unpin + ?Sized> Unpin for ReadExact<'_, A> {}

impl<A> Future for ReadExact<'_, A>
where
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/io/shutdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
Shutdown { a }
}

impl<'a, A> Unpin for Shutdown<'a, A> where A: Unpin + ?Sized {}
impl<A> Unpin for Shutdown<'_, A> where A: Unpin + ?Sized {}

impl<A> Future for Shutdown<'_, A>
where
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/io/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
}

// forward Unpin
impl<'a, W: Unpin + ?Sized> Unpin for Write<'a, W> {}
impl<W: Unpin + ?Sized> Unpin for Write<'_, W> {}

impl<W> Future for Write<'_, W>
where
Expand Down
5 changes: 1 addition & 4 deletions tokio-io/tests/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ async fn lines() {
}

impl AsyncBufRead for Rd {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
Poll::Ready(Ok(self.val))
}

Expand Down
5 changes: 1 addition & 4 deletions tokio-io/tests/read_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ async fn read_line() {
}

impl AsyncBufRead for Rd {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
Poll::Ready(Ok(self.val))
}

Expand Down
5 changes: 1 addition & 4 deletions tokio-io/tests/read_until.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ async fn read_until() {
}

impl AsyncBufRead for Rd {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
Poll::Ready(Ok(self.val))
}

Expand Down
2 changes: 1 addition & 1 deletion tokio-process/src/kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub(crate) trait Kill {
fn kill(&mut self) -> io::Result<()>;
}

impl<'a, T: 'a + Kill> Kill for &'a mut T {
impl<T: Kill> Kill for &mut T {
fn kill(&mut self) -> io::Result<()> {
(**self).kill()
}
Expand Down
4 changes: 2 additions & 2 deletions tokio-process/src/unix/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) trait Wait {
fn try_wait(&mut self) -> io::Result<Option<ExitStatus>>;
}

impl<'a, T: 'a + Wait> Wait for &'a mut T {
impl<T: Wait> Wait for &mut T {
fn id(&self) -> u32 {
(**self).id()
}
Expand All @@ -31,7 +31,7 @@ pub(crate) trait OrphanQueue<T> {
fn reap_orphans(&self);
}

impl<'a, T, O: 'a + OrphanQueue<T>> OrphanQueue<T> for &'a O {
impl<T, O: OrphanQueue<T>> OrphanQueue<T> for &O {
fn push_orphan(&self, orphan: T) {
(**self).push_orphan(orphan);
}
Expand Down
1 change: 0 additions & 1 deletion tokio-signal/examples/multiple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ mod platform {
println!("received SIGTERM");
}
}

}

#[cfg(not(unix))]
Expand Down
2 changes: 0 additions & 2 deletions tokio-sync/src/mpsc/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ impl<T> Receiver<T> {
}

/// TODO: Dox
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn recv(&mut self) -> Option<T> {
use async_util::future::poll_fn;

Expand Down Expand Up @@ -205,7 +204,6 @@ impl<T> Sender<T> {
/// ```
/// unimplemented!();
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn send(&mut self, value: T) -> Result<(), SendError> {
use async_util::future::poll_fn;

Expand Down
1 change: 0 additions & 1 deletion tokio-sync/src/mpsc/unbounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ impl<T> UnboundedReceiver<T> {
}

/// TODO: Dox
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn recv(&mut self) -> Option<T> {
use async_util::future::poll_fn;

Expand Down
1 change: 0 additions & 1 deletion tokio-sync/src/oneshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ impl<T> Sender<T> {
/// ```
/// unimplemented!();
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn closed(&mut self) {
use async_util::future::poll_fn;

Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/src/task/atomic_waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl WakerRef for Waker {
}
}

impl<'a> WakerRef for &'a Waker {
impl WakerRef for &Waker {
fn wake(self) {
self.wake_by_ref()
}
Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/src/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ impl<T> Drop for Sender<T> {

// ===== impl Ref =====

impl<'a, T: 'a> ops::Deref for Ref<'a, T> {
impl<T> ops::Deref for Ref<'_, T> {
type Target = T;

fn deref(&self) -> &T {
Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/tests/fuzz_oneshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<'a> OnClose<'a> {
}
}

impl<'a> Future for OnClose<'a> {
impl Future for OnClose<'_> {
type Output = ();

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
Expand Down
1 change: 0 additions & 1 deletion tokio-tcp/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ impl TcpListener {
/// ```
/// unimplemented!();
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn accept(&mut self) -> io::Result<(TcpStream, SocketAddr)> {
use async_util::future::poll_fn;
poll_fn(|cx| self.poll_accept(cx)).await
Expand Down
2 changes: 1 addition & 1 deletion tokio-threadpool/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl tokio_executor::Executor for Sender {
}
}

impl<'a> tokio_executor::Executor for &'a Sender {
impl tokio_executor::Executor for &Sender {
fn status(&self) -> Result<(), tokio_executor::SpawnError> {
let state: pool::State = self.pool.state.load(Acquire).into();

Expand Down
2 changes: 1 addition & 1 deletion tokio-threadpool/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Task {
let res = panic::catch_unwind(panic::AssertUnwindSafe(|| {
struct Guard<'a>(&'a mut Option<BoxFuture>, bool);

impl<'a> Drop for Guard<'a> {
impl Drop for Guard<'_> {
fn drop(&mut self) {
// This drops the future
if self.1 {
Expand Down
2 changes: 1 addition & 1 deletion tokio-threadpool/src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ impl Worker {
worker: &'a Worker,
}

impl<'a> Drop for Guard<'a> {
impl Drop for Guard<'_> {
fn drop(&mut self) {
// A task is allocated at run when it was explicitly notified
// that the task has capacity to block. When this happens, that
Expand Down
2 changes: 1 addition & 1 deletion tokio-threadpool/tests/threadpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ fn busy_threadpool_is_not_idle() {

struct IdleFut<'a>(&'a mut Shutdown);

impl<'a> Future for IdleFut<'a> {
impl Future for IdleFut<'_> {
type Output = ();

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
Expand Down
Loading