File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
compiler/rustc_data_structures/src Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,25 @@ impl SelfProfilerRef {
223223 VerboseTimingGuard :: start ( message_and_format, self . generic_activity ( event_label) )
224224 }
225225
226+ /// Like `verbose_generic_activity`, but with an extra arg.
227+ pub fn verbose_generic_activity_with_arg < A > (
228+ & self ,
229+ event_label : & ' static str ,
230+ event_arg : A ,
231+ ) -> VerboseTimingGuard < ' _ >
232+ where
233+ A : Borrow < str > + Into < String > ,
234+ {
235+ let message_and_format = self
236+ . print_verbose_generic_activities
237+ . map ( |format| ( format ! ( "{}({})" , event_label, event_arg. borrow( ) ) , format) ) ;
238+
239+ VerboseTimingGuard :: start (
240+ message_and_format,
241+ self . generic_activity_with_arg ( event_label, event_arg) ,
242+ )
243+ }
244+
226245 /// Start profiling a generic activity. Profiling continues until the
227246 /// TimingGuard returned from this call is dropped.
228247 #[ inline( always) ]
You can’t perform that action at this time.
0 commit comments