1 //! Allows the buffering of lints for later.
3 //! Since we cannot have a dependency on `librustc`, we implement some types here that are somewhat
4 //! redundant. Later, these types can be converted to types for use by the rest of the compiler.
6 use crate::syntax::ast::NodeId;
7 use syntax_pos::MultiSpan;
9 /// Since we cannot import `LintId`s from `rustc::lint`, we define some Ids here which can later be
10 /// passed to `rustc::lint::Lint::from_parser_lint_id` to get a `rustc::lint::Lint`.
11 pub enum BufferedEarlyLintId {
12 /// Usage of `?` as a macro separator is deprecated.
14 IllFormedAttributeInput,
15 /// Usage of a duplicate macro matcher binding name.
16 DuplicateMacroMatcherBindingName,
19 /// Stores buffered lint info which can later be passed to `librustc`.
20 pub struct BufferedEarlyLint {
21 /// The span of code that we are linting on.
27 /// The `NodeId` of the AST node that generated the lint.
30 /// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
31 pub lint_id: BufferedEarlyLintId,