diff options
| author | bors <bors@rust-lang.org> | 2023-10-16 16:33:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-16 16:33:42 +0000 |
| commit | 4af886f8ab94543caad689ee6bf6a93fa8bd4a98 (patch) | |
| tree | 08d36ed96e86164ed272ced966a8a2e6023fcd2f /src | |
| parent | 98c1e3d95ba7f5d29915dac3f391a296648aa74c (diff) | |
| parent | 59f6f044f5228e039e1310b97f478c79aa745f35 (diff) | |
| download | rust-4af886f8ab94543caad689ee6bf6a93fa8bd4a98.tar.gz rust-4af886f8ab94543caad689ee6bf6a93fa8bd4a98.zip | |
Auto merge of #116731 - Alexendoo:hash-untracked-state, r=oli-obk
Add `Config::hash_untracked_state` callback For context, I'm looking to use [late module passes](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/context/struct.LintStore.html#structfield.late_module_passes) in Clippy which unlike regular late passes run incrementally per module However we have a config file which can change between runs, we need changes to that to invalidate the `lint_mod` query. This PR adds a side channel for us to hash some extra state into `Options` in order to do that This does not make any changes to Clippy, I plan to do that in a PR to the Clippy repo along with some other required changes An alternative implementation would be to add a new query to track this state and override the `lint_mod` query in Clippy to first call that cc `@rust-lang/clippy`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/core.rs | 1 | ||||
| -rw-r--r-- | src/librustdoc/doctest.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 3e6066c78fb..9066061f1a2 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -262,6 +262,7 @@ 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`. diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 741d329fb19..db69cf5752d 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -104,6 +104,7 @@ 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, |
