Skip to content

Commit

Permalink
chore: MSRV bump (#2104)
Browse files Browse the repository at this point in the history
* 1.71.1

* #1993

* #1991 1992

* #1752 1735

* #1752 #1804

* #1752 1750

* #1735

* unpin deps and utilize higher msrv

* core::task::ready

* unpin some deps

* explicitly bump aws-lc-rs version
  • Loading branch information
toidiu authored Feb 6, 2024
1 parent 577f2d4 commit 9226e90
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 79 deletions.
2 changes: 1 addition & 1 deletion quic/s2n-quic-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ s2n-quic-core = { version = "=0.32.0", path = "../s2n-quic-core", default-featur
zeroize = { version = "1", default-features = false, features = ["derive"] }

[target.'cfg(not(target_os = "windows"))'.dependencies]
aws-lc-rs = { version = "1.5" }
aws-lc-rs = { version = "1.6" }

[target.'cfg(target_os = "windows")'.dependencies]
ring = { version = "0.16", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-h3/src/s2n_quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use bytes::{Buf, Bytes};
use futures::ready;
use core::task::ready;
use h3::quic::{self, Error, StreamId, WriteBuf};
use s2n_quic::stream::{BidirectionalStream, ReceiveStream};
use s2n_quic_core::varint::VarInt;
Expand Down
3 changes: 1 addition & 2 deletions quic/s2n-quic-platform/src/io/testing/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use bach::time::{self, scheduler};
use core::{
future::Future,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
time::Duration,
};
use futures::ready;
use s2n_quic_core::time::{clock, Timestamp};

pub fn now() -> Timestamp {
Expand Down
1 change: 0 additions & 1 deletion quic/s2n-quic-qns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ tokio = { version = "1", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
url = "2"
regex = { version = "1", features = ["unicode"] }

[target.'cfg(unix)'.dependencies]
s2n-quic = { path = "../s2n-quic", features = ["provider-event-console-perf", "provider-event-tracing", "provider-tls-rustls", "provider-tls-s2n"] }
Expand Down
4 changes: 2 additions & 2 deletions quic/s2n-quic-qns/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use crate::Result;
use bytes::{BufMut, Bytes, BytesMut};
use core::mem::MaybeUninit;
use futures::{ready, stream::Stream};
use core::{mem::MaybeUninit, task::ready};
use futures::stream::Stream;
use std::{
path::{Path, PathBuf},
pin::Pin,
Expand Down
10 changes: 0 additions & 10 deletions quic/s2n-quic-sim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ s2n-quic = { path = "../s2n-quic", features = ["unstable-provider-io-testing", "
s2n-quic-core = { path = "../s2n-quic-core", features = ["testing"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# >0.6.1 breaks compatibility with 1.63
# See https://github.com/aws/s2n-quic/issues/1735
serde_spanned = "=0.6.1"
structopt = "0.3"
toml = "0.7"
# >0.6.1 breaks compatibility with 1.63
# See https://github.com/aws/s2n-quic/issues/1735
toml_datetime = "=0.6.1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# >0.4.1 breaks compatibility with 1.63
# See https://github.com/aws/s2n-quic/issues/1735
winnow = "=0.4.1"
11 changes: 0 additions & 11 deletions quic/s2n-quic-tls-default/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,3 @@ s2n-quic-tls = { version = "=0.32.0", path = "../s2n-quic-tls" }

[target.'cfg(not(unix))'.dependencies]
s2n-quic-rustls = { version = "=0.32.0", path = "../s2n-quic-rustls" }

[target.'cfg(unix)'.dev-dependencies]
# newer versions require rust 1.66, see https://github.com/aws/s2n-quic/issues/1991
# this version pin is only needed to prevent verification failures when using
# cargo package / cargo publish, as those commands do not respect the version pin
# in downstream dev-dependencies (in s2n-quic-tls, in this case)
jobserver = "=0.1.26"

# jobserver is just here to pin
[package.metadata.cargo-udeps.ignore]
development = [ "jobserver" ]
4 changes: 1 addition & 3 deletions quic/s2n-quic-tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ s2n-tls = { version = "0.1", features = ["quic"] }

[dev-dependencies]
checkers = "0.6"
jobserver = "=0.1.26" # newer versions require rust 1.66, see https://github.com/aws/s2n-quic/issues/1991
pin-project = { version = "1" }
openssl = { version = "0.10" }
# Build the vendored version to make it easy to test in dev
Expand All @@ -37,6 +36,5 @@ s2n-quic-core = { path = "../s2n-quic-core", features = ["testing"] }
s2n-quic-rustls = { path = "../s2n-quic-rustls" }

# we don't use openssl-sys directly; it's just here to pin and vendor in dev
# jobserver is just here to pin as well, it is a dependency of openssl-sys
[package.metadata.cargo-udeps.ignore]
development = [ "openssl-sys", "jobserver" ]
development = [ "openssl-sys" ]
2 changes: 1 addition & 1 deletion quic/s2n-quic-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ unstable_resumption = []
bytes = { version = "1", default-features = false }
futures-channel = { version = "0.3", default-features = false, features = ["alloc"] }
futures-core = { version = "0.3", default-features = false, features = ["alloc"] }
hashbrown = "0.13"
hashbrown = "0.14"
intrusive-collections = "0.9"
once_cell = "1"
s2n-codec = { version = "=0.32.0", path = "../../common/s2n-codec", features = ["bytes"], default-features = false }
Expand Down
11 changes: 1 addition & 10 deletions quic/s2n-quic-transport/src/stream/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use core::{
fmt,
future::Future,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
};
pub use s2n_quic_core::{
application,
Expand Down Expand Up @@ -80,15 +80,6 @@ impl Drop for State {
}
}

macro_rules! ready {
($e:expr $(,)?) => {
match $e {
core::task::Poll::Ready(t) => t,
core::task::Poll::Pending => return core::task::Poll::Pending,
}
};
}

macro_rules! tx_stream_apis {
() => {
/// Enqueues a chunk of data for sending it towards the peer.
Expand Down
3 changes: 1 addition & 2 deletions quic/s2n-quic-transport/src/stream/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ use crate::{
transmission::{interest::Provider, WriteContext},
};
use core::{
task::{Context, Poll},
task::{ready, Context, Poll},
time::Duration,
};
use futures_core::ready;
use s2n_quic_core::{
ack, endpoint,
frame::MaxStreams,
Expand Down
3 changes: 1 addition & 2 deletions quic/s2n-quic-transport/src/stream/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ use crate::{
transmission::{self, interest::Provider as _},
};
use core::{
task::{Context, Poll, Waker},
task::{ready, Context, Poll, Waker},
time::Duration,
};
use futures_core::ready;
use s2n_quic_core::{
ack,
connection::error::Error,
Expand Down
11 changes: 0 additions & 11 deletions quic/s2n-quic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,10 @@ zerocopy = { version = "0.7", optional = true, features = ["derive"] }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
backtrace = { version = "=0.3.68" } # pin backtrace to avoid bumping MSRV
bolero = { version = "0.10" }
# newer versions of jobserver require rust 1.66, see https://github.com/aws/s2n-quic/issues/1991
# this version pin is only needed to prevent verification failures when using
# cargo package / cargo publish, as those commands do not respect the version pin
# in downstream dev-dependencies (in s2n-quic-tls, in this case)
jobserver = "=0.1.26"
regex = "=1.9.6" # newer versions require rust 1.65, see https://github.com/aws/s2n-quic/issues/1993
s2n-quic-core = { path = "../s2n-quic-core", features = ["branch-tracing", "event-tracing", "probe-tracing", "testing"] }
s2n-quic-platform = { path = "../s2n-quic-platform", features = ["testing"] }
s2n-quic-transport = { version = "=0.32.0", path = "../s2n-quic-transport", features = ["unstable_resumption"] }
tokio = { version = "1", features = ["full"] }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# jobserver is just here to pin
[package.metadata.cargo-udeps.ignore]
development = [ "jobserver" ]
12 changes: 6 additions & 6 deletions quic/s2n-quic/src/connection/acceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ macro_rules! impl_accept_api {
use $crate::stream::{BidirectionalStream, ReceiveStream};

Ok(
futures::ready!(self.0.poll_accept(None, cx))?.map(|stream| {
core::task::ready!(self.0.poll_accept(None, cx))?.map(|stream| {
match stream.id().stream_type() {
StreamType::Unidirectional => ReceiveStream::new(stream.into()).into(),
StreamType::Bidirectional => BidirectionalStream::new(stream).into(),
Expand Down Expand Up @@ -116,7 +116,7 @@ macro_rules! impl_accept_bidirectional_api {
cx: &mut core::task::Context,
) -> core::task::Poll<$crate::connection::Result<Option<$crate::stream::BidirectionalStream>>> {
Ok(
futures::ready!(self
core::task::ready!(self
.0
.poll_accept(Some(s2n_quic_core::stream::StreamType::Bidirectional), cx)
)?.map($crate::stream::BidirectionalStream::new)
Expand Down Expand Up @@ -170,7 +170,7 @@ macro_rules! impl_accept_receive_api {
&mut self,
cx: &mut core::task::Context,
) -> core::task::Poll<$crate::connection::Result<Option<$crate::stream::ReceiveStream>>> {
Ok(futures::ready!(self
Ok(core::task::ready!(self
.0
.poll_accept(Some(s2n_quic_core::stream::StreamType::Unidirectional), cx))?
.map(|stream| $crate::stream::ReceiveStream::new(stream.into())))
Expand Down Expand Up @@ -228,7 +228,7 @@ impl futures::stream::Stream for StreamAcceptor {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<Option<Self::Item>> {
match futures::ready!(self.poll_accept(cx)) {
match core::task::ready!(self.poll_accept(cx)) {
Ok(Some(stream)) => Some(Ok(stream)),
Ok(None) => None,
Err(err) => Some(Err(err)),
Expand All @@ -252,7 +252,7 @@ impl futures::stream::Stream for BidirectionalStreamAcceptor {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<Option<Self::Item>> {
match futures::ready!(self.poll_accept_bidirectional_stream(cx)) {
match core::task::ready!(self.poll_accept_bidirectional_stream(cx)) {
Ok(Some(stream)) => Some(Ok(stream)),
Ok(None) => None,
Err(err) => Some(Err(err)),
Expand All @@ -276,7 +276,7 @@ impl futures::stream::Stream for ReceiveStreamAcceptor {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<Option<Self::Item>> {
match futures::ready!(self.poll_accept_receive_stream(cx)) {
match core::task::ready!(self.poll_accept_receive_stream(cx)) {
Ok(Some(stream)) => Some(Ok(stream)),
Ok(None) => None,
Err(err) => Some(Err(err)),
Expand Down
8 changes: 5 additions & 3 deletions quic/s2n-quic/src/connection/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ macro_rules! impl_handle_api {
use $crate::stream::{BidirectionalStream, SendStream};

Ok(
match futures::ready!(self.0.poll_open_stream(stream_type, cx))? {
match core::task::ready!(self.0.poll_open_stream(stream_type, cx))? {
stream if stream_type == StreamType::Unidirectional => {
SendStream::new(stream.into()).into()
}
Expand Down Expand Up @@ -97,7 +97,8 @@ macro_rules! impl_handle_api {
use s2n_quic_core::stream::StreamType;
use $crate::stream::BidirectionalStream;

let stream = futures::ready!(self.0.poll_open_stream(StreamType::Bidirectional, cx))?;
let stream =
core::task::ready!(self.0.poll_open_stream(StreamType::Bidirectional, cx))?;

Ok(BidirectionalStream::new(stream)).into()
}
Expand Down Expand Up @@ -132,7 +133,8 @@ macro_rules! impl_handle_api {
use s2n_quic_core::stream::StreamType;
use $crate::stream::SendStream;

let stream = futures::ready!(self.0.poll_open_stream(StreamType::Unidirectional, cx))?;
let stream =
core::task::ready!(self.0.poll_open_stream(StreamType::Unidirectional, cx))?;

Ok(SendStream::new(stream.into())).into()
}
Expand Down
8 changes: 4 additions & 4 deletions quic/s2n-quic/src/stream/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ macro_rules! impl_receive_stream_trait {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<Option<Self::Item>> {
match futures::ready!(self.poll_receive(cx)) {
match core::task::ready!(self.poll_receive(cx)) {
Ok(Some(v)) => Some(Ok(v)),
Ok(None) => None,
Err(err) => Some(Err(err)),
Expand Down Expand Up @@ -267,7 +267,7 @@ macro_rules! impl_receive_stream_trait {

let high_watermark = buf.len();

let response = futures::ready!(self
let response = core::task::ready!(self
.rx_request()?
.receive(&mut chunks)
// don't receive more than we're capable of storing
Expand Down Expand Up @@ -315,7 +315,7 @@ macro_rules! impl_receive_stream_trait {

let high_watermark = bufs.iter().map(|buf| buf.len()).sum();

let response = futures::ready!(self
let response = core::task::ready!(self
.rx_request()?
.receive(&mut chunks)
// don't receive more than we're capable of storing
Expand Down Expand Up @@ -359,7 +359,7 @@ macro_rules! impl_receive_stream_trait {

let high_watermark = buf.remaining();

let response = futures::ready!(self
let response = core::task::ready!(self
.rx_request()?
.receive(&mut chunks)
// don't receive more than we're capable of storing
Expand Down
16 changes: 8 additions & 8 deletions quic/s2n-quic/src/stream/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ macro_rules! impl_send_stream_api {

::futures::future::poll_fn(|cx| {
sent_chunks +=
::futures::ready!(self.poll_send_vectored(&mut chunks[sent_chunks..], cx))?;
::core::task::ready!(self.poll_send_vectored(&mut chunks[sent_chunks..], cx))?;
if sent_chunks == chunks.len() {
return Ok(()).into();
}
Expand Down Expand Up @@ -389,7 +389,7 @@ macro_rules! impl_send_stream_trait {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<$crate::stream::Result<()>> {
futures::ready!(self.poll_send_ready(cx))?;
core::task::ready!(self.poll_send_ready(cx))?;
Ok(()).into()
}

Expand Down Expand Up @@ -428,7 +428,7 @@ macro_rules! impl_send_stream_trait {
return Ok(0).into();
}

let len = futures::ready!(self.poll_send_ready(cx))?.min(buf.len());
let len = core::task::ready!(self.poll_send_ready(cx))?.min(buf.len());
let data = bytes::Bytes::copy_from_slice(&buf[..len]);
self.send_data(data)?;
Ok(len).into()
Expand All @@ -443,7 +443,7 @@ macro_rules! impl_send_stream_trait {
return Ok(0).into();
}

let len = futures::ready!(self.poll_send_ready(cx))?;
let len = core::task::ready!(self.poll_send_ready(cx))?;
let capacity = bufs.iter().map(|buf| buf.len()).sum();
let len = len.min(capacity);

Expand All @@ -469,7 +469,7 @@ macro_rules! impl_send_stream_trait {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<std::io::Result<()>> {
futures::ready!($name::poll_flush(&mut self, cx))?;
core::task::ready!($name::poll_flush(&mut self, cx))?;
Ok(()).into()
}

Expand All @@ -478,7 +478,7 @@ macro_rules! impl_send_stream_trait {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<std::io::Result<()>> {
futures::ready!($name::poll_close(&mut self, cx))?;
core::task::ready!($name::poll_close(&mut self, cx))?;
Ok(()).into()
}
}
Expand All @@ -502,7 +502,7 @@ macro_rules! impl_send_stream_trait {
return Ok(0).into();
}

let len = futures::ready!(self.poll_send_ready(cx))?;
let len = core::task::ready!(self.poll_send_ready(cx))?;
let capacity = bufs.iter().map(|buf| buf.len()).sum();
let len = len.min(capacity);

Expand Down Expand Up @@ -541,7 +541,7 @@ macro_rules! impl_send_stream_trait {
mut self: core::pin::Pin<&mut Self>,
cx: &mut core::task::Context<'_>,
) -> core::task::Poll<std::io::Result<()>> {
futures::ready!(self.poll_close(cx))?;
core::task::ready!(self.poll_close(cx))?;
Ok(()).into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.63.0"
channel = "1.71.1"
components = [ "rustc", "clippy", "rustfmt" ]

0 comments on commit 9226e90

Please sign in to comment.