Skip to content

Commit 9528dd0

Browse files
authored
Merge pull request #2042 from Kobzol/bump-msrv
Bump MSRV to 1.81
2 parents bf70880 + dea9f1e commit 9528dd0

File tree

18 files changed

+31
-42
lines changed

18 files changed

+31
-42
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- master
6-
pull_request: {}
6+
pull_request: { }
77
schedule:
88
- cron: "0 12 * * 1" # Every Monday at 12:00 UTC
99

@@ -26,7 +26,7 @@ jobs:
2626
rustup default $RUST_TOOLCHAIN_VERSION
2727
rustup component add --toolchain $RUST_TOOLCHAIN_VERSION rustfmt clippy
2828
env:
29-
RUST_TOOLCHAIN_VERSION: 1.75.0
29+
RUST_TOOLCHAIN_VERSION: 1.81.0
3030

3131
- uses: Swatinem/rust-cache@v2
3232
with:

collector/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "collector"
44
version = "0.1.0"
55
edition = "2021"
66
description = "Collects Rust performance data"
7-
rust-version = "1.75.0"
7+
rust-version = "1.81.0"
88

99
[dependencies]
1010
anyhow = { workspace = true }

collector/src/artifact_stats.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ impl ArtifactStats {
107107
/// Normalizes the following things, in the following order:
108108
/// - Demangles the symbol.
109109
/// - Removes `.cold` and `.warm` from the end of the symbol, to merge cold and hot parts of a function
110-
/// into the same symbol.
110+
/// into the same symbol.
111111
/// - Removes rustc hashes from the symbol, e.g. `foo::[abcdef]` -> `foo::[]` or
112-
/// `foo::abcd` -> `foo`.
112+
/// `foo::abcd` -> `foo`.
113113
/// - Removes suffixes after a dot from the symbol, e.g. `anon.abcdef.123` -> `anon` or
114-
/// `foo.llvm.123` -> `foo`.
114+
/// `foo.llvm.123` -> `foo`.
115115
///
116116
/// These modifications should remove things added by LLVM in the LTO/PGO phase.
117117
/// See more information here: https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#vendor-specific-suffix

collector/src/bin/rustc-fake.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ fn main() {
118118

119119
let prof_out_dir = create_self_profile_dir();
120120
if wrapper == "PerfStatSelfProfile" {
121-
cmd.arg(&format!(
122-
"-Zself-profile={}",
123-
prof_out_dir.to_str().unwrap()
124-
));
121+
cmd.arg(format!("-Zself-profile={}", prof_out_dir.to_str().unwrap()));
125122
let _ = fs::remove_dir_all(&prof_out_dir);
126123
let _ = fs::create_dir_all(&prof_out_dir);
127124
}
@@ -189,10 +186,7 @@ fn main() {
189186

190187
let prof_out_dir = create_self_profile_dir();
191188
if wrapper == "XperfStatSelfProfile" {
192-
tool.arg(&format!(
193-
"-Zself-profile={}",
194-
prof_out_dir.to_str().unwrap()
195-
));
189+
tool.arg(format!("-Zself-profile={}", prof_out_dir.to_str().unwrap()));
196190
let _ = fs::remove_dir_all(&prof_out_dir);
197191
let _ = fs::create_dir_all(&prof_out_dir);
198192
}

collector/src/compile/execute/bencher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a> BenchProcessor<'a> {
120120
}
121121
}
122122

123-
impl<'a> Processor for BenchProcessor<'a> {
123+
impl Processor for BenchProcessor<'_> {
124124
fn perf_tool(&self) -> PerfTool {
125125
if self.is_first_collection && self.is_self_profile {
126126
if cfg!(unix) {
@@ -309,7 +309,7 @@ impl SelfProfileS3Upload {
309309
.arg("INTELLIGENT_TIERING")
310310
.arg("--only-show-errors")
311311
.arg(upload.path())
312-
.arg(&format!(
312+
.arg(format!(
313313
"s3://rustc-perf/{}",
314314
&prefix.join(filename).to_str().unwrap()
315315
))

collector/src/compile/execute/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,7 @@ fn process_stat_output(
583583
// In any case it's better than crashing the collector and looping indefinitely trying
584584
// to to complete a run -- which happens if we propagate `parse_self_profile`'s errors
585585
// up to the caller.
586-
if let Ok(self_profile_data) = parse_self_profile(dir, krate) {
587-
self_profile_data
588-
} else {
589-
(None, None)
590-
}
586+
parse_self_profile(dir, krate).unwrap_or_default()
591587
}
592588
_ => (None, None),
593589
};
@@ -640,9 +636,11 @@ fn parse_self_profile(
640636
// `perf` pid. So just blindly look in the directory to hopefully find it.
641637
for entry in fs::read_dir(dir)? {
642638
let entry = entry?;
643-
if entry.file_name().to_str().map_or(false, |s| {
644-
s.starts_with(&crate_name) && s.ends_with("mm_profdata")
645-
}) {
639+
if entry
640+
.file_name()
641+
.to_str()
642+
.is_some_and(|s| s.starts_with(&crate_name) && s.ends_with("mm_profdata"))
643+
{
646644
full_path = Some(entry.path());
647645
break;
648646
}

collector/src/compile/execute/profiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<'a> ProfileProcessor<'a> {
106106
}
107107
}
108108

109-
impl<'a> Processor for ProfileProcessor<'a> {
109+
impl Processor for ProfileProcessor<'_> {
110110
fn perf_tool(&self) -> PerfTool {
111111
PerfTool::ProfileTool(self.profiler)
112112
}

collector/src/compile/execute/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ async fn record(
9191
.arg("--set")
9292
.arg("rust.deny-warnings=false")
9393
.arg("--set")
94-
.arg(&format!("build.rustc={}", fake_rustc.to_str().unwrap()))
94+
.arg(format!("build.rustc={}", fake_rustc.to_str().unwrap()))
9595
.env("RUSTC_PERF_REAL_RUSTC", &toolchain.components.rustc)
9696
.arg("--set")
97-
.arg(&format!(
97+
.arg(format!(
9898
"build.cargo={}",
9999
toolchain.components.cargo.to_str().unwrap()
100100
))

collector/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'de> Deserialize<'de> for Bound {
8585
{
8686
struct BoundVisitor;
8787

88-
impl<'de> serde::de::Visitor<'de> for BoundVisitor {
88+
impl serde::de::Visitor<'_> for BoundVisitor {
8989
type Value = Bound;
9090

9191
fn visit_str<E>(self, value: &str) -> ::std::result::Result<Bound, E>

database/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'de> Deserialize<'de> for Date {
113113
{
114114
struct DateVisitor;
115115

116-
impl<'de> serde::de::Visitor<'de> for DateVisitor {
116+
impl serde::de::Visitor<'_> for DateVisitor {
117117
type Value = Date;
118118

119119
fn visit_str<E>(self, value: &str) -> ::std::result::Result<Date, E>

database/src/pool/postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl ConnectionManager for Postgres {
326326
}
327327

328328
#[async_trait::async_trait]
329-
impl<'a> Transaction for PostgresTransaction<'a> {
329+
impl Transaction for PostgresTransaction<'_> {
330330
async fn commit(self: Box<Self>) -> Result<(), anyhow::Error> {
331331
Ok(self.conn.commit().await?)
332332
}

database/src/pool/sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct SqliteTransaction<'a> {
2020
}
2121

2222
#[async_trait::async_trait]
23-
impl<'a> Transaction for SqliteTransaction<'a> {
23+
impl Transaction for SqliteTransaction<'_> {
2424
async fn commit(mut self: Box<Self>) -> Result<(), anyhow::Error> {
2525
self.finished = true;
2626
Ok(self.conn.raw().execute_batch("COMMIT")?)

site/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ where
2121
{
2222
struct CommaSeparatedVisitor<T>(PhantomData<T>);
2323

24-
impl<'de, T: DeserializeOwned> serde::de::Visitor<'de> for CommaSeparatedVisitor<T> {
24+
impl<T: DeserializeOwned> serde::de::Visitor<'_> for CommaSeparatedVisitor<T> {
2525
type Value = Vec<T>;
2626

2727
fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result {

site/src/comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ impl ArtifactComparison {
994994
if let Some(b) = master_commits.iter().find(|c| c.sha == b.sha) {
995995
b.parent_sha == a.sha
996996
} else {
997-
conn.parent_of(&b.sha).await.map_or(false, |p| p == a.sha)
997+
conn.parent_of(&b.sha).await.as_ref() == Some(&a.sha)
998998
}
999999
}
10001000
_ => false,

site/src/request_handlers/graph.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ pub async fn handle_graphs(
183183
};
184184

185185
if is_default_query {
186-
match &**ctxt.landing_page.load() {
187-
Some(resp) => return Ok(resp.clone()),
188-
None => {}
186+
if let Some(resp) = &**ctxt.landing_page.load() {
187+
return Ok(resp.clone());
189188
}
190189
}
191190

site/src/self_profile/codegen_schedule.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn by_thread(self_profile_data: Vec<u8>) -> anyhow::Result<(u64, HashMap<u32, Ve
2424
let mut start = None;
2525
for event in data
2626
.iter()
27-
.filter(|e| e.timestamp().map_or(false, |t| !t.is_instant()))
27+
.filter(|e| e.timestamp().is_some_and(|t| !t.is_instant()))
2828
{
2929
let full_event = data.to_full_event(&event);
3030
if is_interesting(&full_event.label) {
@@ -43,7 +43,7 @@ fn by_thread(self_profile_data: Vec<u8>) -> anyhow::Result<(u64, HashMap<u32, Ve
4343
let mut by_thread = HashMap::new();
4444
for event in data
4545
.iter()
46-
.filter(|e| e.timestamp().map_or(false, |t| !t.is_instant()))
46+
.filter(|e| e.timestamp().is_some_and(|t| !t.is_instant()))
4747
{
4848
let full_event = data.to_full_event(&event);
4949

site/src/self_profile/crox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub fn generate(self_profile_data: Vec<u8>, opt: Opt) -> anyhow::Result<Vec<u8>>
144144
// only handle Interval events for now
145145
for event in data
146146
.iter()
147-
.filter(|e| e.timestamp().map_or(false, |t| !t.is_instant()))
147+
.filter(|e| e.timestamp().is_some_and(|t| !t.is_instant()))
148148
{
149149
let duration = event.duration().unwrap();
150150
if let Some(minimum_duration) = opt.minimum_duration {

site/src/server.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,7 @@ async fn serve_req(server: Server, req: Request) -> Result<Response, ServerError
343343
.headers()
344344
.get(hyper::header::ACCEPT_ENCODING)
345345
.and_then(|e| e.to_str().ok())
346-
.map_or(false, |s| {
347-
s.split(',').any(|part| part.trim().starts_with("br"))
348-
});
346+
.is_some_and(|s| s.split(',').any(|part| part.trim().starts_with("br")));
349347

350348
let compression = if allow_compression {
351349
// In tests on /perf/graphs and /perf/get, quality = 2 reduces size by 20-40% compared to 0,

0 commit comments

Comments
 (0)