Skip to content

Remove Config::hash_untracked_state. #117897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ fn run_compiler(
locale_resources: DEFAULT_LOCALE_RESOURCES,
lint_caps: Default::default(),
parse_sess_created: None,
hash_untracked_state: None,
register_lints: None,
override_queries: None,
make_codegen_backend,
Expand Down
13 changes: 0 additions & 13 deletions compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use rustc_ast::{self as ast, LitKind, MetaItemKind};
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_data_structures::defer;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_data_structures::sync::Lrc;
use rustc_errors::registry::Registry;
use rustc_errors::{ErrorGuaranteed, Handler};
Expand Down Expand Up @@ -347,12 +346,6 @@ pub struct Config {
/// This is a callback from the driver that is called when [`ParseSess`] is created.
pub parse_sess_created: Option<Box<dyn FnOnce(&mut ParseSess) + Send>>,

/// This is a callback to hash otherwise untracked state used by the caller, if the
/// hash changes between runs the incremental cache will be cleared.
///
/// e.g. used by Clippy to hash its config file
pub hash_untracked_state: Option<Box<dyn FnOnce(&Session, &mut StableHasher) + Send>>,

/// This is a callback from the driver that is called when we're registering lints;
/// it is called during lint loading when we have the LintStore in a non-shared state.
///
Expand Down Expand Up @@ -467,12 +460,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
parse_sess_created(&mut sess.parse_sess);
}

if let Some(hash_untracked_state) = config.hash_untracked_state {
let mut hasher = StableHasher::new();
hash_untracked_state(&sess, &mut hasher);
sess.opts.untracked_state_hash = hasher.finish()
}

let compiler = Compiler {
sess: Lrc::new(sess),
codegen_backend: Lrc::from(codegen_backend),
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,6 @@ 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(),
Expand Down Expand Up @@ -2880,7 +2879,6 @@ pub fn build_session_options(
target_triple,
test,
incremental,
untracked_state_hash: Default::default(),
unstable_opts,
prints,
cg,
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ 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};
Expand Down Expand Up @@ -158,10 +157,6 @@ 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],
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ pub(crate) fn create_config(
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES,
lint_caps,
parse_sess_created: None,
hash_untracked_state: None,
register_lints: Some(Box::new(crate::lint::register_lints)),
override_queries: Some(|_sess, providers| {
// We do not register late module lints, so this only runs `MissingDoc`.
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ pub(crate) fn run(options: RustdocOptions) -> Result<(), ErrorGuaranteed> {
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES,
lint_caps,
parse_sess_created: None,
hash_untracked_state: None,
register_lints: Some(Box::new(crate::lint::register_lints)),
override_queries: None,
make_codegen_backend: None,
Expand Down
1 change: 0 additions & 1 deletion tests/run-make-fulldeps/issue-19371/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
locale_resources: &[],
lint_caps: Default::default(),
parse_sess_created: None,
hash_untracked_state: None,
register_lints: None,
override_queries: None,
make_codegen_backend: None,
Expand Down