]> git.proxmox.com Git - rustc.git/blobdiff - src/libsyntax/early_buffered_lints.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / libsyntax / early_buffered_lints.rs
index 5cc953b9066282400bd11c5493f90c1bf4a0873b..2c32894a23b06a16a4c6c1673de3198be7d36306 100644 (file)
@@ -3,28 +3,28 @@
 //! Since we cannot have a dependency on `librustc`, we implement some types here that are somewhat
 //! redundant. Later, these types can be converted to types for use by the rest of the compiler.
 
-use crate::ast::NodeId;
-use syntax_pos::MultiSpan;
+use rustc_session::lint::FutureIncompatibleInfo;
+use rustc_session::declare_lint;
+pub use rustc_session::lint::BufferedEarlyLint;
 
-/// Since we cannot import `LintId`s from `rustc::lint`, we define some Ids here which can later be
-/// passed to `rustc::lint::Lint::from_parser_lint_id` to get a `rustc::lint::Lint`.
-pub enum BufferedEarlyLintId {
-    IllFormedAttributeInput,
-    MetaVariableMisuse,
-    IncompleteInclude,
+declare_lint! {
+    pub ILL_FORMED_ATTRIBUTE_INPUT,
+    Deny,
+    "ill-formed attribute inputs that were previously accepted and used in practice",
+    @future_incompatible = FutureIncompatibleInfo {
+        reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
+        edition: None,
+    };
 }
 
-/// Stores buffered lint info which can later be passed to `librustc`.
-pub struct BufferedEarlyLint {
-    /// The span of code that we are linting on.
-   pub span: MultiSpan,
-
-   /// The lint message.
-   pub msg: String,
-
-   /// The `NodeId` of the AST node that generated the lint.
-   pub id: NodeId,
+declare_lint! {
+    pub META_VARIABLE_MISUSE,
+    Allow,
+    "possible meta-variable misuse at macro definition"
+}
 
-   /// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
-   pub lint_id: BufferedEarlyLintId,
+declare_lint! {
+    pub INCOMPLETE_INCLUDE,
+    Deny,
+    "trailing content in included file"
 }