about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_metadata/schema.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_metadata/schema.rs b/src/librustc_metadata/schema.rs
index 956577ed8fb..f4d1e8e17f8 100644
--- a/src/librustc_metadata/schema.rs
+++ b/src/librustc_metadata/schema.rs
@@ -26,8 +26,12 @@ use syntax_pos::{self, Span};
 
 use std::marker::PhantomData;
 
+#[cfg(not(test))]
 pub const RUSTC_VERSION: &'static str = concat!("rustc ", env!("CFG_VERSION"));
 
+#[cfg(test)]
+pub const RUSTC_VERSION: &'static str = "rustc 0.0.0-unit-test";
+
 /// Metadata encoding version.
 /// NB: increment this if you change the format of metadata such that
 /// the rustc version can't be found to compare with `RUSTC_VERSION`.