From d5f2b8e5c65b0406254b990296793f664c1926a0 Mon Sep 17 00:00:00 2001 From: jyn Date: Mon, 8 May 2023 04:12:38 -0500 Subject: Only depend on CFG_VERSION in rustc_interface this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. --- compiler/rustc_session/src/session.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index a988d7f28e6..cdac74759e3 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -211,6 +211,9 @@ pub struct Session { /// Set of enabled features for the current target, including unstable ones. pub unstable_target_features: FxIndexSet, + + /// The version of the rustc process, possibly including a commit hash and description. + pub cfg_version: &'static str, } pub struct PerfStats { @@ -1380,6 +1383,7 @@ pub fn build_session( driver_lint_caps: FxHashMap, file_loader: Option>, target_override: Option, + cfg_version: &'static str, ) -> Session { // FIXME: This is not general enough to make the warning lint completely override // normal diagnostic warnings, since the warning lint can also be denied and changed @@ -1524,6 +1528,7 @@ pub fn build_session( asm_arch, target_features: Default::default(), unstable_target_features: Default::default(), + cfg_version, }; validate_commandline_args_with_session_available(&sess); -- cgit 1.4.1-3-g733a5