From 8c45fd88d0ca43775b215e1b94b2175e8f4c05d2 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Thu, 11 Nov 2021 12:54:53 +0100 Subject: [PATCH] New internal lint to make `clippy::version` attribute mandatory --- clippy_lints/src/lib.register_internal.rs | 1 + clippy_lints/src/lib.register_lints.rs | 2 + clippy_lints/src/lib.rs | 4 ++ clippy_lints/src/utils/internal_lints.rs | 20 +++++++++- .../check_clippy_version_attribute.rs | 26 +++++++++++-- .../check_clippy_version_attribute.stderr | 37 ++++++++++++++++++- .../collapsible_span_lint_calls.fixed | 1 + .../collapsible_span_lint_calls.rs | 1 + .../collapsible_span_lint_calls.stderr | 10 ++--- tests/ui-internal/custom_ice_message.rs | 1 + tests/ui-internal/default_lint.rs | 1 + tests/ui-internal/default_lint.stderr | 2 +- tests/ui-internal/if_chain_style.rs | 2 +- .../interning_defined_symbol.fixed | 1 + tests/ui-internal/interning_defined_symbol.rs | 1 + .../interning_defined_symbol.stderr | 8 ++-- tests/ui-internal/invalid_paths.rs | 1 + tests/ui-internal/invalid_paths.stderr | 4 +- tests/ui-internal/lint_without_lint_pass.rs | 1 + .../ui-internal/lint_without_lint_pass.stderr | 2 +- tests/ui-internal/match_type_on_diag_item.rs | 1 + .../match_type_on_diag_item.stderr | 6 +-- tests/ui-internal/outer_expn_data.fixed | 1 + tests/ui-internal/outer_expn_data.rs | 1 + tests/ui-internal/outer_expn_data.stderr | 2 +- .../ui-internal/unnecessary_symbol_str.fixed | 6 ++- tests/ui-internal/unnecessary_symbol_str.rs | 6 ++- .../ui-internal/unnecessary_symbol_str.stderr | 10 ++--- util/gh-pages/index.html | 3 +- 29 files changed, 130 insertions(+), 32 deletions(-) diff --git a/clippy_lints/src/lib.register_internal.rs b/clippy_lints/src/lib.register_internal.rs index d8f5db65c09..7d4c7d2adb5 100644 --- a/clippy_lints/src/lib.register_internal.rs +++ b/clippy_lints/src/lib.register_internal.rs @@ -13,6 +13,7 @@ store.register_group(true, "clippy::internal", Some("clippy_internal"), vec![ LintId::of(utils::internal_lints::INVALID_PATHS), LintId::of(utils::internal_lints::LINT_WITHOUT_LINT_PASS), LintId::of(utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM), + LintId::of(utils::internal_lints::MISSING_CLIPPY_VERSION_ATTRIBUTE), LintId::of(utils::internal_lints::OUTER_EXPN_EXPN_DATA), LintId::of(utils::internal_lints::PRODUCE_ICE), LintId::of(utils::internal_lints::UNNECESSARY_SYMBOL_STR), diff --git a/clippy_lints/src/lib.register_lints.rs b/clippy_lints/src/lib.register_lints.rs index 588debd26c6..b32c9b060ae 100644 --- a/clippy_lints/src/lib.register_lints.rs +++ b/clippy_lints/src/lib.register_lints.rs @@ -24,6 +24,8 @@ store.register_lints(&[ #[cfg(feature = "internal-lints")] utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM, #[cfg(feature = "internal-lints")] + utils::internal_lints::MISSING_CLIPPY_VERSION_ATTRIBUTE, + #[cfg(feature = "internal-lints")] utils::internal_lints::OUTER_EXPN_EXPN_DATA, #[cfg(feature = "internal-lints")] utils::internal_lints::PRODUCE_ICE, diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index d91b2e1f448..5c436e1b9eb 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -153,6 +153,10 @@ macro_rules! declare_clippy_lint { #[cfg(feature = "metadata-collector-lint")] mod deprecated_lints; +#[cfg_attr( + any(feature = "internal-lints", feature = "metadata-collector-lint"), + allow(clippy::missing_clippy_version_attribute) +)] mod utils; // begin lints modules, do not remove this comment, it’s used in `update_lints` diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index c20bd4ca38f..1f97c8ba7e6 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -328,6 +328,15 @@ declare_clippy_lint! { "found an invalid `clippy::version` attribute" } +declare_clippy_lint! { + /// ### What it does + /// Checks for declared clippy lints without the `clippy::version` attribute. + /// + pub MISSING_CLIPPY_VERSION_ATTRIBUTE, + internal, + "found clippy lint without `clippy::version` attribute" +} + declare_lint_pass!(ClippyLintsInternal => [CLIPPY_LINTS_INTERNAL]); impl EarlyLintPass for ClippyLintsInternal { @@ -365,7 +374,7 @@ pub struct LintWithoutLintPass { registered_lints: FxHashSet, } -impl_lint_pass!(LintWithoutLintPass => [DEFAULT_LINT, LINT_WITHOUT_LINT_PASS, INVALID_CLIPPY_VERSION_ATTRIBUTE]); +impl_lint_pass!(LintWithoutLintPass => [DEFAULT_LINT, LINT_WITHOUT_LINT_PASS, INVALID_CLIPPY_VERSION_ATTRIBUTE, MISSING_CLIPPY_VERSION_ATTRIBUTE]); impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass { fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { @@ -492,6 +501,15 @@ fn check_invalid_clippy_version_attribute(cx: &LateContext<'_>, item: &'_ Item<' "please use a valid sematic version, see `doc/adding_lints.md`", ); } + } else { + span_lint_and_help( + cx, + MISSING_CLIPPY_VERSION_ATTRIBUTE, + item.span, + "this lint is missing the `clippy::version` attribute or version value", + None, + "please use a `clippy::version` attribute, see `doc/adding_lints.md`", + ); } } diff --git a/tests/ui-internal/check_clippy_version_attribute.rs b/tests/ui-internal/check_clippy_version_attribute.rs index e1b37d42174..31acac89cc6 100644 --- a/tests/ui-internal/check_clippy_version_attribute.rs +++ b/tests/ui-internal/check_clippy_version_attribute.rs @@ -54,16 +54,34 @@ declare_tool_lint! { } /////////////////////// -// Ignored attributes +// Missing attribute test /////////////////////// declare_tool_lint! { #[clippy::version] - pub clippy::IGNORED_ONE, + pub clippy::MISSING_ATTRIBUTE_ONE, Warn, - "ONE", + "Two", report_in_external_macro: true } -declare_lint_pass!(Pass2 => [VALID_ONE, VALID_TWO, VALID_THREE, INVALID_ONE, INVALID_TWO, IGNORED_ONE]); +declare_tool_lint! { + pub clippy::MISSING_ATTRIBUTE_TWO, + Warn, + "Two", + report_in_external_macro: true +} + +#[allow(clippy::missing_clippy_version_attribute)] +mod internal_clippy_lints { + declare_tool_lint! { + pub clippy::ALLOW_MISSING_ATTRIBUTE_ONE, + Warn, + "Two", + report_in_external_macro: true + } +} + +use crate::internal_clippy_lints::ALLOW_MISSING_ATTRIBUTE_ONE; +declare_lint_pass!(Pass2 => [VALID_ONE, VALID_TWO, VALID_THREE, INVALID_ONE, INVALID_TWO, MISSING_ATTRIBUTE_ONE, MISSING_ATTRIBUTE_TWO, ALLOW_MISSING_ATTRIBUTE_ONE]); fn main() {} diff --git a/tests/ui-internal/check_clippy_version_attribute.stderr b/tests/ui-internal/check_clippy_version_attribute.stderr index fa697ab7425..9302e02ccb9 100644 --- a/tests/ui-internal/check_clippy_version_attribute.stderr +++ b/tests/ui-internal/check_clippy_version_attribute.stderr @@ -34,5 +34,40 @@ LL | | } = help: please use a valid sematic version, see `doc/adding_lints.md` = note: this error originates in the macro `$crate::declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 2 previous errors +error: this lint is missing the `clippy::version` attribute or version value + --> $DIR/check_clippy_version_attribute.rs:59:1 + | +LL | / declare_tool_lint! { +LL | | #[clippy::version] +LL | | pub clippy::MISSING_ATTRIBUTE_ONE, +LL | | Warn, +LL | | "Two", +LL | | report_in_external_macro: true +LL | | } + | |_^ + | +note: the lint level is defined here + --> $DIR/check_clippy_version_attribute.rs:1:9 + | +LL | #![deny(clippy::internal)] + | ^^^^^^^^^^^^^^^^ + = note: `#[deny(clippy::missing_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]` + = help: please use a `clippy::version` attribute, see `doc/adding_lints.md` + = note: this error originates in the macro `$crate::declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: this lint is missing the `clippy::version` attribute or version value + --> $DIR/check_clippy_version_attribute.rs:67:1 + | +LL | / declare_tool_lint! { +LL | | pub clippy::MISSING_ATTRIBUTE_TWO, +LL | | Warn, +LL | | "Two", +LL | | report_in_external_macro: true +LL | | } + | |_^ + | + = help: please use a `clippy::version` attribute, see `doc/adding_lints.md` + = note: this error originates in the macro `$crate::declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 4 previous errors diff --git a/tests/ui-internal/collapsible_span_lint_calls.fixed b/tests/ui-internal/collapsible_span_lint_calls.fixed index 7764cc8da78..a5a6f20ddd5 100644 --- a/tests/ui-internal/collapsible_span_lint_calls.fixed +++ b/tests/ui-internal/collapsible_span_lint_calls.fixed @@ -1,5 +1,6 @@ // run-rustfix #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate clippy_utils; diff --git a/tests/ui-internal/collapsible_span_lint_calls.rs b/tests/ui-internal/collapsible_span_lint_calls.rs index bdd296db832..6d783aa0786 100644 --- a/tests/ui-internal/collapsible_span_lint_calls.rs +++ b/tests/ui-internal/collapsible_span_lint_calls.rs @@ -1,5 +1,6 @@ // run-rustfix #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate clippy_utils; diff --git a/tests/ui-internal/collapsible_span_lint_calls.stderr b/tests/ui-internal/collapsible_span_lint_calls.stderr index 0632b038577..558d1299160 100644 --- a/tests/ui-internal/collapsible_span_lint_calls.stderr +++ b/tests/ui-internal/collapsible_span_lint_calls.stderr @@ -1,5 +1,5 @@ error: this call is collapsible - --> $DIR/collapsible_span_lint_calls.rs:35:9 + --> $DIR/collapsible_span_lint_calls.rs:36:9 | LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| { LL | | db.span_suggestion(expr.span, help_msg, sugg.to_string(), Applicability::MachineApplicable); @@ -14,7 +14,7 @@ LL | #![deny(clippy::internal)] = note: `#[deny(clippy::collapsible_span_lint_calls)]` implied by `#[deny(clippy::internal)]` error: this call is collapsible - --> $DIR/collapsible_span_lint_calls.rs:38:9 + --> $DIR/collapsible_span_lint_calls.rs:39:9 | LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| { LL | | db.span_help(expr.span, help_msg); @@ -22,7 +22,7 @@ LL | | }); | |__________^ help: collapse into: `span_lint_and_help(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), help_msg)` error: this call is collapsible - --> $DIR/collapsible_span_lint_calls.rs:41:9 + --> $DIR/collapsible_span_lint_calls.rs:42:9 | LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| { LL | | db.help(help_msg); @@ -30,7 +30,7 @@ LL | | }); | |__________^ help: collapse into: `span_lint_and_help(cx, TEST_LINT, expr.span, lint_msg, None, help_msg)` error: this call is collspible - --> $DIR/collapsible_span_lint_calls.rs:44:9 + --> $DIR/collapsible_span_lint_calls.rs:45:9 | LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| { LL | | db.span_note(expr.span, note_msg); @@ -38,7 +38,7 @@ LL | | }); | |__________^ help: collapse into: `span_lint_and_note(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), note_msg)` error: this call is collspible - --> $DIR/collapsible_span_lint_calls.rs:47:9 + --> $DIR/collapsible_span_lint_calls.rs:48:9 | LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| { LL | | db.note(note_msg); diff --git a/tests/ui-internal/custom_ice_message.rs b/tests/ui-internal/custom_ice_message.rs index 5b30c9d5721..5057a018300 100644 --- a/tests/ui-internal/custom_ice_message.rs +++ b/tests/ui-internal/custom_ice_message.rs @@ -4,6 +4,7 @@ // normalize-stderr-test: "', .*clippy_lints" -> "', clippy_lints" #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] fn it_looks_like_you_are_trying_to_kill_clippy() {} diff --git a/tests/ui-internal/default_lint.rs b/tests/ui-internal/default_lint.rs index 053faae02ce..da29aedb2a3 100644 --- a/tests/ui-internal/default_lint.rs +++ b/tests/ui-internal/default_lint.rs @@ -1,4 +1,5 @@ #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] #[macro_use] diff --git a/tests/ui-internal/default_lint.stderr b/tests/ui-internal/default_lint.stderr index 4735573a47d..af6735f4e4d 100644 --- a/tests/ui-internal/default_lint.stderr +++ b/tests/ui-internal/default_lint.stderr @@ -1,5 +1,5 @@ error: the lint `TEST_LINT_DEFAULT` has the default lint description - --> $DIR/default_lint.rs:17:1 + --> $DIR/default_lint.rs:18:1 | LL | / declare_tool_lint! { LL | | pub clippy::TEST_LINT_DEFAULT, diff --git a/tests/ui-internal/if_chain_style.rs b/tests/ui-internal/if_chain_style.rs index e064fd188c8..b0d89e038aa 100644 --- a/tests/ui-internal/if_chain_style.rs +++ b/tests/ui-internal/if_chain_style.rs @@ -1,5 +1,5 @@ #![warn(clippy::if_chain_style)] -#![allow(clippy::no_effect, clippy::nonminimal_bool)] +#![allow(clippy::no_effect, clippy::nonminimal_bool, clippy::missing_clippy_version_attribute)] extern crate if_chain; diff --git a/tests/ui-internal/interning_defined_symbol.fixed b/tests/ui-internal/interning_defined_symbol.fixed index 9ab845a573a..6b7fd6efe39 100644 --- a/tests/ui-internal/interning_defined_symbol.fixed +++ b/tests/ui-internal/interning_defined_symbol.fixed @@ -1,5 +1,6 @@ // run-rustfix #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate rustc_span; diff --git a/tests/ui-internal/interning_defined_symbol.rs b/tests/ui-internal/interning_defined_symbol.rs index a58e182971d..98d7d7adad1 100644 --- a/tests/ui-internal/interning_defined_symbol.rs +++ b/tests/ui-internal/interning_defined_symbol.rs @@ -1,5 +1,6 @@ // run-rustfix #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate rustc_span; diff --git a/tests/ui-internal/interning_defined_symbol.stderr b/tests/ui-internal/interning_defined_symbol.stderr index 50c1c268eb1..4e99636e683 100644 --- a/tests/ui-internal/interning_defined_symbol.stderr +++ b/tests/ui-internal/interning_defined_symbol.stderr @@ -1,5 +1,5 @@ error: interning a defined symbol - --> $DIR/interning_defined_symbol.rs:17:13 + --> $DIR/interning_defined_symbol.rs:18:13 | LL | let _ = Symbol::intern("f32"); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::f32` @@ -12,19 +12,19 @@ LL | #![deny(clippy::internal)] = note: `#[deny(clippy::interning_defined_symbol)]` implied by `#[deny(clippy::internal)]` error: interning a defined symbol - --> $DIR/interning_defined_symbol.rs:20:13 + --> $DIR/interning_defined_symbol.rs:21:13 | LL | let _ = sym!(f32); | ^^^^^^^^^ help: try: `rustc_span::sym::f32` error: interning a defined symbol - --> $DIR/interning_defined_symbol.rs:23:13 + --> $DIR/interning_defined_symbol.rs:24:13 | LL | let _ = Symbol::intern("proc-macro"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::proc_dash_macro` error: interning a defined symbol - --> $DIR/interning_defined_symbol.rs:26:13 + --> $DIR/interning_defined_symbol.rs:27:13 | LL | let _ = Symbol::intern("self"); | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::symbol::kw::SelfLower` diff --git a/tests/ui-internal/invalid_paths.rs b/tests/ui-internal/invalid_paths.rs index a3b19c2e394..b823ff7fe37 100644 --- a/tests/ui-internal/invalid_paths.rs +++ b/tests/ui-internal/invalid_paths.rs @@ -1,4 +1,5 @@ #![warn(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] mod paths { // Good path diff --git a/tests/ui-internal/invalid_paths.stderr b/tests/ui-internal/invalid_paths.stderr index 20aa81b98a0..0a8e5427978 100644 --- a/tests/ui-internal/invalid_paths.stderr +++ b/tests/ui-internal/invalid_paths.stderr @@ -1,5 +1,5 @@ error: invalid path - --> $DIR/invalid_paths.rs:17:5 + --> $DIR/invalid_paths.rs:18:5 | LL | pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"]; = note: `-D clippy::invalid-paths` implied by `-D warnings` error: invalid path - --> $DIR/invalid_paths.rs:20:5 + --> $DIR/invalid_paths.rs:21:5 | LL | pub const BAD_MOD_PATH: [&str; 2] = ["std", "xxx"]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui-internal/lint_without_lint_pass.rs b/tests/ui-internal/lint_without_lint_pass.rs index beaef79a340..1fd03cfe36d 100644 --- a/tests/ui-internal/lint_without_lint_pass.rs +++ b/tests/ui-internal/lint_without_lint_pass.rs @@ -1,4 +1,5 @@ #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] #[macro_use] diff --git a/tests/ui-internal/lint_without_lint_pass.stderr b/tests/ui-internal/lint_without_lint_pass.stderr index e308e13da13..de04920b8e6 100644 --- a/tests/ui-internal/lint_without_lint_pass.stderr +++ b/tests/ui-internal/lint_without_lint_pass.stderr @@ -1,5 +1,5 @@ error: the lint `TEST_LINT` is not added to any `LintPass` - --> $DIR/lint_without_lint_pass.rs:11:1 + --> $DIR/lint_without_lint_pass.rs:12:1 | LL | / declare_tool_lint! { LL | | pub clippy::TEST_LINT, diff --git a/tests/ui-internal/match_type_on_diag_item.rs b/tests/ui-internal/match_type_on_diag_item.rs index be7b7a9af19..4b41ff15e80 100644 --- a/tests/ui-internal/match_type_on_diag_item.rs +++ b/tests/ui-internal/match_type_on_diag_item.rs @@ -1,4 +1,5 @@ #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate clippy_utils; diff --git a/tests/ui-internal/match_type_on_diag_item.stderr b/tests/ui-internal/match_type_on_diag_item.stderr index bf1d67e6054..e3cb6b6c22e 100644 --- a/tests/ui-internal/match_type_on_diag_item.stderr +++ b/tests/ui-internal/match_type_on_diag_item.stderr @@ -1,5 +1,5 @@ error: usage of `clippy_utils::ty::match_type()` on a type diagnostic item - --> $DIR/match_type_on_diag_item.rs:30:17 + --> $DIR/match_type_on_diag_item.rs:31:17 | LL | let _ = match_type(cx, ty, &OPTION); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `clippy_utils::ty::is_type_diagnostic_item(cx, ty, sym::Option)` @@ -12,13 +12,13 @@ LL | #![deny(clippy::internal)] = note: `#[deny(clippy::match_type_on_diagnostic_item)]` implied by `#[deny(clippy::internal)]` error: usage of `clippy_utils::ty::match_type()` on a type diagnostic item - --> $DIR/match_type_on_diag_item.rs:31:17 + --> $DIR/match_type_on_diag_item.rs:32:17 | LL | let _ = match_type(cx, ty, &["core", "result", "Result"]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `clippy_utils::ty::is_type_diagnostic_item(cx, ty, sym::Result)` error: usage of `clippy_utils::ty::match_type()` on a type diagnostic item - --> $DIR/match_type_on_diag_item.rs:34:17 + --> $DIR/match_type_on_diag_item.rs:35:17 | LL | let _ = clippy_utils::ty::match_type(cx, ty, rc_path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `clippy_utils::ty::is_type_diagnostic_item(cx, ty, sym::Rc)` diff --git a/tests/ui-internal/outer_expn_data.fixed b/tests/ui-internal/outer_expn_data.fixed index b0b3498f057..bb82faf0c90 100644 --- a/tests/ui-internal/outer_expn_data.fixed +++ b/tests/ui-internal/outer_expn_data.fixed @@ -1,6 +1,7 @@ // run-rustfix #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate rustc_hir; diff --git a/tests/ui-internal/outer_expn_data.rs b/tests/ui-internal/outer_expn_data.rs index 55a3fed00d0..187d468b392 100644 --- a/tests/ui-internal/outer_expn_data.rs +++ b/tests/ui-internal/outer_expn_data.rs @@ -1,6 +1,7 @@ // run-rustfix #![deny(clippy::internal)] +#![allow(clippy::missing_clippy_version_attribute)] #![feature(rustc_private)] extern crate rustc_hir; diff --git a/tests/ui-internal/outer_expn_data.stderr b/tests/ui-internal/outer_expn_data.stderr index 56b6ce1f78e..afef696785e 100644 --- a/tests/ui-internal/outer_expn_data.stderr +++ b/tests/ui-internal/outer_expn_data.stderr @@ -1,5 +1,5 @@ error: usage of `outer_expn().expn_data()` - --> $DIR/outer_expn_data.rs:24:34 + --> $DIR/outer_expn_data.rs:25:34 | LL | let _ = expr.span.ctxt().outer_expn().expn_data(); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `outer_expn_data()` diff --git a/tests/ui-internal/unnecessary_symbol_str.fixed b/tests/ui-internal/unnecessary_symbol_str.fixed index 95b8c6dfe89..4f5336663a8 100644 --- a/tests/ui-internal/unnecessary_symbol_str.fixed +++ b/tests/ui-internal/unnecessary_symbol_str.fixed @@ -1,7 +1,11 @@ // run-rustfix #![feature(rustc_private)] #![deny(clippy::internal)] -#![allow(clippy::unnecessary_operation, unused_must_use)] +#![allow( + clippy::unnecessary_operation, + unused_must_use, + clippy::missing_clippy_version_attribute +)] extern crate rustc_span; diff --git a/tests/ui-internal/unnecessary_symbol_str.rs b/tests/ui-internal/unnecessary_symbol_str.rs index ad6937cf60a..894aa1d3bc6 100644 --- a/tests/ui-internal/unnecessary_symbol_str.rs +++ b/tests/ui-internal/unnecessary_symbol_str.rs @@ -1,7 +1,11 @@ // run-rustfix #![feature(rustc_private)] #![deny(clippy::internal)] -#![allow(clippy::unnecessary_operation, unused_must_use)] +#![allow( + clippy::unnecessary_operation, + unused_must_use, + clippy::missing_clippy_version_attribute +)] extern crate rustc_span; diff --git a/tests/ui-internal/unnecessary_symbol_str.stderr b/tests/ui-internal/unnecessary_symbol_str.stderr index 12e05eaa7a0..75367bf4bc5 100644 --- a/tests/ui-internal/unnecessary_symbol_str.stderr +++ b/tests/ui-internal/unnecessary_symbol_str.stderr @@ -1,5 +1,5 @@ error: unnecessary `Symbol` to string conversion - --> $DIR/unnecessary_symbol_str.rs:11:5 + --> $DIR/unnecessary_symbol_str.rs:15:5 | LL | Symbol::intern("foo").as_str() == "clippy"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") == rustc_span::sym::clippy` @@ -12,25 +12,25 @@ LL | #![deny(clippy::internal)] = note: `#[deny(clippy::unnecessary_symbol_str)]` implied by `#[deny(clippy::internal)]` error: unnecessary `Symbol` to string conversion - --> $DIR/unnecessary_symbol_str.rs:12:5 + --> $DIR/unnecessary_symbol_str.rs:16:5 | LL | Symbol::intern("foo").to_string() == "self"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") == rustc_span::symbol::kw::SelfLower` error: unnecessary `Symbol` to string conversion - --> $DIR/unnecessary_symbol_str.rs:13:5 + --> $DIR/unnecessary_symbol_str.rs:17:5 | LL | Symbol::intern("foo").to_ident_string() != "Self"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") != rustc_span::symbol::kw::SelfUpper` error: unnecessary `Symbol` to string conversion - --> $DIR/unnecessary_symbol_str.rs:14:5 + --> $DIR/unnecessary_symbol_str.rs:18:5 | LL | &*Ident::empty().as_str() == "clippy"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::empty().name == rustc_span::sym::clippy` error: unnecessary `Symbol` to string conversion - --> $DIR/unnecessary_symbol_str.rs:15:5 + --> $DIR/unnecessary_symbol_str.rs:19:5 | LL | "clippy" == Ident::empty().to_string(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::empty().name` diff --git a/util/gh-pages/index.html b/util/gh-pages/index.html index c1df8ed9fc8..58e8b4f4829 100644 --- a/util/gh-pages/index.html +++ b/util/gh-pages/index.html @@ -347,7 +347,8 @@ Otherwise, have a great day =^.^=
- Added in: {{lint.version}} + {{lint.group == "deprecated" ? "Deprecated" : "Added"}} in: + {{lint.version}}