about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-04-05 13:18:15 +1100
committerGitHub <noreply@github.com>2025-04-05 13:18:15 +1100
commitae745a06fa2c6d6a0b288b495fd64bd09f21c21e (patch)
tree18497a06b978e0051c6bc3765f33488bd8638165 /compiler/rustc_middle/src
parent93f7583491ff4d8cd0e06486589c279856e0b1e3 (diff)
parent6ce74f78f002d40b98138ee2ba00bbb21af2630d (diff)
downloadrust-ae745a06fa2c6d6a0b288b495fd64bd09f21c21e.tar.gz
rust-ae745a06fa2c6d6a0b288b495fd64bd09f21c21e.zip
Rollup merge of #138950 - yaahc:svh-metrics-name, r=bjorn3
replace extra_filename with strict version hash in metrics file names

Should resolve the potential issue of overwriting metrics from the same crate when compiled with different features or flags.

r? `````@estebank`````

try-job: test-various
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/context.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1efe36a0910..162ca1f4af8 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -1807,10 +1807,15 @@ impl<'tcx> TyCtxt<'tcx> {
         // - needs_metadata: for putting into crate metadata.
         // - instrument_coverage: for putting into coverage data (see
         //   `hash_mir_source`).
+        // - metrics_dir: metrics use the strict version hash in the filenames
+        //   for dumped metrics files to prevent overwriting distinct metrics
+        //   for similar source builds (may change in the future, this is part
+        //   of the proof of concept impl for the metrics initiative project goal)
         cfg!(debug_assertions)
             || self.sess.opts.incremental.is_some()
             || self.needs_metadata()
             || self.sess.instrument_coverage()
+            || self.sess.opts.unstable_opts.metrics_dir.is_some()
     }
 
     #[inline]