about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/clippy_mq.yml2
-rw-r--r--.github/workflows/clippy_pr.yml2
-rw-r--r--Cargo.toml5
-rw-r--r--book/src/development/defining_lints.md3
-rw-r--r--clippy_dev/src/main.rs1
-rw-r--r--clippy_dev/src/update_lints.rs90
-rw-r--r--clippy_lints/Cargo.toml7
-rw-r--r--clippy_lints/src/declare_clippy_lint.rs13
-rw-r--r--clippy_lints/src/declared_lints.rs30
-rw-r--r--clippy_lints/src/lib.rs57
-rw-r--r--clippy_lints/src/regex.rs4
-rw-r--r--clippy_lints/src/utils/internal_lints.rs11
-rw-r--r--clippy_lints/src/utils/mod.rs3
-rw-r--r--clippy_lints_internal/Cargo.toml14
-rw-r--r--clippy_lints_internal/src/almost_standard_lint_formulation.rs (renamed from clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs)12
-rw-r--r--clippy_lints_internal/src/collapsible_calls.rs (renamed from clippy_lints/src/utils/internal_lints/collapsible_calls.rs)10
-rw-r--r--clippy_lints_internal/src/interning_defined_symbol.rs (renamed from clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs)19
-rw-r--r--clippy_lints_internal/src/invalid_paths.rs (renamed from clippy_lints/src/utils/internal_lints/invalid_paths.rs)10
-rw-r--r--clippy_lints_internal/src/lib.rs78
-rw-r--r--clippy_lints_internal/src/lint_without_lint_pass.rs (renamed from clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs)43
-rw-r--r--clippy_lints_internal/src/msrv_attr_impl.rs (renamed from clippy_lints/src/utils/internal_lints/msrv_attr_impl.rs)11
-rw-r--r--clippy_lints_internal/src/outer_expn_data_pass.rs (renamed from clippy_lints/src/utils/internal_lints/outer_expn_data_pass.rs)10
-rw-r--r--clippy_lints_internal/src/produce_ice.rs (renamed from clippy_lints/src/utils/internal_lints/produce_ice.rs)10
-rw-r--r--clippy_lints_internal/src/slow_symbol_comparisons.rs (renamed from clippy_lints/src/utils/internal_lints/slow_symbol_comparisons.rs)10
-rw-r--r--clippy_lints_internal/src/unnecessary_def_path.rs (renamed from clippy_lints/src/utils/internal_lints/unnecessary_def_path.rs)10
-rw-r--r--clippy_lints_internal/src/unsorted_clippy_utils_paths.rs (renamed from clippy_lints/src/utils/internal_lints/unsorted_clippy_utils_paths.rs)10
-rw-r--r--src/driver.rs3
-rw-r--r--tests/dogfood.rs6
-rw-r--r--tests/ui-internal/auxiliary/paths.rs2
-rw-r--r--tests/ui-internal/check_clippy_version_attribute.rs13
-rw-r--r--tests/ui-internal/check_clippy_version_attribute.stderr13
-rw-r--r--tests/ui-internal/check_formulation.rs3
-rw-r--r--tests/ui-internal/check_formulation.stderr11
-rw-r--r--tests/ui-internal/collapsible_span_lint_calls.fixed2
-rw-r--r--tests/ui-internal/collapsible_span_lint_calls.rs2
-rw-r--r--tests/ui-internal/collapsible_span_lint_calls.stderr5
-rw-r--r--tests/ui-internal/custom_ice_message.rs2
-rw-r--r--tests/ui-internal/custom_ice_message.stderr2
-rw-r--r--tests/ui-internal/default_lint.rs2
-rw-r--r--tests/ui-internal/default_lint.stderr5
-rw-r--r--tests/ui-internal/disallow_span_lint.rs1
-rw-r--r--tests/ui-internal/disallow_span_lint.stderr11
-rw-r--r--tests/ui-internal/interning_defined_symbol.fixed2
-rw-r--r--tests/ui-internal/interning_defined_symbol.rs2
-rw-r--r--tests/ui-internal/interning_defined_symbol.stderr5
-rw-r--r--tests/ui-internal/invalid_msrv_attr_impl.fixed2
-rw-r--r--tests/ui-internal/invalid_msrv_attr_impl.rs2
-rw-r--r--tests/ui-internal/invalid_msrv_attr_impl.stderr5
-rw-r--r--tests/ui-internal/invalid_paths.rs2
-rw-r--r--tests/ui-internal/invalid_paths.stderr7
-rw-r--r--tests/ui-internal/lint_without_lint_pass.rs2
-rw-r--r--tests/ui-internal/lint_without_lint_pass.stderr5
-rw-r--r--tests/ui-internal/outer_expn_data.fixed2
-rw-r--r--tests/ui-internal/outer_expn_data.rs2
-rw-r--r--tests/ui-internal/outer_expn_data.stderr5
-rw-r--r--tests/ui-internal/unnecessary_def_path.fixed2
-rw-r--r--tests/ui-internal/unnecessary_def_path.rs2
-rw-r--r--tests/ui-internal/unnecessary_def_path.stderr5
-rw-r--r--tests/ui-internal/unnecessary_def_path_hardcoded_path.rs2
-rw-r--r--tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr7
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.fixed2
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.rs2
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.stderr5
63 files changed, 295 insertions, 333 deletions
diff --git a/.github/workflows/clippy_mq.yml b/.github/workflows/clippy_mq.yml
index 741e7457331..07d5a08304e 100644
--- a/.github/workflows/clippy_mq.yml
+++ b/.github/workflows/clippy_mq.yml
@@ -66,7 +66,7 @@ jobs:
       run: cargo test --features internal -- --skip dogfood
 
     - name: Test clippy_lints
-      run: cargo test --features internal
+      run: cargo test
       working-directory: clippy_lints
 
     - name: Test clippy_utils
diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml
index 80523d91f4f..880ebd6e5d5 100644
--- a/.github/workflows/clippy_pr.yml
+++ b/.github/workflows/clippy_pr.yml
@@ -42,7 +42,7 @@ jobs:
       run: cargo test --features internal
 
     - name: Test clippy_lints
-      run: cargo test --features internal
+      run: cargo test
       working-directory: clippy_lints
 
     - name: Test clippy_utils
diff --git a/Cargo.toml b/Cargo.toml
index 5a6904d63be..dfcfe69bedf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,6 +26,7 @@ path = "src/driver.rs"
 clippy_config = { path = "clippy_config" }
 clippy_lints = { path = "clippy_lints" }
 rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
+clippy_lints_internal = { path = "clippy_lints_internal", optional = true }
 tempfile = { version = "3.3", optional = true }
 termize = "0.1"
 color-print = "0.3.4"
@@ -57,8 +58,8 @@ tokio = { version = "1", features = ["io-util"] }
 rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
 
 [features]
-integration = ["tempfile"]
-internal = ["clippy_lints/internal", "tempfile"]
+integration = ["dep:tempfile"]
+internal = ["dep:clippy_lints_internal", "dep:tempfile"]
 
 [package.metadata.rust-analyzer]
 # This package uses #[feature(rustc_private)]
diff --git a/book/src/development/defining_lints.md b/book/src/development/defining_lints.md
index 169cecd7d11..cb6d7b740db 100644
--- a/book/src/development/defining_lints.md
+++ b/book/src/development/defining_lints.md
@@ -9,7 +9,7 @@ lint involves some boilerplate code.
 
 A lint type is the category of items and expressions in which your lint focuses on.
 
-As of the writing of this documentation update, there are 12 _types_ of lints
+As of the writing of this documentation update, there are 11 _types_ of lints
 besides the numerous standalone lints living under `clippy_lints/src/`:
 
 - `cargo`
@@ -23,7 +23,6 @@ besides the numerous standalone lints living under `clippy_lints/src/`:
 - `transmute`
 - `types`
 - `unit_types`
-- `utils / internal` (Clippy internal lints)
 
 These types group together lints that share some common behaviors. For instance,
 `functions` groups together lints that deal with some aspects of functions in
diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs
index 0380b7e6a6d..83f8e66b334 100644
--- a/clippy_dev/src/main.rs
+++ b/clippy_dev/src/main.rs
@@ -170,7 +170,6 @@ enum DevCommand {
                 "restriction",
                 "cargo",
                 "nursery",
-                "internal",
             ],
             default_value = "nursery",
         )]
diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs
index 0be24f322d2..90683a23544 100644
--- a/clippy_dev/src/update_lints.rs
+++ b/clippy_dev/src/update_lints.rs
@@ -37,9 +37,8 @@ fn generate_lint_files(
     deprecated_lints: &[DeprecatedLint],
     renamed_lints: &[RenamedLint],
 ) {
-    let internal_lints = Lint::internal_lints(lints);
-    let mut usable_lints = Lint::usable_lints(lints);
-    usable_lints.sort_by_key(|lint| lint.name.clone());
+    let mut lints = lints.to_owned();
+    lints.sort_by_key(|lint| lint.name.clone());
 
     replace_region_in_file(
         update_mode,
@@ -47,7 +46,7 @@ fn generate_lint_files(
         "[There are over ",
         " lints included in this crate!]",
         |res| {
-            write!(res, "{}", round_to_fifty(usable_lints.len())).unwrap();
+            write!(res, "{}", round_to_fifty(lints.len())).unwrap();
         },
     );
 
@@ -57,7 +56,7 @@ fn generate_lint_files(
         "[There are over ",
         " lints included in this crate!]",
         |res| {
-            write!(res, "{}", round_to_fifty(usable_lints.len())).unwrap();
+            write!(res, "{}", round_to_fifty(lints.len())).unwrap();
         },
     );
 
@@ -67,7 +66,7 @@ fn generate_lint_files(
         "<!-- begin autogenerated links to lint list -->\n",
         "<!-- end autogenerated links to lint list -->",
         |res| {
-            for lint in usable_lints
+            for lint in lints
                 .iter()
                 .map(|l| &*l.name)
                 .chain(deprecated_lints.iter().filter_map(|l| l.name.strip_prefix("clippy::")))
@@ -86,7 +85,7 @@ fn generate_lint_files(
         "// begin lints modules, do not remove this comment, it’s used in `update_lints`\n",
         "// end lints modules, do not remove this comment, it’s used in `update_lints`",
         |res| {
-            for lint_mod in usable_lints.iter().map(|l| &l.module).unique().sorted() {
+            for lint_mod in lints.iter().map(|l| &l.module).unique().sorted() {
                 writeln!(res, "mod {lint_mod};").unwrap();
             }
         },
@@ -95,7 +94,7 @@ fn generate_lint_files(
     process_file(
         "clippy_lints/src/declared_lints.rs",
         update_mode,
-        &gen_declared_lints(internal_lints.iter(), usable_lints.iter()),
+        &gen_declared_lints(lints.iter()),
     );
 
     let content = gen_deprecated_lints_test(deprecated_lints);
@@ -106,10 +105,9 @@ fn generate_lint_files(
 }
 
 pub fn print_lints() {
-    let (lint_list, _, _) = gather_all();
-    let usable_lints = Lint::usable_lints(&lint_list);
-    let usable_lint_count = usable_lints.len();
-    let grouped_by_lint_group = Lint::by_lint_group(usable_lints.into_iter());
+    let (lints, _, _) = gather_all();
+    let lint_count = lints.len();
+    let grouped_by_lint_group = Lint::by_lint_group(lints.into_iter());
 
     for (lint_group, mut lints) in grouped_by_lint_group {
         println!("\n## {lint_group}");
@@ -121,7 +119,7 @@ pub fn print_lints() {
         }
     }
 
-    println!("there are {usable_lint_count} lints");
+    println!("there are {lint_count} lints");
 }
 
 /// Runs the `rename_lint` command.
@@ -527,22 +525,6 @@ impl Lint {
         }
     }
 
-    /// Returns all non-deprecated lints and non-internal lints
-    #[must_use]
-    fn usable_lints(lints: &[Self]) -> Vec<Self> {
-        lints
-            .iter()
-            .filter(|l| !l.group.starts_with("internal"))
-            .cloned()
-            .collect()
-    }
-
-    /// Returns all internal lints
-    #[must_use]
-    fn internal_lints(lints: &[Self]) -> Vec<Self> {
-        lints.iter().filter(|l| l.group == "internal").cloned().collect()
-    }
-
     /// Returns the lints in a `HashMap`, grouped by the different lint groups
     #[must_use]
     fn by_lint_group(lints: impl Iterator<Item = Self>) -> HashMap<String, Vec<Self>> {
@@ -579,23 +561,14 @@ impl RenamedLint {
 
 /// Generates the code for registering lints
 #[must_use]
-fn gen_declared_lints<'a>(
-    internal_lints: impl Iterator<Item = &'a Lint>,
-    usable_lints: impl Iterator<Item = &'a Lint>,
-) -> String {
-    let mut details: Vec<_> = internal_lints
-        .map(|l| (false, &l.module, l.name.to_uppercase()))
-        .chain(usable_lints.map(|l| (true, &l.module, l.name.to_uppercase())))
-        .collect();
+fn gen_declared_lints<'a>(lints: impl Iterator<Item = &'a Lint>) -> String {
+    let mut details: Vec<_> = lints.map(|l| (&l.module, l.name.to_uppercase())).collect();
     details.sort_unstable();
 
     let mut output = GENERATED_FILE_COMMENT.to_string();
     output.push_str("pub static LINTS: &[&crate::LintInfo] = &[\n");
 
-    for (is_public, module_name, lint_name) in details {
-        if !is_public {
-            output.push_str("    #[cfg(feature = \"internal\")]\n");
-        }
+    for (module_name, lint_name) in details {
         let _: fmt::Result = writeln!(output, "    crate::{module_name}::{lint_name}_INFO,");
     }
     output.push_str("];\n");
@@ -937,41 +910,6 @@ mod tests {
     }
 
     #[test]
-    fn test_usable_lints() {
-        let lints = vec![
-            Lint::new(
-                "should_assert_eq2",
-                "Not Deprecated",
-                "\"abc\"",
-                "module_name",
-                Range::default(),
-            ),
-            Lint::new(
-                "should_assert_eq2",
-                "internal",
-                "\"abc\"",
-                "module_name",
-                Range::default(),
-            ),
-            Lint::new(
-                "should_assert_eq2",
-                "internal_style",
-                "\"abc\"",
-                "module_name",
-                Range::default(),
-            ),
-        ];
-        let expected = vec![Lint::new(
-            "should_assert_eq2",
-            "Not Deprecated",
-            "\"abc\"",
-            "module_name",
-            Range::default(),
-        )];
-        assert_eq!(expected, Lint::usable_lints(&lints));
-    }
-
-    #[test]
     fn test_by_lint_group() {
         let lints = vec![
             Lint::new("should_assert_eq", "group1", "\"abc\"", "module_name", Range::default()),
diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml
index d36b6ae9c95..20951afccbb 100644
--- a/clippy_lints/Cargo.toml
+++ b/clippy_lints/Cargo.toml
@@ -19,10 +19,7 @@ itertools = "0.12"
 quine-mc_cluskey = "0.2"
 regex-syntax = "0.8"
 serde = { version = "1.0", features = ["derive"] }
-serde_json = { version = "1.0", optional = true }
-tempfile = { version = "3.3.0", optional = true }
 toml = "0.7.3"
-regex = { version = "1.5", optional = true }
 unicode-normalization = "0.1"
 unicode-script = { version = "0.5", default-features = false }
 semver = "1.0"
@@ -31,10 +28,6 @@ url = "2.2"
 [dev-dependencies]
 walkdir = "2.3"
 
-[features]
-# build clippy with internal lints enabled, off by default
-internal = ["serde_json", "tempfile", "regex"]
-
 [package.metadata.rust-analyzer]
 # This crate uses #[feature(rustc_private)]
 rustc_private = true
diff --git a/clippy_lints/src/declare_clippy_lint.rs b/clippy_lints/src/declare_clippy_lint.rs
index 4d908af4084..9f82f876727 100644
--- a/clippy_lints/src/declare_clippy_lint.rs
+++ b/clippy_lints/src/declare_clippy_lint.rs
@@ -165,17 +165,4 @@ macro_rules! declare_clippy_lint {
             $(, $eval_always)?
         }
     };
-
-    (
-        $(#[doc = $lit:literal])*
-        pub $lint_name:ident,
-        internal,
-        $desc:literal
-    ) => {
-        declare_clippy_lint! {@
-            $(#[doc = $lit])*
-            pub $lint_name, Allow, crate::LintCategory::Internal, $desc,
-            None, "0.0.0"
-        }
-    };
 }
diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs
index 77ae16a592f..3b36bea106e 100644
--- a/clippy_lints/src/declared_lints.rs
+++ b/clippy_lints/src/declared_lints.rs
@@ -3,36 +3,6 @@
 // Manual edits will be overwritten.
 
 pub static LINTS: &[&crate::LintInfo] = &[
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::almost_standard_lint_formulation::ALMOST_STANDARD_LINT_FORMULATION_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::collapsible_calls::COLLAPSIBLE_SPAN_LINT_CALLS_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::interning_defined_symbol::INTERNING_DEFINED_SYMBOL_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::interning_defined_symbol::UNNECESSARY_SYMBOL_STR_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::invalid_paths::INVALID_PATHS_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::lint_without_lint_pass::DEFAULT_LINT_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::lint_without_lint_pass::INVALID_CLIPPY_VERSION_ATTRIBUTE_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::lint_without_lint_pass::LINT_WITHOUT_LINT_PASS_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::lint_without_lint_pass::MISSING_CLIPPY_VERSION_ATTRIBUTE_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::msrv_attr_impl::MISSING_MSRV_ATTR_IMPL_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::outer_expn_data_pass::OUTER_EXPN_EXPN_DATA_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::produce_ice::PRODUCE_ICE_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::slow_symbol_comparisons::SLOW_SYMBOL_COMPARISONS_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::unnecessary_def_path::UNNECESSARY_DEF_PATH_INFO,
-    #[cfg(feature = "internal")]
-    crate::utils::internal_lints::unsorted_clippy_utils_paths::UNSORTED_CLIPPY_UTILS_PATHS_INFO,
     crate::absolute_paths::ABSOLUTE_PATHS_INFO,
     crate::almost_complete_range::ALMOST_COMPLETE_RANGE_INFO,
     crate::approx_const::APPROX_CONSTANT_INFO,
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 9e1df7881ce..4a08d43cfcd 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -65,7 +65,6 @@ mod declare_clippy_lint;
 #[macro_use]
 extern crate clippy_utils;
 
-#[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))]
 mod utils;
 
 pub mod ctfe; // Very important lint, do not remove (rust#125116)
@@ -412,21 +411,6 @@ use rustc_data_structures::fx::FxHashSet;
 use rustc_lint::{Lint, LintId};
 use utils::attr_collector::{AttrCollector, AttrStorage};
 
-/// Register all pre expansion lints
-///
-/// Pre-expansion lints run before any macro expansion has happened.
-///
-/// Note that due to the architecture of the compiler, currently `cfg_attr` attributes on crate
-/// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
-///
-/// Used in `./src/driver.rs`.
-pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
-    // NOTE: Do not add any more pre-expansion passes. These should be removed eventually.
-    store.register_pre_expansion_pass(move || Box::new(attrs::EarlyAttributes::new(conf)));
-
-    store.register_early_pass(move || Box::new(attrs::PostExpansionEarlyAttributes::new(conf)));
-}
-
 #[derive(Default)]
 struct RegistrationGroups {
     all: Vec<LintId>,
@@ -439,8 +423,6 @@ struct RegistrationGroups {
     restriction: Vec<LintId>,
     style: Vec<LintId>,
     suspicious: Vec<LintId>,
-    #[cfg(feature = "internal")]
-    internal: Vec<LintId>,
 }
 
 impl RegistrationGroups {
@@ -456,8 +438,6 @@ impl RegistrationGroups {
         store.register_group(true, "clippy::restriction", Some("clippy_restriction"), self.restriction);
         store.register_group(true, "clippy::style", Some("clippy_style"), self.style);
         store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), self.suspicious);
-        #[cfg(feature = "internal")]
-        store.register_group(true, "clippy::internal", Some("clippy_internal"), self.internal);
     }
 }
 
@@ -472,8 +452,6 @@ pub(crate) enum LintCategory {
     Restriction,
     Style,
     Suspicious,
-    #[cfg(feature = "internal")]
-    Internal,
 }
 
 #[allow(clippy::enum_glob_use)]
@@ -495,8 +473,6 @@ impl LintCategory {
             Restriction => &mut groups.restriction,
             Style => &mut groups.style,
             Suspicious => &mut groups.suspicious,
-            #[cfg(feature = "internal")]
-            Internal => &mut groups.internal,
         }
     }
 }
@@ -530,8 +506,6 @@ impl LintInfo {
             Restriction => "restriction",
             Style => "style",
             Suspicious => "suspicious",
-            #[cfg(feature = "internal")]
-            Internal => "internal",
         }
     }
 }
@@ -589,6 +563,13 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
         store.register_removed(name, reason);
     }
 
+    // NOTE: Do not add any more pre-expansion passes. These should be removed eventually.
+    // Due to the architecture of the compiler, currently `cfg_attr` attributes on crate
+    // level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
+    store.register_pre_expansion_pass(move || Box::new(attrs::EarlyAttributes::new(conf)));
+
+    store.register_early_pass(move || Box::new(attrs::PostExpansionEarlyAttributes::new(conf)));
+
     let format_args_storage = FormatArgsStorage::default();
     let format_args = format_args_storage.clone();
     store.register_early_pass(move || {
@@ -601,30 +582,6 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
     let attrs = attr_storage.clone();
     store.register_early_pass(move || Box::new(AttrCollector::new(attrs.clone())));
 
-    // all the internal lints
-    #[cfg(feature = "internal")]
-    {
-        store.register_early_pass(|| {
-            Box::new(utils::internal_lints::unsorted_clippy_utils_paths::UnsortedClippyUtilsPaths)
-        });
-        store.register_early_pass(|| Box::new(utils::internal_lints::produce_ice::ProduceIce));
-        store.register_late_pass(|_| Box::new(utils::internal_lints::collapsible_calls::CollapsibleCalls));
-        store.register_late_pass(|_| Box::new(utils::internal_lints::invalid_paths::InvalidPaths));
-        store.register_late_pass(|_| {
-            Box::<utils::internal_lints::interning_defined_symbol::InterningDefinedSymbol>::default()
-        });
-        store.register_late_pass(|_| {
-            Box::<utils::internal_lints::lint_without_lint_pass::LintWithoutLintPass>::default()
-        });
-        store.register_late_pass(|_| Box::<utils::internal_lints::unnecessary_def_path::UnnecessaryDefPath>::default());
-        store.register_late_pass(|_| Box::new(utils::internal_lints::outer_expn_data_pass::OuterExpnDataPass));
-        store.register_late_pass(|_| Box::new(utils::internal_lints::msrv_attr_impl::MsrvAttrImpl));
-        store.register_late_pass(|_| {
-            Box::new(utils::internal_lints::almost_standard_lint_formulation::AlmostStandardFormulation::new())
-        });
-        store.register_late_pass(|_| Box::new(utils::internal_lints::slow_symbol_comparisons::SlowSymbolComparisons));
-    }
-
     store.register_late_pass(|_| Box::new(ctfe::ClippyCtfe));
 
     store.register_late_pass(move |_| Box::new(operators::arithmetic_side_effects::ArithmeticSideEffects::new(conf)));
diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs
index 9443dca154e..4df173e1d16 100644
--- a/clippy_lints/src/regex.rs
+++ b/clippy_lints/src/regex.rs
@@ -76,7 +76,7 @@ declare_clippy_lint! {
     /// This is documented as an antipattern [on the regex documentation](https://docs.rs/regex/latest/regex/#avoid-re-compiling-regexes-especially-in-a-loop)
     ///
     /// ### Example
-    /// ```no_run
+    /// ```rust,ignore
     /// # let haystacks = [""];
     /// # const MY_REGEX: &str = "a.b";
     /// for haystack in haystacks {
@@ -87,7 +87,7 @@ declare_clippy_lint! {
     /// }
     /// ```
     /// can be replaced with
-    /// ```no_run
+    /// ```rust,ignore
     /// # let haystacks = [""];
     /// # const MY_REGEX: &str = "a.b";
     /// let regex = regex::Regex::new(MY_REGEX).unwrap();
diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs
deleted file mode 100644
index deb983b6971..00000000000
--- a/clippy_lints/src/utils/internal_lints.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-pub mod almost_standard_lint_formulation;
-pub mod collapsible_calls;
-pub mod interning_defined_symbol;
-pub mod invalid_paths;
-pub mod lint_without_lint_pass;
-pub mod msrv_attr_impl;
-pub mod outer_expn_data_pass;
-pub mod produce_ice;
-pub mod slow_symbol_comparisons;
-pub mod unnecessary_def_path;
-pub mod unsorted_clippy_utils_paths;
diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs
index 4476cd1005e..16066dd96c0 100644
--- a/clippy_lints/src/utils/mod.rs
+++ b/clippy_lints/src/utils/mod.rs
@@ -2,6 +2,3 @@ pub mod attr_collector;
 pub mod author;
 pub mod dump_hir;
 pub mod format_args_collector;
-
-#[cfg(feature = "internal")]
-pub mod internal_lints;
diff --git a/clippy_lints_internal/Cargo.toml b/clippy_lints_internal/Cargo.toml
new file mode 100644
index 00000000000..2a0ceac27a3
--- /dev/null
+++ b/clippy_lints_internal/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "clippy_lints_internal"
+version = "0.0.1"
+edition = "2021"
+
+[dependencies]
+clippy_config = { path = "../clippy_config" }
+clippy_utils = { path = "../clippy_utils" }
+regex = { version = "1.5" }
+rustc-semver = "1.1"
+
+[package.metadata.rust-analyzer]
+# This crate uses #[feature(rustc_private)]
+rustc_private = true
diff --git a/clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs b/clippy_lints_internal/src/almost_standard_lint_formulation.rs
index 0a01a364a75..4fd5ea459a5 100644
--- a/clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs
+++ b/clippy_lints_internal/src/almost_standard_lint_formulation.rs
@@ -1,11 +1,12 @@
-use crate::utils::internal_lints::lint_without_lint_pass::is_lint_ref_type;
+use crate::lint_without_lint_pass::is_lint_ref_type;
 use clippy_utils::diagnostics::span_lint_and_help;
 use regex::Regex;
 use rustc_hir::{Attribute, Item, ItemKind, Mutability};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_session::impl_lint_pass;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks if lint formulations have a standardized format.
     ///
@@ -14,9 +15,10 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// `Checks for use...` can be written as `Checks for usage...` .
-    pub ALMOST_STANDARD_LINT_FORMULATION,
-    internal,
-    "lint formulations must have a standardized format."
+    pub clippy::ALMOST_STANDARD_LINT_FORMULATION,
+    Warn,
+    "lint formulations must have a standardized format.",
+    report_in_external_macro: true
 }
 
 impl_lint_pass!(AlmostStandardFormulation => [ALMOST_STANDARD_LINT_FORMULATION]);
diff --git a/clippy_lints/src/utils/internal_lints/collapsible_calls.rs b/clippy_lints_internal/src/collapsible_calls.rs
index 2e6fb7c4ce4..d7967a0cc02 100644
--- a/clippy_lints/src/utils/internal_lints/collapsible_calls.rs
+++ b/clippy_lints_internal/src/collapsible_calls.rs
@@ -4,12 +4,13 @@ use clippy_utils::{SpanlessEq, is_expr_path_def_path, is_lint_allowed, peel_bloc
 use rustc_errors::Applicability;
 use rustc_hir::{Closure, Expr, ExprKind};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_session::declare_lint_pass;
 use rustc_span::Span;
 
 use std::borrow::{Borrow, Cow};
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Lints `span_lint_and_then` function calls, where the
     /// closure argument has only one statement and that statement is a method
@@ -64,9 +65,10 @@ declare_clippy_lint! {
     /// span_lint_and_note(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), note_msg);
     /// span_lint_and_note(cx, TEST_LINT, expr.span, lint_msg, None, note_msg);
     /// ```
-    pub COLLAPSIBLE_SPAN_LINT_CALLS,
-    internal,
-    "found collapsible `span_lint_and_then` calls"
+    pub clippy::COLLAPSIBLE_SPAN_LINT_CALLS,
+    Warn,
+    "found collapsible `span_lint_and_then` calls",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(CollapsibleCalls => [COLLAPSIBLE_SPAN_LINT_CALLS]);
diff --git a/clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs b/clippy_lints_internal/src/interning_defined_symbol.rs
index 044894f8279..831e8876330 100644
--- a/clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs
+++ b/clippy_lints_internal/src/interning_defined_symbol.rs
@@ -9,6 +9,7 @@ use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::DefId;
 use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_middle::mir::ConstValue;
 use rustc_middle::ty;
 use rustc_session::impl_lint_pass;
@@ -17,7 +18,7 @@ use rustc_span::symbol::Symbol;
 
 use std::borrow::Cow;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks for interning symbols that have already been pre-interned and defined as constants.
     ///
@@ -33,12 +34,13 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// let _ = sym::f32;
     /// ```
-    pub INTERNING_DEFINED_SYMBOL,
-    internal,
-    "interning a symbol that is pre-interned and defined as a constant"
+    pub clippy::INTERNING_DEFINED_SYMBOL,
+    Warn,
+    "interning a symbol that is pre-interned and defined as a constant",
+    report_in_external_macro: true
 }
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks for unnecessary conversion from Symbol to a string.
     ///
@@ -54,9 +56,10 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// symbol == sym::clippy;
     /// ```
-    pub UNNECESSARY_SYMBOL_STR,
-    internal,
-    "unnecessary conversion between Symbol and string"
+    pub clippy::UNNECESSARY_SYMBOL_STR,
+    Warn,
+    "unnecessary conversion between Symbol and string",
+    report_in_external_macro: true
 }
 
 #[derive(Default)]
diff --git a/clippy_lints/src/utils/internal_lints/invalid_paths.rs b/clippy_lints_internal/src/invalid_paths.rs
index 5e1872ad975..bee87efa3fc 100644
--- a/clippy_lints/src/utils/internal_lints/invalid_paths.rs
+++ b/clippy_lints_internal/src/invalid_paths.rs
@@ -5,12 +5,13 @@ use rustc_hir as hir;
 use rustc_hir::Item;
 use rustc_hir::def::DefKind;
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_middle::ty::fast_reject::SimplifiedType;
 use rustc_middle::ty::{self, FloatTy};
 use rustc_session::declare_lint_pass;
 use rustc_span::symbol::Symbol;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks the paths module for invalid paths.
     ///
@@ -19,9 +20,10 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// None.
-    pub INVALID_PATHS,
-    internal,
-    "invalid path"
+    pub clippy::INVALID_PATHS,
+    Warn,
+    "invalid path",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(InvalidPaths => [INVALID_PATHS]);
diff --git a/clippy_lints_internal/src/lib.rs b/clippy_lints_internal/src/lib.rs
new file mode 100644
index 00000000000..1e59a93dc9e
--- /dev/null
+++ b/clippy_lints_internal/src/lib.rs
@@ -0,0 +1,78 @@
+#![feature(let_chains, rustc_private)]
+#![allow(
+    clippy::missing_docs_in_private_items,
+    clippy::must_use_candidate,
+    rustc::diagnostic_outside_of_impl,
+    rustc::untranslatable_diagnostic
+)]
+#![warn(
+    trivial_casts,
+    trivial_numeric_casts,
+    rust_2018_idioms,
+    unused_lifetimes,
+    unused_qualifications,
+    rustc::internal
+)]
+// Disable this rustc lint for now, as it was also done in rustc
+#![allow(rustc::potential_query_instability)]
+// None of these lints need a version.
+#![allow(clippy::missing_clippy_version_attribute)]
+
+extern crate rustc_ast;
+extern crate rustc_attr_parsing;
+extern crate rustc_data_structures;
+extern crate rustc_errors;
+extern crate rustc_hir;
+extern crate rustc_lint;
+extern crate rustc_lint_defs;
+extern crate rustc_middle;
+extern crate rustc_session;
+extern crate rustc_span;
+
+mod almost_standard_lint_formulation;
+mod collapsible_calls;
+mod interning_defined_symbol;
+mod invalid_paths;
+mod lint_without_lint_pass;
+mod msrv_attr_impl;
+mod outer_expn_data_pass;
+mod produce_ice;
+mod slow_symbol_comparisons;
+mod unnecessary_def_path;
+mod unsorted_clippy_utils_paths;
+
+use rustc_lint::{Lint, LintStore};
+
+static LINTS: &[&Lint] = &[
+    almost_standard_lint_formulation::ALMOST_STANDARD_LINT_FORMULATION,
+    collapsible_calls::COLLAPSIBLE_SPAN_LINT_CALLS,
+    interning_defined_symbol::INTERNING_DEFINED_SYMBOL,
+    interning_defined_symbol::UNNECESSARY_SYMBOL_STR,
+    invalid_paths::INVALID_PATHS,
+    lint_without_lint_pass::DEFAULT_LINT,
+    lint_without_lint_pass::INVALID_CLIPPY_VERSION_ATTRIBUTE,
+    lint_without_lint_pass::LINT_WITHOUT_LINT_PASS,
+    lint_without_lint_pass::MISSING_CLIPPY_VERSION_ATTRIBUTE,
+    msrv_attr_impl::MISSING_MSRV_ATTR_IMPL,
+    outer_expn_data_pass::OUTER_EXPN_EXPN_DATA,
+    produce_ice::PRODUCE_ICE,
+    slow_symbol_comparisons::SLOW_SYMBOL_COMPARISONS,
+    unnecessary_def_path::UNNECESSARY_DEF_PATH,
+    unsorted_clippy_utils_paths::UNSORTED_CLIPPY_UTILS_PATHS,
+];
+
+pub fn register_lints(store: &mut LintStore) {
+    store.register_lints(LINTS);
+
+    store.register_early_pass(|| Box::new(unsorted_clippy_utils_paths::UnsortedClippyUtilsPaths));
+    store.register_early_pass(|| Box::new(produce_ice::ProduceIce));
+    store.register_late_pass(|_| Box::new(collapsible_calls::CollapsibleCalls));
+    store.register_late_pass(|_| Box::new(invalid_paths::InvalidPaths));
+    store.register_late_pass(|_| Box::<interning_defined_symbol::InterningDefinedSymbol>::default());
+    store.register_late_pass(|_| Box::<lint_without_lint_pass::LintWithoutLintPass>::default());
+    store.register_late_pass(|_| Box::<unnecessary_def_path::UnnecessaryDefPath>::default());
+    store.register_late_pass(|_| Box::new(outer_expn_data_pass::OuterExpnDataPass));
+    store.register_late_pass(|_| Box::new(msrv_attr_impl::MsrvAttrImpl));
+    store.register_late_pass(|_| Box::new(almost_standard_lint_formulation::AlmostStandardFormulation::new()));
+    store.register_late_pass(|_| Box::new(slow_symbol_comparisons::SlowSymbolComparisons));
+}
diff --git a/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs b/clippy_lints_internal/src/lint_without_lint_pass.rs
index bee05e52ed2..6a75defcce3 100644
--- a/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs
+++ b/clippy_lints_internal/src/lint_without_lint_pass.rs
@@ -9,13 +9,14 @@ use rustc_hir::hir_id::CRATE_HIR_ID;
 use rustc_hir::intravisit::Visitor;
 use rustc_hir::{ExprKind, HirId, Item, MutTy, Mutability, Path, TyKind};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_middle::hir::nested_filter;
 use rustc_session::impl_lint_pass;
 use rustc_span::source_map::Spanned;
 use rustc_span::symbol::Symbol;
 use rustc_span::{Span, sym};
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Ensures every lint is associated to a `LintPass`.
     ///
@@ -37,12 +38,14 @@ declare_clippy_lint! {
     /// declare_lint_pass!(Pass => [LINT_1, LINT_2]);
     /// // missing FORGOTTEN_LINT
     /// ```
-    pub LINT_WITHOUT_LINT_PASS,
-    internal,
-    "declaring a lint without associating it in a LintPass"
+    pub clippy::LINT_WITHOUT_LINT_PASS,
+    Warn,
+    "declaring a lint without associating it in a LintPass",
+    report_in_external_macro: true
+
 }
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks for cases of an auto-generated lint without an updated description,
     /// i.e. `default lint description`.
@@ -59,30 +62,32 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// declare_lint! { pub COOL_LINT, nursery, "a great new lint" }
     /// ```
-    pub DEFAULT_LINT,
-    internal,
-    "found 'default lint description' in a lint declaration"
+    pub clippy::DEFAULT_LINT,
+    Warn,
+    "found 'default lint description' in a lint declaration",
+    report_in_external_macro: true
 }
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks for invalid `clippy::version` attributes.
     ///
     /// Valid values are:
     /// * "pre 1.29.0"
     /// * any valid semantic version
-    pub INVALID_CLIPPY_VERSION_ATTRIBUTE,
-    internal,
-    "found an invalid `clippy::version` attribute"
+    pub clippy::INVALID_CLIPPY_VERSION_ATTRIBUTE,
+    Warn,
+    "found an invalid `clippy::version` attribute",
+    report_in_external_macro: true
 }
 
-declare_clippy_lint! {
+declare_tool_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"
+    pub clippy::MISSING_CLIPPY_VERSION_ATTRIBUTE,
+    Warn,
+    "found clippy lint without `clippy::version` attribute",
+    report_in_external_macro: true
 }
 
 #[derive(Clone, Debug, Default)]
@@ -100,10 +105,6 @@ impl_lint_pass!(LintWithoutLintPass => [
 
 impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
     fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
-        if is_lint_allowed(cx, DEFAULT_LINT, item.hir_id()) {
-            return;
-        }
-
         if let hir::ItemKind::Static(ident, ty, Mutability::Not, body_id) = item.kind {
             if is_lint_ref_type(cx, ty) {
                 check_invalid_clippy_version_attribute(cx, item);
diff --git a/clippy_lints/src/utils/internal_lints/msrv_attr_impl.rs b/clippy_lints_internal/src/msrv_attr_impl.rs
index 558acacb972..dda054546e2 100644
--- a/clippy_lints/src/utils/internal_lints/msrv_attr_impl.rs
+++ b/clippy_lints_internal/src/msrv_attr_impl.rs
@@ -5,16 +5,17 @@ use clippy_utils::{match_def_path, paths};
 use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_lint::{LateContext, LateLintPass, LintContext};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_middle::ty::{self, EarlyBinder, GenericArgKind};
 use rustc_session::declare_lint_pass;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Check that the `extract_msrv_attr!` macro is used, when a lint has a MSRV.
-    ///
-    pub MISSING_MSRV_ATTR_IMPL,
-    internal,
-    "checking if all necessary steps were taken when adding a MSRV to a lint"
+    pub clippy::MISSING_MSRV_ATTR_IMPL,
+    Warn,
+    "checking if all necessary steps were taken when adding a MSRV to a lint",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(MsrvAttrImpl => [MISSING_MSRV_ATTR_IMPL]);
diff --git a/clippy_lints/src/utils/internal_lints/outer_expn_data_pass.rs b/clippy_lints_internal/src/outer_expn_data_pass.rs
index 326e1721461..e9441964797 100644
--- a/clippy_lints/src/utils/internal_lints/outer_expn_data_pass.rs
+++ b/clippy_lints_internal/src/outer_expn_data_pass.rs
@@ -4,10 +4,11 @@ use clippy_utils::{is_lint_allowed, method_calls, paths};
 use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_session::declare_lint_pass;
 use rustc_span::symbol::Symbol;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks for calls to `cx.outer().expn_data()` and suggests to use
     /// the `cx.outer_expn_data()`
@@ -24,9 +25,10 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// expr.span.ctxt().outer_expn_data()
     /// ```
-    pub OUTER_EXPN_EXPN_DATA,
-    internal,
-    "using `cx.outer_expn().expn_data()` instead of `cx.outer_expn_data()`"
+    pub clippy::OUTER_EXPN_EXPN_DATA,
+    Warn,
+    "using `cx.outer_expn().expn_data()` instead of `cx.outer_expn_data()`",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(OuterExpnDataPass => [OUTER_EXPN_EXPN_DATA]);
diff --git a/clippy_lints/src/utils/internal_lints/produce_ice.rs b/clippy_lints_internal/src/produce_ice.rs
index 2bcb7b8ef14..14e93dc6d5f 100644
--- a/clippy_lints/src/utils/internal_lints/produce_ice.rs
+++ b/clippy_lints_internal/src/produce_ice.rs
@@ -1,10 +1,11 @@
 use rustc_ast::ast::NodeId;
 use rustc_ast::visit::FnKind;
 use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_session::declare_lint_pass;
 use rustc_span::Span;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Not an actual lint. This lint is only meant for testing our customized internal compiler
     /// error message by calling `panic`.
@@ -16,9 +17,10 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// 🍦🍦🍦🍦🍦
     /// ```
-    pub PRODUCE_ICE,
-    internal,
-    "this message should not appear anywhere as we ICE before and don't emit the lint"
+    pub clippy::PRODUCE_ICE,
+    Warn,
+    "this message should not appear anywhere as we ICE before and don't emit the lint",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(ProduceIce => [PRODUCE_ICE]);
diff --git a/clippy_lints/src/utils/internal_lints/slow_symbol_comparisons.rs b/clippy_lints_internal/src/slow_symbol_comparisons.rs
index b8bcb9b3756..6776366a23b 100644
--- a/clippy_lints/src/utils/internal_lints/slow_symbol_comparisons.rs
+++ b/clippy_lints_internal/src/slow_symbol_comparisons.rs
@@ -6,10 +6,11 @@ use clippy_utils::ty::match_type;
 use rustc_errors::Applicability;
 use rustc_hir::{BinOpKind, Expr, ExprKind};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_session::declare_lint_pass;
 use rustc_span::{Span, sym};
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     ///
     /// Detects symbol comparison using `Symbol::intern`.
@@ -21,9 +22,10 @@ declare_clippy_lint! {
     /// ### Example
     ///
     /// None, see suggestion.
-    pub SLOW_SYMBOL_COMPARISONS,
-    internal,
-    "detects slow comparisons of symbol"
+    pub clippy::SLOW_SYMBOL_COMPARISONS,
+    Warn,
+    "detects slow comparisons of symbol",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(SlowSymbolComparisons => [SLOW_SYMBOL_COMPARISONS]);
diff --git a/clippy_lints/src/utils/internal_lints/unnecessary_def_path.rs b/clippy_lints_internal/src/unnecessary_def_path.rs
index 3790805df35..6bdfbed55b0 100644
--- a/clippy_lints/src/utils/internal_lints/unnecessary_def_path.rs
+++ b/clippy_lints_internal/src/unnecessary_def_path.rs
@@ -8,6 +8,7 @@ use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::DefId;
 use rustc_hir::{Expr, ExprKind, LetStmt, Mutability, Node};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_middle::mir::ConstValue;
 use rustc_middle::mir::interpret::{Allocation, GlobalAlloc};
 use rustc_middle::ty::{self, Ty};
@@ -17,7 +18,7 @@ use rustc_span::symbol::Symbol;
 
 use std::str;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks for usage of def paths when a diagnostic item or a `LangItem` could be used.
     ///
@@ -34,9 +35,10 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// utils::is_type_diagnostic_item(cx, ty, sym::Vec)
     /// ```
-    pub UNNECESSARY_DEF_PATH,
-    internal,
-    "using a def path when a diagnostic item or a `LangItem` is available"
+    pub clippy::UNNECESSARY_DEF_PATH,
+    Warn,
+    "using a def path when a diagnostic item or a `LangItem` is available",
+    report_in_external_macro: true
 }
 
 impl_lint_pass!(UnnecessaryDefPath => [UNNECESSARY_DEF_PATH]);
diff --git a/clippy_lints/src/utils/internal_lints/unsorted_clippy_utils_paths.rs b/clippy_lints_internal/src/unsorted_clippy_utils_paths.rs
index bf60df5119d..8e281ecb2ee 100644
--- a/clippy_lints/src/utils/internal_lints/unsorted_clippy_utils_paths.rs
+++ b/clippy_lints_internal/src/unsorted_clippy_utils_paths.rs
@@ -1,9 +1,10 @@
 use clippy_utils::diagnostics::span_lint;
 use rustc_ast::ast::{Crate, ItemKind, ModKind};
 use rustc_lint::{EarlyContext, EarlyLintPass};
+use rustc_lint_defs::declare_tool_lint;
 use rustc_session::declare_lint_pass;
 
-declare_clippy_lint! {
+declare_tool_lint! {
     /// ### What it does
     /// Checks that [`clippy_utils::paths`] is sorted lexically
     ///
@@ -12,9 +13,10 @@ declare_clippy_lint! {
     ///
     /// ### Example
     /// Wrong ordering of the util::paths constants.
-    pub UNSORTED_CLIPPY_UTILS_PATHS,
-    internal,
-    "various things that will negatively affect your clippy experience"
+    pub clippy::UNSORTED_CLIPPY_UTILS_PATHS,
+    Warn,
+    "various things that will negatively affect your clippy experience",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(UnsortedClippyUtilsPaths => [UNSORTED_CLIPPY_UTILS_PATHS]);
diff --git a/src/driver.rs b/src/driver.rs
index c6b3c06baa4..7837ecbdb84 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -158,7 +158,8 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
 
             let conf = clippy_config::Conf::read(sess, &conf_path);
             clippy_lints::register_lints(lint_store, conf);
-            clippy_lints::register_pre_expansion_lints(lint_store, conf);
+            #[cfg(feature = "internal")]
+            clippy_lints_internal::register_lints(lint_store);
         }));
 
         // FIXME: #4825; This is required, because Clippy lints that are based on MIR have to be
diff --git a/tests/dogfood.rs b/tests/dogfood.rs
index 858be389a9e..ec3c01d5e6c 100644
--- a/tests/dogfood.rs
+++ b/tests/dogfood.rs
@@ -36,6 +36,7 @@ fn dogfood() {
     for package in [
         "./",
         "clippy_dev",
+        "clippy_lints_internal",
         "clippy_lints",
         "clippy_utils",
         "clippy_config",
@@ -81,10 +82,7 @@ fn run_clippy_for_package(project: &str, args: &[&str]) -> bool {
     command.arg("--").args(args);
     command.arg("-Cdebuginfo=0"); // disable debuginfo to generate less data in the target dir
 
-    if cfg!(feature = "internal") {
-        // internal lints only exist if we build with the internal feature
-        command.args(["-D", "clippy::internal"]);
-    } else {
+    if !cfg!(feature = "internal") {
         // running a clippy built without internal lints on the clippy source
         // that contains e.g. `allow(clippy::invalid_paths)`
         command.args(["-A", "unknown_lints"]);
diff --git a/tests/ui-internal/auxiliary/paths.rs b/tests/ui-internal/auxiliary/paths.rs
index 52fcaec4df3..f730f564a09 100644
--- a/tests/ui-internal/auxiliary/paths.rs
+++ b/tests/ui-internal/auxiliary/paths.rs
@@ -1,2 +1,4 @@
+#![allow(clippy::unnecessary_def_path)]
+
 pub static OPTION: [&str; 3] = ["core", "option", "Option"];
 pub const RESULT: &[&str] = &["core", "result", "Result"];
diff --git a/tests/ui-internal/check_clippy_version_attribute.rs b/tests/ui-internal/check_clippy_version_attribute.rs
index e5f6001b74d..897002949e6 100644
--- a/tests/ui-internal/check_clippy_version_attribute.rs
+++ b/tests/ui-internal/check_clippy_version_attribute.rs
@@ -1,5 +1,5 @@
-#![deny(clippy::internal)]
 #![feature(rustc_private)]
+#![deny(clippy::invalid_clippy_version_attribute, clippy::missing_clippy_version_attribute)]
 
 #[macro_use]
 extern crate rustc_middle;
@@ -86,6 +86,15 @@ mod internal_clippy_lints {
 }
 
 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]);
+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 1129c35d1d0..952bc944030 100644
--- a/tests/ui-internal/check_clippy_version_attribute.stderr
+++ b/tests/ui-internal/check_clippy_version_attribute.stderr
@@ -12,11 +12,10 @@ LL | | }
    |
    = help: please use a valid semantic version, see `doc/adding_lints.md`
 note: the lint level is defined here
-  --> tests/ui-internal/check_clippy_version_attribute.rs:1:9
+  --> tests/ui-internal/check_clippy_version_attribute.rs:2:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::invalid_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::invalid_clippy_version_attribute, clippy::missing_clippy_version_attribute)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: this item has an invalid `clippy::version` attribute
@@ -47,7 +46,11 @@ LL | | }
    | |_^
    |
    = help: please use a `clippy::version` attribute, see `doc/adding_lints.md`
-   = note: `#[deny(clippy::missing_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]`
+note: the lint level is defined here
+  --> tests/ui-internal/check_clippy_version_attribute.rs:2:51
+   |
+LL | #![deny(clippy::invalid_clippy_version_attribute, clippy::missing_clippy_version_attribute)]
+   |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `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
diff --git a/tests/ui-internal/check_formulation.rs b/tests/ui-internal/check_formulation.rs
index 8265a78769d..bcbb0d78319 100644
--- a/tests/ui-internal/check_formulation.rs
+++ b/tests/ui-internal/check_formulation.rs
@@ -1,4 +1,5 @@
-#![warn(clippy::almost_standard_lint_formulation)]
+#![deny(clippy::almost_standard_lint_formulation)]
+#![allow(clippy::lint_without_lint_pass)]
 #![feature(rustc_private)]
 
 #[macro_use]
diff --git a/tests/ui-internal/check_formulation.stderr b/tests/ui-internal/check_formulation.stderr
index b16e1bf8687..9aeb9e1f2d4 100644
--- a/tests/ui-internal/check_formulation.stderr
+++ b/tests/ui-internal/check_formulation.stderr
@@ -1,15 +1,18 @@
 error: non-standard lint formulation
-  --> tests/ui-internal/check_formulation.rs:23:5
+  --> tests/ui-internal/check_formulation.rs:24:5
    |
 LL |     /// Check for lint formulations that are correct
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider using `Checks for`
-   = note: `-D clippy::almost-standard-lint-formulation` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::almost_standard_lint_formulation)]`
+note: the lint level is defined here
+  --> tests/ui-internal/check_formulation.rs:1:9
+   |
+LL | #![deny(clippy::almost_standard_lint_formulation)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: non-standard lint formulation
-  --> tests/ui-internal/check_formulation.rs:34:5
+  --> tests/ui-internal/check_formulation.rs:35:5
    |
 LL |     /// Detects uses of incorrect formulations
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-internal/collapsible_span_lint_calls.fixed b/tests/ui-internal/collapsible_span_lint_calls.fixed
index 918e33345a7..76f68686ee2 100644
--- a/tests/ui-internal/collapsible_span_lint_calls.fixed
+++ b/tests/ui-internal/collapsible_span_lint_calls.fixed
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::collapsible_span_lint_calls)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/collapsible_span_lint_calls.rs b/tests/ui-internal/collapsible_span_lint_calls.rs
index 2f289ae2b48..214c8783a66 100644
--- a/tests/ui-internal/collapsible_span_lint_calls.rs
+++ b/tests/ui-internal/collapsible_span_lint_calls.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::collapsible_span_lint_calls)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/collapsible_span_lint_calls.stderr b/tests/ui-internal/collapsible_span_lint_calls.stderr
index a2be1f1cd36..9c83538947c 100644
--- a/tests/ui-internal/collapsible_span_lint_calls.stderr
+++ b/tests/ui-internal/collapsible_span_lint_calls.stderr
@@ -10,9 +10,8 @@ LL | |         });
 note: the lint level is defined here
   --> tests/ui-internal/collapsible_span_lint_calls.rs:1:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::collapsible_span_lint_calls)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::collapsible_span_lint_calls)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: this call is collapsible
   --> tests/ui-internal/collapsible_span_lint_calls.rs:39:9
diff --git a/tests/ui-internal/custom_ice_message.rs b/tests/ui-internal/custom_ice_message.rs
index 71819fe3707..c7e92b1bf16 100644
--- a/tests/ui-internal/custom_ice_message.rs
+++ b/tests/ui-internal/custom_ice_message.rs
@@ -6,7 +6,7 @@
 //@normalize-stderr-test: "rustc 1\.\d+.* running on .*" -> "rustc <version> running on <target>"
 //@normalize-stderr-test: "(?ms)query stack during panic:\n.*end of query stack\n" -> ""
 
-#![deny(clippy::internal)]
+#![deny(clippy::produce_ice)]
 #![allow(clippy::missing_clippy_version_attribute)]
 
 fn it_looks_like_you_are_trying_to_kill_clippy() {}
diff --git a/tests/ui-internal/custom_ice_message.stderr b/tests/ui-internal/custom_ice_message.stderr
index 589e1190a90..884d3d035a2 100644
--- a/tests/ui-internal/custom_ice_message.stderr
+++ b/tests/ui-internal/custom_ice_message.stderr
@@ -8,7 +8,7 @@ error: internal compiler error: Would you like some help with that?
 LL | fn it_looks_like_you_are_trying_to_kill_clippy() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: delayed at clippy_lints/src/utils/internal_lints/produce_ice.rs - disabled backtrace
+note: delayed at clippy_lints_internal/src/produce_ice.rs - disabled backtrace
   --> tests/ui-internal/custom_ice_message.rs:12:1
    |
 LL | 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 959bfd27e38..809f2c4d080 100644
--- a/tests/ui-internal/default_lint.rs
+++ b/tests/ui-internal/default_lint.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::default_lint)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/default_lint.stderr b/tests/ui-internal/default_lint.stderr
index 9d4c2e15349..2c700ec82dc 100644
--- a/tests/ui-internal/default_lint.stderr
+++ b/tests/ui-internal/default_lint.stderr
@@ -13,9 +13,8 @@ LL | | }
 note: the lint level is defined here
   --> tests/ui-internal/default_lint.rs:1:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::default_lint)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::default_lint)]
+   |         ^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 1 previous error
diff --git a/tests/ui-internal/disallow_span_lint.rs b/tests/ui-internal/disallow_span_lint.rs
index 3fed38cab64..36e4158f6e6 100644
--- a/tests/ui-internal/disallow_span_lint.rs
+++ b/tests/ui-internal/disallow_span_lint.rs
@@ -1,4 +1,5 @@
 #![feature(rustc_private)]
+#![deny(clippy::disallowed_methods)]
 
 extern crate rustc_errors;
 extern crate rustc_hir;
diff --git a/tests/ui-internal/disallow_span_lint.stderr b/tests/ui-internal/disallow_span_lint.stderr
index 9a7a7ecbbff..f03a745963e 100644
--- a/tests/ui-internal/disallow_span_lint.stderr
+++ b/tests/ui-internal/disallow_span_lint.stderr
@@ -1,15 +1,18 @@
 error: use of a disallowed method `rustc_lint::context::LintContext::span_lint`
-  --> tests/ui-internal/disallow_span_lint.rs:14:8
+  --> tests/ui-internal/disallow_span_lint.rs:15:8
    |
 LL |     cx.span_lint(lint, span, |lint| {
    |        ^^^^^^^^^
    |
    = note: this function does not add a link to our documentation, please use the `clippy_utils::diagnostics::span_lint*` functions instead
-   = note: `-D clippy::disallowed-methods` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::disallowed_methods)]`
+note: the lint level is defined here
+  --> tests/ui-internal/disallow_span_lint.rs:2:9
+   |
+LL | #![deny(clippy::disallowed_methods)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: use of a disallowed method `rustc_middle::ty::context::TyCtxt::node_span_lint`
-  --> tests/ui-internal/disallow_span_lint.rs:21:9
+  --> tests/ui-internal/disallow_span_lint.rs:22:9
    |
 LL |     tcx.node_span_lint(lint, hir_id, span, |lint| {
    |         ^^^^^^^^^^^^^^
diff --git a/tests/ui-internal/interning_defined_symbol.fixed b/tests/ui-internal/interning_defined_symbol.fixed
index 92d3b1537e0..637deaa6de7 100644
--- a/tests/ui-internal/interning_defined_symbol.fixed
+++ b/tests/ui-internal/interning_defined_symbol.fixed
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::interning_defined_symbol)]
 #![allow(clippy::missing_clippy_version_attribute, clippy::let_unit_value)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/interning_defined_symbol.rs b/tests/ui-internal/interning_defined_symbol.rs
index d1e6f9cb1c4..63c476f6e20 100644
--- a/tests/ui-internal/interning_defined_symbol.rs
+++ b/tests/ui-internal/interning_defined_symbol.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::interning_defined_symbol)]
 #![allow(clippy::missing_clippy_version_attribute, clippy::let_unit_value)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/interning_defined_symbol.stderr b/tests/ui-internal/interning_defined_symbol.stderr
index c84a566436a..7002805a105 100644
--- a/tests/ui-internal/interning_defined_symbol.stderr
+++ b/tests/ui-internal/interning_defined_symbol.stderr
@@ -7,9 +7,8 @@ LL |     let _ = Symbol::intern("f32");
 note: the lint level is defined here
   --> tests/ui-internal/interning_defined_symbol.rs:1:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::interning_defined_symbol)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::interning_defined_symbol)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: interning a defined symbol
   --> tests/ui-internal/interning_defined_symbol.rs:21:13
diff --git a/tests/ui-internal/invalid_msrv_attr_impl.fixed b/tests/ui-internal/invalid_msrv_attr_impl.fixed
index 6804e2bbae8..238ef9ae6d0 100644
--- a/tests/ui-internal/invalid_msrv_attr_impl.fixed
+++ b/tests/ui-internal/invalid_msrv_attr_impl.fixed
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::missing_msrv_attr_impl)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/invalid_msrv_attr_impl.rs b/tests/ui-internal/invalid_msrv_attr_impl.rs
index c625a5d9a45..7753dcaad71 100644
--- a/tests/ui-internal/invalid_msrv_attr_impl.rs
+++ b/tests/ui-internal/invalid_msrv_attr_impl.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::missing_msrv_attr_impl)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/invalid_msrv_attr_impl.stderr b/tests/ui-internal/invalid_msrv_attr_impl.stderr
index 0a7636313ef..d5928d8c0c2 100644
--- a/tests/ui-internal/invalid_msrv_attr_impl.stderr
+++ b/tests/ui-internal/invalid_msrv_attr_impl.stderr
@@ -7,9 +7,8 @@ LL | impl EarlyLintPass for Pass {
 note: the lint level is defined here
   --> tests/ui-internal/invalid_msrv_attr_impl.rs:1:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::missing_msrv_attr_impl)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::missing_msrv_attr_impl)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: add `extract_msrv_attr!()` to the `EarlyLintPass` implementation
    |
 LL ~ impl EarlyLintPass for Pass {
diff --git a/tests/ui-internal/invalid_paths.rs b/tests/ui-internal/invalid_paths.rs
index abfb111f938..7317abc2185 100644
--- a/tests/ui-internal/invalid_paths.rs
+++ b/tests/ui-internal/invalid_paths.rs
@@ -1,4 +1,4 @@
-#![warn(clippy::internal)]
+#![deny(clippy::invalid_paths)]
 #![allow(clippy::missing_clippy_version_attribute, clippy::unnecessary_def_path)]
 
 mod paths {
diff --git a/tests/ui-internal/invalid_paths.stderr b/tests/ui-internal/invalid_paths.stderr
index 7bde37667be..7b7b25ce8d8 100644
--- a/tests/ui-internal/invalid_paths.stderr
+++ b/tests/ui-internal/invalid_paths.stderr
@@ -4,8 +4,11 @@ error: invalid path
 LL |     pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: `-D clippy::invalid-paths` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::invalid_paths)]`
+note: the lint level is defined here
+  --> tests/ui-internal/invalid_paths.rs:1:9
+   |
+LL | #![deny(clippy::invalid_paths)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
 
 error: invalid path
   --> tests/ui-internal/invalid_paths.rs:19:5
diff --git a/tests/ui-internal/lint_without_lint_pass.rs b/tests/ui-internal/lint_without_lint_pass.rs
index 69591523432..6b649132aca 100644
--- a/tests/ui-internal/lint_without_lint_pass.rs
+++ b/tests/ui-internal/lint_without_lint_pass.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::lint_without_lint_pass)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/lint_without_lint_pass.stderr b/tests/ui-internal/lint_without_lint_pass.stderr
index 9cca96ca160..3798293f4c1 100644
--- a/tests/ui-internal/lint_without_lint_pass.stderr
+++ b/tests/ui-internal/lint_without_lint_pass.stderr
@@ -13,9 +13,8 @@ LL | | }
 note: the lint level is defined here
   --> tests/ui-internal/lint_without_lint_pass.rs:1:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::lint_without_lint_pass)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::lint_without_lint_pass)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 1 previous error
diff --git a/tests/ui-internal/outer_expn_data.fixed b/tests/ui-internal/outer_expn_data.fixed
index cb7680b8bb1..900ca5b2ab9 100644
--- a/tests/ui-internal/outer_expn_data.fixed
+++ b/tests/ui-internal/outer_expn_data.fixed
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::outer_expn_expn_data)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/outer_expn_data.rs b/tests/ui-internal/outer_expn_data.rs
index 41d735110b5..bcfc42aa2ac 100644
--- a/tests/ui-internal/outer_expn_data.rs
+++ b/tests/ui-internal/outer_expn_data.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::internal)]
+#![deny(clippy::outer_expn_expn_data)]
 #![allow(clippy::missing_clippy_version_attribute)]
 #![feature(rustc_private)]
 
diff --git a/tests/ui-internal/outer_expn_data.stderr b/tests/ui-internal/outer_expn_data.stderr
index 33ac91e4fb0..b86138a5d45 100644
--- a/tests/ui-internal/outer_expn_data.stderr
+++ b/tests/ui-internal/outer_expn_data.stderr
@@ -7,9 +7,8 @@ LL |         let _ = expr.span.ctxt().outer_expn().expn_data();
 note: the lint level is defined here
   --> tests/ui-internal/outer_expn_data.rs:1:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::outer_expn_expn_data)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::outer_expn_expn_data)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui-internal/unnecessary_def_path.fixed b/tests/ui-internal/unnecessary_def_path.fixed
index 577fad9341b..89902ebe4e5 100644
--- a/tests/ui-internal/unnecessary_def_path.fixed
+++ b/tests/ui-internal/unnecessary_def_path.fixed
@@ -1,5 +1,5 @@
 //@aux-build:paths.rs
-#![deny(clippy::internal)]
+#![deny(clippy::unnecessary_def_path)]
 #![feature(rustc_private)]
 #![allow(clippy::unnecessary_map_or)]
 
diff --git a/tests/ui-internal/unnecessary_def_path.rs b/tests/ui-internal/unnecessary_def_path.rs
index d4deb3626d0..cfca15267c1 100644
--- a/tests/ui-internal/unnecessary_def_path.rs
+++ b/tests/ui-internal/unnecessary_def_path.rs
@@ -1,5 +1,5 @@
 //@aux-build:paths.rs
-#![deny(clippy::internal)]
+#![deny(clippy::unnecessary_def_path)]
 #![feature(rustc_private)]
 #![allow(clippy::unnecessary_map_or)]
 
diff --git a/tests/ui-internal/unnecessary_def_path.stderr b/tests/ui-internal/unnecessary_def_path.stderr
index 0053ba321bb..d7fb4ea551e 100644
--- a/tests/ui-internal/unnecessary_def_path.stderr
+++ b/tests/ui-internal/unnecessary_def_path.stderr
@@ -7,9 +7,8 @@ LL |     let _ = match_type(cx, ty, &OPTION);
 note: the lint level is defined here
   --> tests/ui-internal/unnecessary_def_path.rs:2:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::unnecessary_def_path)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::unnecessary_def_path)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: use of a def path to a diagnostic item
   --> tests/ui-internal/unnecessary_def_path.rs:39:13
diff --git a/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs b/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs
index 4801d76bd26..bd7a55114ac 100644
--- a/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs
+++ b/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs
@@ -1,6 +1,6 @@
 #![feature(rustc_private)]
 #![allow(unused)]
-#![warn(clippy::unnecessary_def_path)]
+#![deny(clippy::unnecessary_def_path)]
 
 extern crate rustc_hir;
 
diff --git a/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr b/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr
index ff4726de69a..c49abc516f5 100644
--- a/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr
+++ b/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr
@@ -5,8 +5,11 @@ LL |     const DEREF_TRAIT: [&str; 4] = ["core", "ops", "deref", "Deref"];
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: convert all references to use `sym::Deref`
-   = note: `-D clippy::unnecessary-def-path` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_def_path)]`
+note: the lint level is defined here
+  --> tests/ui-internal/unnecessary_def_path_hardcoded_path.rs:3:9
+   |
+LL | #![deny(clippy::unnecessary_def_path)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: hardcoded path to a language item
   --> tests/ui-internal/unnecessary_def_path_hardcoded_path.rs:12:40
diff --git a/tests/ui-internal/unnecessary_symbol_str.fixed b/tests/ui-internal/unnecessary_symbol_str.fixed
index dc564daef82..c81554b0235 100644
--- a/tests/ui-internal/unnecessary_symbol_str.fixed
+++ b/tests/ui-internal/unnecessary_symbol_str.fixed
@@ -1,5 +1,5 @@
 #![feature(rustc_private)]
-#![deny(clippy::internal)]
+#![deny(clippy::unnecessary_symbol_str)]
 #![allow(
     clippy::slow_symbol_comparisons,
     clippy::borrow_deref_ref,
diff --git a/tests/ui-internal/unnecessary_symbol_str.rs b/tests/ui-internal/unnecessary_symbol_str.rs
index d74262d1294..8d773cd738f 100644
--- a/tests/ui-internal/unnecessary_symbol_str.rs
+++ b/tests/ui-internal/unnecessary_symbol_str.rs
@@ -1,5 +1,5 @@
 #![feature(rustc_private)]
-#![deny(clippy::internal)]
+#![deny(clippy::unnecessary_symbol_str)]
 #![allow(
     clippy::slow_symbol_comparisons,
     clippy::borrow_deref_ref,
diff --git a/tests/ui-internal/unnecessary_symbol_str.stderr b/tests/ui-internal/unnecessary_symbol_str.stderr
index 517a395e93f..81918303a73 100644
--- a/tests/ui-internal/unnecessary_symbol_str.stderr
+++ b/tests/ui-internal/unnecessary_symbol_str.stderr
@@ -7,9 +7,8 @@ LL |     Symbol::intern("foo").as_str() == "clippy";
 note: the lint level is defined here
   --> tests/ui-internal/unnecessary_symbol_str.rs:2:9
    |
-LL | #![deny(clippy::internal)]
-   |         ^^^^^^^^^^^^^^^^
-   = note: `#[deny(clippy::unnecessary_symbol_str)]` implied by `#[deny(clippy::internal)]`
+LL | #![deny(clippy::unnecessary_symbol_str)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: unnecessary `Symbol` to string conversion
   --> tests/ui-internal/unnecessary_symbol_str.rs:18:5