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 MSRV to 1.60.0 #1620

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.60.0"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn main() -> Result<(), Box<dyn Error>> {

`s2n-quic` will maintain a rolling MSRV (minimum supported rust version) policy of at least 6 months. The current s2n-quic version is not guaranteed to build on Rust versions earlier than the MSRV.

The current MSRV is [1.57.0][msrv-url].
The current MSRV is [1.60.0][msrv-url].

## Security issue notifications

Expand All @@ -132,5 +132,5 @@ This project is licensed under the [Apache-2.0 License][license-url].
[docs-url]: https://docs.rs/s2n-quic
[dependencies-badge]: https://img.shields.io/librariesio/release/cargo/s2n-quic.svg
[dependencies-url]: https://crates.io/crates/s2n-quic/dependencies
[msrv-badge]: https://img.shields.io/badge/MSRV-1.57.0-green
[msrv-url]: https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html
[msrv-badge]: https://img.shields.io/badge/MSRV-1.60.0-green
[msrv-url]: https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
2 changes: 1 addition & 1 deletion common/s2n-codec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Internal crate used by s2n-quic"
repository = "https://github.com/aws/s2n-quic"
authors = ["AWS s2n"]
edition = "2021"
rust-version = "1.57"
rust-version = "1.60"
license = "Apache-2.0"
# Exclude corpus files when publishing to crates.io
exclude = ["corpus.tar.gz"]
Expand Down
6 changes: 3 additions & 3 deletions common/s2n-codec/src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ impl fmt::Display for DecoderError {
}

match self {
Self::UnexpectedEof(len) => write!(f, "unexpected eof: {}", len),
Self::UnexpectedBytes(len) => write!(f, "unexpected bytes: {}", len),
Self::UnexpectedEof(len) => write!(f, "unexpected eof: {len}"),
Self::UnexpectedBytes(len) => write!(f, "unexpected bytes: {len}"),
Self::LengthCapacityExceeded => write!(
f,
"length could not be represented in platform's usize type"
),
Self::InvariantViolation(msg) => write!(f, "{}", msg),
Self::InvariantViolation(msg) => write!(f, "{msg}"),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions netbench/.clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.60.0"
6 changes: 3 additions & 3 deletions netbench/netbench-cli/src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Report {

scenario_names.insert(scenario_name.to_string());

pids.push(format!("!indata('data$hidden', 'name', {:?})", name));
pids.push(format!("!indata('data$hidden', 'name', {name:?})"));
names.push(name);

let input = serde_json::de::IoRead::new(input);
Expand Down Expand Up @@ -298,7 +298,7 @@ impl Report {
signals.push(json!({
"name": "sig$view",
"value": "0",
"update": format!("indexof({:?},ui$view)", view_names),
"update": format!("indexof({view_names:?},ui$view)"),
}));

signals.push(json!({
Expand All @@ -315,7 +315,7 @@ impl Report {
let mut stream_count_expr = "0".to_string();
for (id, count) in stream_counts.iter().enumerate() {
use core::fmt::Write;
let _ = write!(stream_count_expr, "+(pids[{}]?{}:0)", id, count);
let _ = write!(stream_count_expr, "+(pids[{id}]?{count}:0)");
}

signals.push(json!({
Expand Down
2 changes: 1 addition & 1 deletion netbench/netbench-collector/src/bpftrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl Report {
return;
}

eprintln!("> {}", line);
eprintln!("> {line}");
}

fn dump(&mut self) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Server {
handle_connection(acceptor, connection, id, scenario, trace, config, buffer)
.await
{
eprintln!("error: {}", err);
eprintln!("error: {err}");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Server {
let trace = trace.clone();
spawn(async move {
if let Err(error) = handle_connection(connection, scenario, trace).await {
eprintln!("error: {:#}", error);
eprintln!("error: {error:#}");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Server {
if let Err(err) =
handle_connection(acceptor, connection, id, scenario, trace, config).await
{
eprintln!("error: {}", err);
eprintln!("error: {err}");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Server {
if let Err(err) =
handle_connection(connection, id, scenario, trace, config, buffer).await
{
eprintln!("error: {}", err);
eprintln!("error: {err}");
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions netbench/netbench-driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ struct Resolver;
impl Resolver {
fn get(&self, key: String) -> Result<String> {
let host =
std::env::var(&key).map_err(|_| format!("missing {} environment variable", key))?;
std::env::var(&key).map_err(|_| format!("missing {key} environment variable"))?;
Ok(host)
}
}

impl client::Resolver for Resolver {
fn server(&mut self, id: u64) -> Result<String> {
self.get(format!("SERVER_{}", id))
self.get(format!("SERVER_{id}"))
}

fn router(&mut self, router_id: u64, server_id: u64) -> Result<String> {
self.get(format!("ROUTER_{}_SERVER_{}", router_id, server_id))
self.get(format!("ROUTER_{router_id}_SERVER_{server_id}"))
}
}

Expand Down
6 changes: 3 additions & 3 deletions netbench/netbench-scenarios/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Overrides {
pub fn errors(&self) -> impl Iterator<Item = String> + '_ {
self.errors
.iter()
.map(|(name, error)| format!("{}: {}\n", name, error))
.map(|(name, error)| format!("{name}: {error}\n"))
}
}

Expand Down Expand Up @@ -122,7 +122,7 @@ impl TryFromValue for bool {
Override::String(v) => match v.as_str() {
"true" | "TRUE" | "1" | "yes" | "YES" => Ok(true),
"false" | "FALSE" | "0" | "no" | "NO" => Ok(false),
_ => Err(format!("invalid bool: {:?}", v).into()),
_ => Err(format!("invalid bool: {v:?}").into()),
},
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ impl TryFromValue for Duration {
if *self == Self::ZERO {
return "0s".to_owned();
}
format!("{:?}", self)
format!("{self:?}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion netbench/netbench-scenarios/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn main<C: Configs>() -> Result<()> {

let mut has_error = false;
for error in overrides.errors() {
eprintln!("{}", error);
eprintln!("{error}");
has_error = true;
}

Expand Down
4 changes: 2 additions & 2 deletions netbench/netbench-scenarios/src/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub fn scenario(config: Config) -> Scenario {

scenario.create_client(|client| {
for size in sizes.iter().copied() {
let ping = format!("ping {}", size);
let pong = format!("pong {}", size);
let ping = format!("ping {size}");
let pong = format!("pong {size}");
client.scope(|client| {
for _ in 0..connections {
client.spawn(|client| {
Expand Down
6 changes: 3 additions & 3 deletions netbench/netbench/src/multiplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ mod tests {

match (c, s) {
(Poll::Ready(Ok(())), Poll::Ready(Ok(()))) => break,
(Poll::Ready(Err(e)), _) | (_, Poll::Ready(Err(e))) => panic!("{}", e),
(Poll::Ready(Err(e)), _) | (_, Poll::Ready(Err(e))) => panic!("{e}"),
_ => {
let current_count = count.get();
if current_count > prev_count {
Expand All @@ -573,10 +573,10 @@ mod tests {
eprintln!("the timer did not advance!");
eprintln!("server trace:");
eprintln!("{}", server_trace.as_str().unwrap());
eprintln!("{:#?}", server);
eprintln!("{server:#?}");
eprintln!("client trace:");
eprintln!("{}", client_trace.as_str().unwrap());
eprintln!("{:#?}", client);
eprintln!("{client:#?}");
panic!("test is deadlocked");
}
}
Expand Down
2 changes: 1 addition & 1 deletion netbench/netbench/src/multiplex/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl ReadBuffer {
for chunk in self.head.iter() {
actual_len += chunk.len();
}
assert_eq!(actual_len, self.remaining(), "{:?}", self);
assert_eq!(actual_len, self.remaining(), "{self:?}");
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions netbench/netbench/src/scenario/builder/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn create_cert(domain: &str, name: String, alg: &'static SignatureAlgorithm) ->
KeyUsagePurpose,
};

let mut params = CertificateParams::new(vec![domain.to_string(), format!("*.{}", domain)]);
let mut params = CertificateParams::new(vec![domain.to_string(), format!("*.{domain}")]);
params.alg = alg;
params.use_authority_key_identifier_extension = true;
params.distinguished_name = DistinguishedName::new();
Expand All @@ -73,11 +73,11 @@ impl Certificate {
let mut ias = HashMap::new();
let mut out = vec![];

let domain = format!("{}.net", id);
let domain = format!("{id}.net");
for (cert_idx, cert) in certs.into_iter().enumerate() {
match cert {
Self::Authority { alg } => {
let cert = create_ca(&domain, format!("netbench CA {}", cert_idx), alg);
let cert = create_ca(&domain, format!("netbench CA {cert_idx}"), alg);
let pem = cert.serialize_pem().unwrap();

out.push(Arc::new(scenario::Certificate {
Expand All @@ -95,7 +95,7 @@ impl Certificate {
// create any IAs we need
for (idx, alg) in intermediates.iter().copied().enumerate() {
ias.entry((authority, idx, alg)).or_insert_with(|| {
create_ca(&domain, format!("netbench IA {} {}", authority, idx), alg)
create_ca(&domain, format!("netbench IA {authority} {idx}"), alg)
});
}

Expand All @@ -108,7 +108,7 @@ impl Certificate {
.map(|(idx, alg)| ias.get(&(authority, idx, alg)).unwrap())
.chain(Some(ca));

let cert = create_cert(&domain, format!("netbench Leaf {}", cert_idx), alg);
let cert = create_cert(&domain, format!("netbench Leaf {cert_idx}"), alg);
let mut chain = String::new();
let private_key = cert.serialize_private_key_pem();

Expand Down
40 changes: 20 additions & 20 deletions netbench/netbench/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,17 +399,17 @@ pub trait Output {
) {
let _ = self.write(|out| {
use std::io::Write;
write!(out, "{} ", now)?;
write!(out, "{now} ")?;

write!(out, "[{}", id)?;
write!(out, "[{id}")?;
if verbose {
for (scope, thread) in scope.iter() {
write!(out, ":{}.{}", scope, thread)?;
write!(out, ":{scope}.{thread}")?;
}
}
write!(out, "] ")?;

writeln!(out, "{}", v)?;
writeln!(out, "{v}")?;
Ok(())
});
}
Expand Down Expand Up @@ -458,14 +458,14 @@ impl<O: Output> Trace for Logger<O> {
#[inline(always)]
fn exec(&mut self, now: Timestamp, op: &op::Connection) {
if self.verbose {
self.log(now, format_args!("exec: {:?}", op));
self.log(now, format_args!("exec: {op:?}"));
}
}

#[inline(always)]
fn exec_client(&mut self, now: Timestamp, op: &op::Client) {
if self.verbose {
self.log(now, format_args!("exec: {:?}", op));
self.log(now, format_args!("exec: {op:?}"));
}
}

Expand All @@ -481,32 +481,32 @@ impl<O: Output> Trace for Logger<O> {

#[inline(always)]
fn send(&mut self, now: Timestamp, stream_id: u64, len: u64) {
self.log(now, format_args!("send[{}]={}", stream_id, len));
self.log(now, format_args!("send[{stream_id}]={len}"));
}

#[inline(always)]
fn send_finish(&mut self, now: Timestamp, stream_id: u64) {
self.log(now, format_args!("sfin[{}]", stream_id));
self.log(now, format_args!("sfin[{stream_id}]"));
}

#[inline(always)]
fn receive(&mut self, now: Timestamp, stream_id: u64, len: u64) {
self.log(now, format_args!("recv[{}]={}", stream_id, len));
self.log(now, format_args!("recv[{stream_id}]={len}"));
}

#[inline(always)]
fn receive_finish(&mut self, now: Timestamp, stream_id: u64) {
self.log(now, format_args!("rfin[{}]", stream_id));
self.log(now, format_args!("rfin[{stream_id}]"));
}

#[inline(always)]
fn accept(&mut self, now: Timestamp, stream_id: u64) {
self.log(now, format_args!("acpt[{}]", stream_id));
self.log(now, format_args!("acpt[{stream_id}]"));
}

#[inline(always)]
fn open(&mut self, now: Timestamp, stream_id: u64) {
self.log(now, format_args!("open[{}]", stream_id));
self.log(now, format_args!("open[{stream_id}]"));
}

#[inline(always)]
Expand All @@ -516,9 +516,9 @@ impl<O: Output> Trace for Logger<O> {
let scope = &self.scope;
let verbose = self.verbose;
self.output
.log(id, scope, verbose, now, format_args!("trce[{}]", msg));
.log(id, scope, verbose, now, format_args!("trce[{msg}]"));
} else {
self.log(now, format_args!("trce[{}]", id));
self.log(now, format_args!("trce[{id}]"));
}
}

Expand All @@ -533,27 +533,27 @@ impl<O: Output> Trace for Logger<O> {
scope,
verbose,
now,
format_args!("prof[{}]={:?}", msg, time),
format_args!("prof[{msg}]={time:?}"),
);
} else {
self.log(now, format_args!("prof[{}]={:?}", id, time));
self.log(now, format_args!("prof[{id}]={time:?}"));
}
}

#[inline(always)]
fn park(&mut self, now: Timestamp, id: u64) {
self.log(now, format_args!("park[{}]", id));
self.log(now, format_args!("park[{id}]"));
}

#[inline(always)]
fn unpark(&mut self, now: Timestamp, id: u64) {
self.log(now, format_args!("uprk[{}]", id));
self.log(now, format_args!("uprk[{id}]"));
}

fn connect(&mut self, now: Timestamp, connection_id: u64, time: Duration) {
self.log(
now,
format_args!("conn[{}]={:?}us", connection_id, time.as_micros()),
format_args!("conn[{connection_id}]={:?}us", time.as_micros()),
);
}
}
Expand Down Expand Up @@ -584,7 +584,7 @@ impl Throughput {
let elapsed = now - prev;
let ts = unsafe { Timestamp::from_duration(now - start) };
let v = self.0.results.take();
eprintln!("{} {}", ts, v / elapsed);
eprintln!("{ts} {}", v / elapsed);
now
}
}
Expand Down
Loading