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 {
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
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ) )
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ) )
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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" ) ?)
You can’t perform that action at this time.
0 commit comments