Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump to newer nightly #1426

Merged
merged 7 commits into from
Aug 10, 2019
Merged
Show file tree
Hide file tree
Changes from 6 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-10
- . $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-10
RUSTFLAGS: -Dwarnings

jobs:
Expand Down
2 changes: 0 additions & 2 deletions ci/azure-install-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ steps:

# All platforms.
- script: |
rustup toolchain install nightly
rustup update
rustup toolchain list
rustc -Vv
cargo -V
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-10
5 changes: 1 addition & 4 deletions tokio-codec/src/framed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ impl<T: AsyncRead + Unpin, U: Unpin> AsyncRead for Fuse<T, U> {
}

impl<T: AsyncBufRead + Unpin, U: Unpin> AsyncBufRead for Fuse<T, U> {
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!(self.get_mut().0).poll_fill_buf(cx)
}

Expand Down
5 changes: 1 addition & 4 deletions tokio-codec/src/framed_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,7 @@ impl<T: AsyncRead + Unpin> AsyncRead for FramedWrite2<T> {
}

impl<T: AsyncBufRead + Unpin> AsyncBufRead for FramedWrite2<T> {
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!(self.get_mut().inner).poll_fill_buf(cx)
}

Expand Down
2 changes: 1 addition & 1 deletion tokio-codec/tests/framed_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,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(
mut 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 @@ -429,7 +429,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 @@ -593,7 +593,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 @@ -738,7 +738,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 @@ -750,7 +750,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 @@ -770,7 +770,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 @@
#![warn(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 @@
#![warn(rust_2018_idioms)]
#![feature(await_macro, async_await)]
#![feature(async_await)]

use tokio_executor::{self, DefaultExecutor};

Expand Down
7 changes: 0 additions & 7 deletions tokio-fs/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
asyncify(|| self.std.seek(pos)).await
}
Expand All @@ -209,7 +208,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn sync_all(&mut self) -> io::Result<()> {
asyncify(|| self.std.sync_all()).await
}
Expand Down Expand Up @@ -238,7 +236,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn sync_data(&mut self) -> io::Result<()> {
asyncify(|| self.std.sync_data()).await
}
Expand Down Expand Up @@ -270,7 +267,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn set_len(&mut self, size: u64) -> io::Result<()> {
asyncify(|| self.std.set_len(size)).await
}
Expand All @@ -292,7 +288,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn metadata(&self) -> io::Result<Metadata> {
asyncify(|| self.std.metadata()).await
}
Expand All @@ -314,7 +309,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn try_clone(&self) -> io::Result<File> {
let std_file = asyncify(|| self.std.try_clone()).await?;
Ok(File::from_std(std_file))
Expand Down Expand Up @@ -351,7 +345,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn set_permissions(&self, perm: Permissions) -> io::Result<()> {
asyncify(|| self.std.set_permissions(perm)).await
}
Expand Down
1 change: 0 additions & 1 deletion tokio-fs/src/open_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ impl OpenOptions {
/// Tokio runtime or if the underlying [`open`] call results in an error.
///
/// [`open`]: https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#method.open
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn open<P>(&self, path: P) -> io::Result<File>
where
P: AsRef<Path> + Send + Unpin + 'static,
Expand Down
2 changes: 0 additions & 2 deletions tokio-fs/src/read_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ impl DirEntry {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn metadata(&self) -> io::Result<Metadata> {
asyncify(|| self.0.metadata()).await
}
Expand Down Expand Up @@ -222,7 +221,6 @@ impl DirEntry {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn file_type(&self) -> io::Result<FileType> {
asyncify(|| self.0.file_type()).await
}
Expand Down
24 changes: 6 additions & 18 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 All @@ -94,10 +88,7 @@ where
}

impl AsyncBufRead for &[u8] {
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]>> {
Poll::Ready(Ok(*self))
}

Expand All @@ -107,10 +98,7 @@ impl AsyncBufRead for &[u8] {
}

impl<T: AsRef<[u8]> + Unpin> AsyncBufRead for io::Cursor<T> {
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]>> {
Poll::Ready(io::BufRead::fill_buf(self.get_mut()))
}

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
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 @@ -10,7 +10,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 @@ -29,7 +29,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
Loading