1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Allows the buffering of lints for later.
13 //! Since we cannot have a dependency on `librustc`, we implement some types here that are somewhat
14 //! redundant. Later, these types can be converted to types for use by the rest of the compiler.
16 use syntax::ast::NodeId;
17 use syntax_pos::MultiSpan;
19 /// Since we cannot import `LintId`s from `rustc::lint`, we define some Ids here which can later be
20 /// passed to `rustc::lint::Lint::from_parser_lint_id` to get a `rustc::lint::Lint`.
21 pub enum BufferedEarlyLintId {
22 /// Usage of `?` as a macro separator is deprecated.
26 /// Stores buffered lint info which can later be passed to `librustc`.
27 pub struct BufferedEarlyLint {
28 /// The span of code that we are linting on.
34 /// The `NodeId` of the AST node that generated the lint.
37 /// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
38 pub lint_id: BufferedEarlyLintId,