From 564f2ee33c479c74f68fd9ae33b179de0b8537c9 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Sun, 18 Sep 2016 14:05:49 +0300 Subject: [PATCH] rustc_metadata: don't die with --test because CFG_VERSION is missing. --- src/librustc_metadata/schema.rs | 4 ++++ 1 file changed, 4 insertions(+) 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`.