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,
17 /// Stores buffered lint info which can later be passed to `librustc`.
18 pub struct BufferedEarlyLint {
19 /// The span of code that we are linting on.
25 /// The `NodeId` of the AST node that generated the lint.
28 /// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
29 pub lint_id: BufferedEarlyLintId,