about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorJane Losare-Lusby <jlusby@yaah.dev>2025-03-25 11:56:55 -0700
committerJane Losare-Lusby <jlusby@yaah.dev>2025-04-01 12:12:14 -0700
commit6ce74f78f002d40b98138ee2ba00bbb21af2630d (patch)
tree26d9b17b913de29b9cee61fceb23c319548ba8a6 /compiler/rustc_middle/src
parentd4bdd1ed551fed0c951eb47b4be2c79d7a02d181 (diff)
downloadrust-6ce74f78f002d40b98138ee2ba00bbb21af2630d.tar.gz
rust-6ce74f78f002d40b98138ee2ba00bbb21af2630d.zip
replace extra_filename with strict version hash in metrics file names
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 86248b495cd..8b6b2bc2493 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -1738,10 +1738,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]