1
Fork 0

Add Config::hash_untracked_state callback

This commit is contained in:
Alex Macleod 2023-10-13 17:28:34 +00:00
parent 34bc5716b5
commit 59f6f044f5
7 changed files with 28 additions and 7 deletions

View file

@ -1047,6 +1047,7 @@ impl Default for Options {
target_triple: TargetTriple::from_triple(host_triple()),
test: false,
incremental: None,
untracked_state_hash: Default::default(),
unstable_opts: Default::default(),
prints: Vec::new(),
cg: Default::default(),
@ -2889,6 +2890,7 @@ pub fn build_session_options(
target_triple,
test,
incremental,
untracked_state_hash: Default::default(),
unstable_opts,
prints,
cg,
@ -3167,17 +3169,17 @@ impl PpMode {
/// we have an opt-in scheme here, so one is hopefully forced to think about
/// how the hash should be calculated when adding a new command-line argument.
pub(crate) mod dep_tracking {
use super::Polonius;
use super::{
BranchProtection, CFGuard, CFProtection, CrateType, DebugInfo, DebugInfoCompression,
ErrorOutputType, InstrumentCoverage, InstrumentXRay, LinkerPluginLto, LocationDetail,
LtoCli, OomStrategy, OptLevel, OutFileName, OutputType, OutputTypes, Passes,
LtoCli, OomStrategy, OptLevel, OutFileName, OutputType, OutputTypes, Polonius,
ResolveDocLinks, SourceFileHashAlgorithm, SplitDwarfKind, SwitchWithOptPath,
SymbolManglingVersion, TraitSolver, TrimmedDefPaths,
};
use crate::lint;
use crate::options::WasiExecModel;
use crate::utils::{NativeLib, NativeLibKind};
use crate::utils::NativeLib;
use rustc_data_structures::stable_hasher::Hash64;
use rustc_errors::LanguageIdentifier;
use rustc_feature::UnstableFeatures;
use rustc_span::edition::Edition;
@ -3233,6 +3235,7 @@ pub(crate) mod dep_tracking {
usize,
NonZeroUsize,
u64,
Hash64,
String,
PathBuf,
lint::Level,
@ -3247,14 +3250,12 @@ pub(crate) mod dep_tracking {
MergeFunctions,
PanicStrategy,
RelroLevel,
Passes,
OptLevel,
LtoCli,
DebugInfo,
DebugInfoCompression,
UnstableFeatures,
NativeLib,
NativeLibKind,
SanitizerSet,
CFGuard,
CFProtection,

View file

@ -4,6 +4,7 @@ use crate::search_paths::SearchPath;
use crate::utils::NativeLib;
use crate::{lint, EarlyErrorHandler};
use rustc_data_structures::profiling::TimePassesFormat;
use rustc_data_structures::stable_hasher::Hash64;
use rustc_errors::ColorConfig;
use rustc_errors::{LanguageIdentifier, TerminalUrl};
use rustc_target::spec::{CodeModel, LinkerFlavorCli, MergeFunctions, PanicStrategy, SanitizerSet};
@ -158,6 +159,10 @@ top_level_options!(
/// directory to store intermediate results.
incremental: Option<PathBuf> [UNTRACKED],
assert_incr_state: Option<IncrementalStateAssertion> [UNTRACKED],
/// Set by the `Config::hash_untracked_state` callback for custom
/// drivers to invalidate the incremental cache
#[rustc_lint_opt_deny_field_access("should only be used via `Config::hash_untracked_state`")]
untracked_state_hash: Hash64 [TRACKED_NO_CRATE_HASH],
unstable_opts: UnstableOptions [SUBSTRUCT],
prints: Vec<PrintRequest> [UNTRACKED],