Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 564f2ee

Browse files
committed
rustc_metadata: don't die with --test because CFG_VERSION is missing.
1 parent a23b8ca commit 564f2ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_metadata/schema.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ use syntax_pos::{self, Span};
2626

2727
use std::marker::PhantomData;
2828

29+
#[cfg(not(test))]
2930
pub const RUSTC_VERSION: &'static str = concat!("rustc ", env!("CFG_VERSION"));
3031

32+
#[cfg(test)]
33+
pub const RUSTC_VERSION: &'static str = "rustc 0.0.0-unit-test";
34+
3135
/// Metadata encoding version.
3236
/// NB: increment this if you change the format of metadata such that
3337
/// the rustc version can't be found to compare with `RUSTC_VERSION`.

0 commit comments

Comments
 (0)