about summary refs log tree commit diff
path: root/compiler/rustc_lint_defs/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-11 15:43:15 +0100
committerGitHub <noreply@github.com>2023-03-11 15:43:15 +0100
commitdf50001c7de485b31cc4ea3c5100ac090e470c7c (patch)
treede137e747189be70c479f028dd576d1067ab9090 /compiler/rustc_lint_defs/src
parentd7372a17872a67bf136426780561bd41783dfdde (diff)
parentc90fc105cba334c37b2773a054d4f234b501b481 (diff)
downloadrust-df50001c7de485b31cc4ea3c5100ac090e470c7c.tar.gz
rust-df50001c7de485b31cc4ea3c5100ac090e470c7c.zip
Rollup merge of #108806 - cjgillot:query-lints, r=davidtwco
Querify register_tools and post-expansion early lints

The 2 extra queries correspond to code that happen before and after macro expansion, and don't need the resolver to exist.
Diffstat (limited to 'compiler/rustc_lint_defs/src')
-rw-r--r--compiler/rustc_lint_defs/src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs
index 534aff7fb62..6f22bdabff4 100644
--- a/compiler/rustc_lint_defs/src/lib.rs
+++ b/compiler/rustc_lint_defs/src/lib.rs
@@ -8,7 +8,7 @@ extern crate rustc_macros;
 pub use self::Level::*;
 use rustc_ast::node_id::NodeId;
 use rustc_ast::{AttrId, Attribute};
-use rustc_data_structures::fx::FxIndexMap;
+use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
 use rustc_error_messages::{DiagnosticMessage, MultiSpan};
 use rustc_hir::HashStableContext;
@@ -533,6 +533,7 @@ pub enum BuiltinLintDiagnostics {
 
 /// Lints that are buffered up early on in the `Session` before the
 /// `LintLevels` is calculated.
+#[derive(Debug)]
 pub struct BufferedEarlyLint {
     /// The span of code that we are linting on.
     pub span: MultiSpan,
@@ -551,7 +552,7 @@ pub struct BufferedEarlyLint {
     pub diagnostic: BuiltinLintDiagnostics,
 }
 
-#[derive(Default)]
+#[derive(Default, Debug)]
 pub struct LintBuffer {
     pub map: FxIndexMap<NodeId, Vec<BufferedEarlyLint>>,
 }
@@ -601,6 +602,8 @@ impl LintBuffer {
     }
 }
 
+pub type RegisteredTools = FxIndexSet<Ident>;
+
 /// Declares a static item of type `&'static Lint`.
 ///
 /// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html> for