We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
self.prof.enabled()
1 parent 6351247 commit 97814ddCopy full SHA for 97814dd
compiler/rustc_session/src/utils.rs
@@ -9,7 +9,11 @@ impl Session {
9
}
10
/// Used by `-Z self-profile`.
11
pub fn time<R>(&self, what: &'static str, f: impl FnOnce() -> R) -> R {
12
- self.prof.verbose_generic_activity(what).run(f)
+ if self.prof.enabled() {
13
+ return self.prof.verbose_generic_activity(what).run(f)
14
+ } else {
15
+ return f()
16
+ }
17
18
19
0 commit comments