From 50c93bbfd225f202b4b0060c95bd55a6e504dd36 Mon Sep 17 00:00:00 2001 From: Raghul Nanth A <61490162+NanthR@users.noreply.github.com> Date: Fri, 2 Jun 2023 23:56:30 +0530 Subject: [PATCH] refactor(test): Move attribute to lint level --- .../allow_incorrect_lint_formulations.rs | 22 ------------------- tests/ui-internal/check_formulation.rs | 11 ++++++++++ 2 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 tests/ui-internal/allow_incorrect_lint_formulations.rs diff --git a/tests/ui-internal/allow_incorrect_lint_formulations.rs b/tests/ui-internal/allow_incorrect_lint_formulations.rs deleted file mode 100644 index 7d1e0f26a1b..00000000000 --- a/tests/ui-internal/allow_incorrect_lint_formulations.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![allow(clippy::almost_standard_lint_formulation)] -#![feature(rustc_private)] - -#[macro_use] -extern crate rustc_middle; -#[macro_use] -extern crate rustc_session; -extern crate rustc_lint; - -declare_tool_lint! { - /// # What it does - /// Detects uses of incorrect formulations - #[clippy::version = "pre 1.29.0"] - pub clippy::ALLOWED_INVALID, - Warn, - "One", - report_in_external_macro: true -} - -declare_lint_pass!(Pass => [ALLOWED_INVALID]); - -fn main() {} diff --git a/tests/ui-internal/check_formulation.rs b/tests/ui-internal/check_formulation.rs index d6ebadf04c4..43fc996033e 100644 --- a/tests/ui-internal/check_formulation.rs +++ b/tests/ui-internal/check_formulation.rs @@ -38,6 +38,17 @@ declare_tool_lint! { report_in_external_macro: true } +declare_tool_lint! { + /// # What it does + /// Detects uses of incorrect formulations (allowed with attribute) + #[allow(clippy::almost_standard_lint_formulation)] + #[clippy::version = "pre 1.29.0"] + pub clippy::ALLOWED_INVALID, + Warn, + "One", + report_in_external_macro: true +} + declare_lint_pass!(Pass => [VALID, INVALID1, INVALID2]); fn main() {}