Only depend on CFG_VERSION in rustc_interface

this avoids having to rebuild the whole compiler on each commit when
`omit-git-hash = false`.
This commit is contained in:
jyn 2023-05-08 04:12:38 -05:00
parent 0dddad0dc5
commit d5f2b8e5c6
24 changed files with 97 additions and 71 deletions

View file

@ -211,6 +211,9 @@ pub struct Session {
/// Set of enabled features for the current target, including unstable ones.
pub unstable_target_features: FxIndexSet<Symbol>,
/// 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<lint::LintId, lint::Level>,
file_loader: Option<Box<dyn FileLoader + Send + Sync + 'static>>,
target_override: Option<Target>,
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);