File tree Expand file tree Collapse file tree 16 files changed +28
-39
lines changed Expand file tree Collapse file tree 16 files changed +28
-39
lines changed Original file line number Diff line number Diff line change @@ -107,11 +107,11 @@ impl ArtifactStats {
107
107
/// Normalizes the following things, in the following order:
108
108
/// - Demangles the symbol.
109
109
/// - 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.
111
111
/// - Removes rustc hashes from the symbol, e.g. `foo::[abcdef]` -> `foo::[]` or
112
- /// `foo::abcd` -> `foo`.
112
+ /// `foo::abcd` -> `foo`.
113
113
/// - 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`.
115
115
///
116
116
/// These modifications should remove things added by LLVM in the LTO/PGO phase.
117
117
/// See more information here: https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#vendor-specific-suffix
Original file line number Diff line number Diff line change @@ -118,10 +118,7 @@ fn main() {
118
118
119
119
let prof_out_dir = create_self_profile_dir ( ) ;
120
120
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( ) ) ) ;
125
122
let _ = fs:: remove_dir_all ( & prof_out_dir) ;
126
123
let _ = fs:: create_dir_all ( & prof_out_dir) ;
127
124
}
@@ -189,10 +186,7 @@ fn main() {
189
186
190
187
let prof_out_dir = create_self_profile_dir ( ) ;
191
188
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( ) ) ) ;
196
190
let _ = fs:: remove_dir_all ( & prof_out_dir) ;
197
191
let _ = fs:: create_dir_all ( & prof_out_dir) ;
198
192
}
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ impl<'a> BenchProcessor<'a> {
120
120
}
121
121
}
122
122
123
- impl < ' a > Processor for BenchProcessor < ' a > {
123
+ impl Processor for BenchProcessor < ' _ > {
124
124
fn perf_tool ( & self ) -> PerfTool {
125
125
if self . is_first_collection && self . is_self_profile {
126
126
if cfg ! ( unix) {
@@ -309,7 +309,7 @@ impl SelfProfileS3Upload {
309
309
. arg ( "INTELLIGENT_TIERING" )
310
310
. arg ( "--only-show-errors" )
311
311
. arg ( upload. path ( ) )
312
- . arg ( & format ! (
312
+ . arg ( format ! (
313
313
"s3://rustc-perf/{}" ,
314
314
& prefix. join( filename) . to_str( ) . unwrap( )
315
315
) )
Original file line number Diff line number Diff line change @@ -583,11 +583,7 @@ fn process_stat_output(
583
583
// In any case it's better than crashing the collector and looping indefinitely trying
584
584
// to to complete a run -- which happens if we propagate `parse_self_profile`'s errors
585
585
// 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 ( )
591
587
}
592
588
_ => ( None , None ) ,
593
589
} ;
@@ -640,9 +636,11 @@ fn parse_self_profile(
640
636
// `perf` pid. So just blindly look in the directory to hopefully find it.
641
637
for entry in fs:: read_dir ( dir) ? {
642
638
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
+ {
646
644
full_path = Some ( entry. path ( ) ) ;
647
645
break ;
648
646
}
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ impl<'a> ProfileProcessor<'a> {
106
106
}
107
107
}
108
108
109
- impl < ' a > Processor for ProfileProcessor < ' a > {
109
+ impl Processor for ProfileProcessor < ' _ > {
110
110
fn perf_tool ( & self ) -> PerfTool {
111
111
PerfTool :: ProfileTool ( self . profiler )
112
112
}
Original file line number Diff line number Diff line change @@ -91,10 +91,10 @@ async fn record(
91
91
. arg ( "--set" )
92
92
. arg ( "rust.deny-warnings=false" )
93
93
. arg ( "--set" )
94
- . arg ( & format ! ( "build.rustc={}" , fake_rustc. to_str( ) . unwrap( ) ) )
94
+ . arg ( format ! ( "build.rustc={}" , fake_rustc. to_str( ) . unwrap( ) ) )
95
95
. env ( "RUSTC_PERF_REAL_RUSTC" , & toolchain. components . rustc )
96
96
. arg ( "--set" )
97
- . arg ( & format ! (
97
+ . arg ( format ! (
98
98
"build.cargo={}" ,
99
99
toolchain. components. cargo. to_str( ) . unwrap( )
100
100
) )
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ impl<'de> Deserialize<'de> for Bound {
85
85
{
86
86
struct BoundVisitor ;
87
87
88
- impl < ' de > serde:: de:: Visitor < ' de > for BoundVisitor {
88
+ impl serde:: de:: Visitor < ' _ > for BoundVisitor {
89
89
type Value = Bound ;
90
90
91
91
fn visit_str < E > ( self , value : & str ) -> :: std:: result:: Result < Bound , E >
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ impl<'de> Deserialize<'de> for Date {
113
113
{
114
114
struct DateVisitor ;
115
115
116
- impl < ' de > serde:: de:: Visitor < ' de > for DateVisitor {
116
+ impl serde:: de:: Visitor < ' _ > for DateVisitor {
117
117
type Value = Date ;
118
118
119
119
fn visit_str < E > ( self , value : & str ) -> :: std:: result:: Result < Date , E >
Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ impl ConnectionManager for Postgres {
326
326
}
327
327
328
328
#[ async_trait:: async_trait]
329
- impl < ' a > Transaction for PostgresTransaction < ' a > {
329
+ impl Transaction for PostgresTransaction < ' _ > {
330
330
async fn commit ( self : Box < Self > ) -> Result < ( ) , anyhow:: Error > {
331
331
Ok ( self . conn . commit ( ) . await ?)
332
332
}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub struct SqliteTransaction<'a> {
20
20
}
21
21
22
22
#[ async_trait:: async_trait]
23
- impl < ' a > Transaction for SqliteTransaction < ' a > {
23
+ impl Transaction for SqliteTransaction < ' _ > {
24
24
async fn commit ( mut self : Box < Self > ) -> Result < ( ) , anyhow:: Error > {
25
25
self . finished = true ;
26
26
Ok ( self . conn . raw ( ) . execute_batch ( "COMMIT" ) ?)
You can’t perform that action at this time.
0 commit comments