about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-25 15:29:51 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-07-30 14:08:02 +0000
commit92f263b7926537d086bcb6bfac33fe2b93e44aa1 (patch)
tree0a0e1c097681db6e48e978e4ea2bb35026362c10 /compiler/rustc_driver_impl/src
parentcbab16feafcd828c813a1c4926eade67f464cff9 (diff)
downloadrust-92f263b7926537d086bcb6bfac33fe2b93e44aa1.tar.gz
rust-92f263b7926537d086bcb6bfac33fe2b93e44aa1.zip
Make RUSTC_OVERRIDE_VERSION_STRING overwrite the rendered version output, too
Diffstat (limited to 'compiler/rustc_driver_impl/src')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index d9633d69f1d..627a0ebb4e5 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -909,6 +909,15 @@ pub fn version_at_macro_invocation(
 ) {
     let verbose = matches.opt_present("verbose");
 
+    let mut version = version;
+    let mut release = release;
+    let tmp;
+    if let Ok(force_version) = std::env::var("RUSTC_OVERRIDE_VERSION_STRING") {
+        tmp = force_version;
+        version = &tmp;
+        release = &tmp;
+    }
+
     safe_println!("{binary} {version}");
 
     if verbose {