From 6f32e3e187cfdf29ef7c785c644c95aee2897364 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 3 Mar 2021 23:00:17 +0100 Subject: [PATCH] Add new edition 2021 link: INVALID_DOC_ATTRIBUTE --- compiler/rustc_lint_defs/src/builtin.rs | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 12d849e3b9466..11d973dd1d816 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -3059,3 +3059,30 @@ declare_lint! { Allow, "No declared ABI for extern declaration" } + +declare_lint! { + /// The `invalid_doc_attributes` lint detects when the `#[doc(...)]` is + /// misused. + /// + /// ### Example + /// + /// ```rust,compile_fail + /// #![deny(warnings)] + /// #[doc(test(no_crate_inject))] + /// ``` + /// + /// {{produces}} + /// + /// ### Explanation + /// + /// Previously, there were very like checks being performed on `#[doc(..)]` + /// unlike the other attributes. It'll now catch all the issues that it + /// silently ignored previously. + pub INVALID_DOC_ATTRIBUTE, + Warn, + "detects invalid `#[doc(...)]` attributes", + @future_incompatible = FutureIncompatibleInfo { + reference: "issue #82730 ", + edition: Some(Edition::Edition2021), + }; +}