diff options
| author | xFrednet <xFrednet@gmail.com> | 2022-03-29 00:10:45 +0200 |
|---|---|---|
| committer | xFrednet <xFrednet@gmail.com> | 2022-05-08 14:37:14 +0200 |
| commit | 2c5e85249f8b10b5fb0caf608d8b2537620285c6 (patch) | |
| tree | 8d3d6e7b8e79d54df8b5eda69dbe45923b666a47 /compiler/rustc_middle/src/query/mod.rs | |
| parent | 7f03681cd941c7e18ee99549148b8aa6f468d7c2 (diff) | |
| download | rust-2c5e85249f8b10b5fb0caf608d8b2537620285c6.tar.gz rust-2c5e85249f8b10b5fb0caf608d8b2537620285c6.zip | |
Move lint expectation checking into a separate query (RFC 2383)
Diffstat (limited to 'compiler/rustc_middle/src/query/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index e439d128dbc..3936b3f0d68 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -157,6 +157,25 @@ rustc_queries! { desc { "running analysis passes on this crate" } } + /// This query checks the fulfillment of collected lint expectations. + /// All lint emitting queries have to be done before this is executed + /// to ensure that all expectations can be fulfilled. + /// + /// This is an extra query to enable other drivers (like rustdoc) to + /// only execute a small subset of the [`analysis`] query, while allowing + /// lints to be expected. In rustc, this query will be executed as part of + /// the [`analysis`] query and doesn't have to be called a second time. + /// + /// Tools can additionally pass in a tool filter. That will restrict the + /// expectations to only trigger for lints starting with the listed tool + /// name. This is useful for cases were not all linting code from rustc + /// was called. With the default `none` all registered lints will also + /// be checked for expectation fulfillment. + query check_expectations(key: Option<Symbol>) -> () { + eval_always + desc { "checking lint expectations (RFC 2383)" } + } + /// Maps from the `DefId` of an item (trait/struct/enum/fn) to its /// associated generics. query generics_of(key: DefId) -> ty::Generics { |
