From e26e3e10952214096b3a1c6731717d58fd6641c4 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Sun, 13 Feb 2022 18:08:54 +0100 Subject: [PATCH 1/9] Add check to enable nightly lints in Clippy --- clippy_lints/src/lib.rs | 1 + clippy_utils/src/lib.rs | 1 + clippy_utils/src/nightly.rs | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 clippy_utils/src/nightly.rs diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index e78f61873593..9af960333ff7 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -462,6 +462,7 @@ pub fn read_conf(sess: &Session) -> Conf { /// Used in `./src/driver.rs`. #[allow(clippy::too_many_lines)] pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) { + clippy_utils::nightly::eval_is_nightly_run(sess); register_removed_non_tool_lints(store); include!("lib.deprecated.rs"); diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 73d91550693d..8d084b688aae 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -45,6 +45,7 @@ pub mod higher; mod hir_utils; pub mod macros; pub mod msrvs; +pub mod nightly; pub mod numeric_literal; pub mod paths; pub mod ptr; diff --git a/clippy_utils/src/nightly.rs b/clippy_utils/src/nightly.rs new file mode 100644 index 000000000000..6515b33c7eb9 --- /dev/null +++ b/clippy_utils/src/nightly.rs @@ -0,0 +1,34 @@ +//! This module is intended to hold most implementations related to Clippy's +//! nightly lints. + +use std::lazy::SyncOnceCell; + +use rustc_session::Session; + +static IS_NIGHTLY_RUN: SyncOnceCell = SyncOnceCell::new(); + +/// This function is used to determine if nightly lints should be enabled or disabled +/// in this Clippy run. +/// +/// It's only allowed to call this once. This is done by [`clippy_lints::lib`] +pub fn eval_is_nightly_run(sess: &Session) { + // This allows users to disable nightly lints on nightly + let disable_nightly = std::env::var("CLIPPY_NIGHTLY").map(|s| s == "0").unwrap_or(false); + // This allows users to enable nightly lints on stable + let enable_nightly = std::env::var("CLIPPY_NIGHTLY").map(|s| s == "1").unwrap_or(false); + + let is_nightly_run = enable_nightly || (sess.is_nightly_build() && !disable_nightly); + + IS_NIGHTLY_RUN + .set(is_nightly_run) + .expect("`ENABLE_NIGHTLY_LINTS` should only be set once."); +} + +/// This function checks if the current run is a nightly run with Clippy's nightly lints. This is +/// destinct from rustc's as a nightly build can disable Clippy's nightly features. +/// +/// See [`Session::is_nightly_build(&self)`] if you want to check if the current build is a nightly build. +#[inline] +pub fn is_nightly_run() -> bool { + *IS_NIGHTLY_RUN.get().unwrap_or(&false) +} From c7363053a2f9bc5ef055440a761b04d650b7aa0b Mon Sep 17 00:00:00 2001 From: xFrednet Date: Tue, 15 Feb 2022 00:25:27 +0100 Subject: [PATCH 2/9] Update `update_lints` to support nightly lints --- clippy_dev/src/update_lints.rs | 143 ++++++++++++++++++++++++--------- clippy_lints/src/lib.rs | 1 + clippy_utils/src/nightly.rs | 5 +- 3 files changed, 107 insertions(+), 42 deletions(-) diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs index d368ef1f46a2..eca7487358ac 100644 --- a/clippy_dev/src/update_lints.rs +++ b/clippy_dev/src/update_lints.rs @@ -18,7 +18,7 @@ static DEC_CLIPPY_LINT_RE: SyncLazy = SyncLazy::new(|| { r#"(?x) declare_clippy_lint!\s*[\{(] (?:\s+///.*)* - (?:\s*\#\[clippy::version\s*=\s*"[^"]*"\])? + (?:\s*\#\[clippy::version\s*=\s*"(?P[^"]*)"\])? \s+pub\s+(?P[A-Z_][A-Z_0-9]*)\s*,\s* (?P[a-z_]+)\s*,\s* "(?P(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})] @@ -32,7 +32,7 @@ static DEC_DEPRECATED_LINT_RE: SyncLazy = SyncLazy::new(|| { r#"(?x) declare_deprecated_lint!\s*[{(]\s* (?:\s+///.*)* - (?:\s*\#\[clippy::version\s*=\s*"[^"]*"\])? + (?:\s*\#\[clippy::version\s*=\s*"(?P[^"]*)"\])? \s+pub\s+(?P[A-Z_][A-Z_0-9]*)\s*,\s* "(?P(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})] "#, @@ -200,17 +200,26 @@ struct Lint { desc: String, deprecation: Option, module: String, + version: Option, } impl Lint { #[must_use] - fn new(name: &str, group: &str, desc: &str, deprecation: Option<&str>, module: &str) -> Self { + fn new( + name: &str, + group: &str, + desc: &str, + deprecation: Option<&str>, + module: &str, + version: Option<&str>, + ) -> Self { Self { name: name.to_lowercase(), group: group.to_string(), desc: NL_ESCAPE_RE.replace(&desc.replace("\\\"", "\""), "").to_string(), deprecation: deprecation.map(ToString::to_string), module: module.to_string(), + version: version.map(str::to_string), } } @@ -245,19 +254,26 @@ impl Lint { /// Generates the code for registering a group fn gen_lint_group_list<'a>(group_name: &str, lints: impl Iterator) -> String { - let mut details: Vec<_> = lints.map(|l| (&l.module, l.name.to_uppercase())).collect(); + let mut details: Vec<_> = lints.map(|l| (&l.module, l.name.to_uppercase(), &l.version)).collect(); details.sort_unstable(); let mut output = GENERATED_FILE_COMMENT.to_string(); output.push_str(&format!( - "store.register_group(true, \"clippy::{0}\", Some(\"clippy_{0}\"), vec![\n", + "store.register_group(true, \"clippy::{0}\", Some(\"clippy_{0}\"), [\n", group_name )); - for (module, name) in details { - output.push_str(&format!(" LintId::of({}::{}),\n", module, name)); + for (module, name, version) in details { + if version.as_ref().map_or(false, |v| v == "nightly") { + output.push_str(&format!( + " clippy_utils::nightly::is_nightly_run().then_some(LintId::of({}::{})),\n", + module, name + )); + } else { + output.push_str(&format!(" Some(LintId::of({}::{})),\n", module, name)); + } } - output.push_str("])\n"); + output.push_str("].iter().copied().flatten().collect::>())\n"); output } @@ -359,12 +375,26 @@ fn gather_from_file(dir_entry: &walkdir::DirEntry) -> impl Iterator } fn parse_contents(content: &str, module: &str) -> impl Iterator { - let lints = DEC_CLIPPY_LINT_RE - .captures_iter(content) - .map(|m| Lint::new(&m["name"], &m["cat"], &m["desc"], None, module)); - let deprecated = DEC_DEPRECATED_LINT_RE - .captures_iter(content) - .map(|m| Lint::new(&m["name"], "Deprecated", &m["desc"], Some(&m["desc"]), module)); + let lints = DEC_CLIPPY_LINT_RE.captures_iter(content).map(|m| { + Lint::new( + &m["name"], + &m["cat"], + &m["desc"], + None, + module, + m.name("version").map(|v| v.as_str()), + ) + }); + let deprecated = DEC_DEPRECATED_LINT_RE.captures_iter(content).map(|m| { + Lint::new( + &m["name"], + "Deprecated", + &m["desc"], + Some(&m["desc"]), + module, + m.name("version").map(|v| v.as_str()), + ) + }); // Removing the `.collect::>().into_iter()` causes some lifetime issues due to the map lints.chain(deprecated).collect::>().into_iter() } @@ -505,7 +535,6 @@ declare_clippy_lint! { } declare_clippy_lint!{ - #[clippy::version = "Test version"] pub DOC_MARKDOWN, pedantic, "single line" @@ -523,14 +552,22 @@ declare_deprecated_lint! { .collect(); let expected = vec![ - Lint::new("ptr_arg", "style", "really long text", None, "module_name"), - Lint::new("doc_markdown", "pedantic", "single line", None, "module_name"), + Lint::new( + "ptr_arg", + "style", + "really long text", + None, + "module_name", + Some("Hello Clippy!"), + ), + Lint::new("doc_markdown", "pedantic", "single line", None, "module_name", None), Lint::new( "should_assert_eq", "Deprecated", "`assert!()` will be more flexible with RFC 2011", Some("`assert!()` will be more flexible with RFC 2011"), "module_name", + Some("I'm a version"), ), ]; assert_eq!(expected, result); @@ -580,10 +617,17 @@ mod tests { #[test] fn test_usable_lints() { let lints = vec![ - Lint::new("should_assert_eq", "Deprecated", "abc", Some("Reason"), "module_name"), - Lint::new("should_assert_eq2", "Not Deprecated", "abc", None, "module_name"), - Lint::new("should_assert_eq2", "internal", "abc", None, "module_name"), - Lint::new("should_assert_eq2", "internal_style", "abc", None, "module_name"), + Lint::new( + "should_assert_eq", + "Deprecated", + "abc", + Some("Reason"), + "module_name", + None, + ), + Lint::new("should_assert_eq2", "Not Deprecated", "abc", None, "module_name", None), + Lint::new("should_assert_eq2", "internal", "abc", None, "module_name", None), + Lint::new("should_assert_eq2", "internal_style", "abc", None, "module_name", None), ]; let expected = vec![Lint::new( "should_assert_eq2", @@ -591,6 +635,7 @@ mod tests { "abc", None, "module_name", + None, )]; assert_eq!(expected, Lint::usable_lints(&lints)); } @@ -598,21 +643,28 @@ mod tests { #[test] fn test_by_lint_group() { let lints = vec![ - Lint::new("should_assert_eq", "group1", "abc", None, "module_name"), - Lint::new("should_assert_eq2", "group2", "abc", None, "module_name"), - Lint::new("incorrect_match", "group1", "abc", None, "module_name"), + Lint::new("should_assert_eq", "group1", "abc", None, "module_name", None), + Lint::new("should_assert_eq2", "group2", "abc", None, "module_name", None), + Lint::new("incorrect_match", "group1", "abc", None, "module_name", None), ]; let mut expected: HashMap> = HashMap::new(); expected.insert( "group1".to_string(), vec![ - Lint::new("should_assert_eq", "group1", "abc", None, "module_name"), - Lint::new("incorrect_match", "group1", "abc", None, "module_name"), + Lint::new("should_assert_eq", "group1", "abc", None, "module_name", None), + Lint::new("incorrect_match", "group1", "abc", None, "module_name", None), ], ); expected.insert( "group2".to_string(), - vec![Lint::new("should_assert_eq2", "group2", "abc", None, "module_name")], + vec![Lint::new( + "should_assert_eq2", + "group2", + "abc", + None, + "module_name", + None, + )], ); assert_eq!(expected, Lint::by_lint_group(lints.into_iter())); } @@ -620,8 +672,8 @@ mod tests { #[test] fn test_gen_changelog_lint_list() { let lints = vec![ - Lint::new("should_assert_eq", "group1", "abc", None, "module_name"), - Lint::new("should_assert_eq2", "group2", "abc", None, "module_name"), + Lint::new("should_assert_eq", "group1", "abc", None, "module_name", None), + Lint::new("should_assert_eq2", "group2", "abc", None, "module_name", None), ]; let expected = vec![ format!("[`should_assert_eq`]: {}#should_assert_eq", DOCS_LINK), @@ -639,6 +691,7 @@ mod tests { "abc", Some("has been superseded by should_assert_eq2"), "module_name", + None, ), Lint::new( "another_deprecated", @@ -646,6 +699,7 @@ mod tests { "abc", Some("will be removed"), "module_name", + None, ), ]; @@ -671,15 +725,22 @@ mod tests { #[test] #[should_panic] fn test_gen_deprecated_fail() { - let lints = vec![Lint::new("should_assert_eq2", "group2", "abc", None, "module_name")]; + let lints = vec![Lint::new( + "should_assert_eq2", + "group2", + "abc", + None, + "module_name", + None, + )]; let _deprecated_lints = gen_deprecated(lints.iter()); } #[test] fn test_gen_modules_list() { let lints = vec![ - Lint::new("should_assert_eq", "group1", "abc", None, "module_name"), - Lint::new("incorrect_stuff", "group3", "abc", None, "another_module"), + Lint::new("should_assert_eq", "group1", "abc", None, "module_name", None), + Lint::new("incorrect_stuff", "group3", "abc", None, "another_module", None), ]; let expected = vec!["mod another_module;".to_string(), "mod module_name;".to_string()]; assert_eq!(expected, gen_modules_list(lints.iter())); @@ -688,17 +749,19 @@ mod tests { #[test] fn test_gen_lint_group_list() { let lints = vec![ - Lint::new("abc", "group1", "abc", None, "module_name"), - Lint::new("should_assert_eq", "group1", "abc", None, "module_name"), - Lint::new("internal", "internal_style", "abc", None, "module_name"), + Lint::new("abc", "group1", "abc", None, "module_name", Some("1.0.1")), + Lint::new("should_assert_eq", "group1", "abc", None, "module_name", Some("1.60.0")), + Lint::new("internal", "internal_style", "abc", None, "module_name", None), + Lint::new("nightly_lint", "nightly", "abc", None, "module_name", Some("nightly")), ]; let expected = GENERATED_FILE_COMMENT.to_string() + &[ - "store.register_group(true, \"clippy::group1\", Some(\"clippy_group1\"), vec![", - " LintId::of(module_name::ABC),", - " LintId::of(module_name::INTERNAL),", - " LintId::of(module_name::SHOULD_ASSERT_EQ),", - "])", + "store.register_group(true, \"clippy::group1\", Some(\"clippy_group1\"), [", + " Some(LintId::of(module_name::ABC)),", + " Some(LintId::of(module_name::INTERNAL)),", + " clippy_utils::nightly::is_nightly_run().then_some(LintId::of(module_name::NIGHTLY_LINT)),", + " Some(LintId::of(module_name::SHOULD_ASSERT_EQ)),", + "].iter().copied().flatten().collect::>())", ] .join("\n") + "\n"; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 9af960333ff7..f2661a82c0d2 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1,6 +1,7 @@ // error-pattern:cargo-clippy #![feature(binary_heap_into_iter_sorted)] +#![feature(bool_to_option)] #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(drain_filter)] diff --git a/clippy_utils/src/nightly.rs b/clippy_utils/src/nightly.rs index 6515b33c7eb9..b5a4dbcc8b69 100644 --- a/clippy_utils/src/nightly.rs +++ b/clippy_utils/src/nightly.rs @@ -26,8 +26,9 @@ pub fn eval_is_nightly_run(sess: &Session) { /// This function checks if the current run is a nightly run with Clippy's nightly lints. This is /// destinct from rustc's as a nightly build can disable Clippy's nightly features. -/// -/// See [`Session::is_nightly_build(&self)`] if you want to check if the current build is a nightly build. +/// +/// See [`Session::is_nightly_build(&self)`] if you want to check if the current build is a nightly +/// build. #[inline] pub fn is_nightly_run() -> bool { *IS_NIGHTLY_RUN.get().unwrap_or(&false) From 1462930def3cd329a33b65ceba259aa8e7af4c95 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Tue, 15 Feb 2022 00:26:42 +0100 Subject: [PATCH 3/9] Run `cargo dev update_lints` --- clippy_lints/src/lib.register_all.rs | 626 +++++++++---------- clippy_lints/src/lib.register_cargo.rs | 14 +- clippy_lints/src/lib.register_complexity.rs | 184 +++--- clippy_lints/src/lib.register_correctness.rs | 144 ++--- clippy_lints/src/lib.register_internal.rs | 32 +- clippy_lints/src/lib.register_nursery.rs | 54 +- clippy_lints/src/lib.register_pedantic.rs | 194 +++--- clippy_lints/src/lib.register_perf.rs | 52 +- clippy_lints/src/lib.register_restriction.rs | 138 ++-- clippy_lints/src/lib.register_style.rs | 228 +++---- clippy_lints/src/lib.register_suspicious.rs | 34 +- 11 files changed, 850 insertions(+), 850 deletions(-) diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs index d93e34e76b49..e45f25eab0e8 100644 --- a/clippy_lints/src/lib.register_all.rs +++ b/clippy_lints/src/lib.register_all.rs @@ -2,316 +2,316 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::all", Some("clippy_all"), vec![ - LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS), - LintId::of(approx_const::APPROX_CONSTANT), - LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS), - LintId::of(assign_ops::ASSIGN_OP_PATTERN), - LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP), - LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC), - LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS), - LintId::of(attrs::DEPRECATED_CFG_ATTR), - LintId::of(attrs::DEPRECATED_SEMVER), - LintId::of(attrs::MISMATCHED_TARGET_OS), - LintId::of(attrs::USELESS_ATTRIBUTE), - LintId::of(bit_mask::BAD_BIT_MASK), - LintId::of(bit_mask::INEFFECTIVE_BIT_MASK), - LintId::of(blacklisted_name::BLACKLISTED_NAME), - LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS), - LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON), - LintId::of(booleans::LOGIC_BUG), - LintId::of(booleans::NONMINIMAL_BOOL), - LintId::of(casts::CAST_REF_TO_MUT), - LintId::of(casts::CHAR_LIT_AS_U8), - LintId::of(casts::FN_TO_NUMERIC_CAST), - LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION), - LintId::of(casts::UNNECESSARY_CAST), - LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF), - LintId::of(collapsible_if::COLLAPSIBLE_IF), - LintId::of(collapsible_match::COLLAPSIBLE_MATCH), - LintId::of(comparison_chain::COMPARISON_CHAIN), - LintId::of(copies::IFS_SAME_COND), - LintId::of(copies::IF_SAME_THEN_ELSE), - LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT), - LintId::of(dereference::NEEDLESS_BORROW), - LintId::of(derivable_impls::DERIVABLE_IMPLS), - LintId::of(derive::DERIVE_HASH_XOR_EQ), - LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD), - LintId::of(disallowed_methods::DISALLOWED_METHODS), - LintId::of(disallowed_types::DISALLOWED_TYPES), - LintId::of(doc::MISSING_SAFETY_DOC), - LintId::of(doc::NEEDLESS_DOCTEST_MAIN), - LintId::of(double_comparison::DOUBLE_COMPARISONS), - LintId::of(double_parens::DOUBLE_PARENS), - LintId::of(drop_forget_ref::DROP_COPY), - LintId::of(drop_forget_ref::DROP_REF), - LintId::of(drop_forget_ref::FORGET_COPY), - LintId::of(drop_forget_ref::FORGET_REF), - LintId::of(duration_subsec::DURATION_SUBSEC), - LintId::of(entry::MAP_ENTRY), - LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT), - LintId::of(enum_variants::ENUM_VARIANT_NAMES), - LintId::of(enum_variants::MODULE_INCEPTION), - LintId::of(eq_op::EQ_OP), - LintId::of(eq_op::OP_REF), - LintId::of(erasing_op::ERASING_OP), - LintId::of(escape::BOXED_LOCAL), - LintId::of(eta_reduction::REDUNDANT_CLOSURE), - LintId::of(eval_order_dependence::DIVERGING_SUB_EXPRESSION), - LintId::of(eval_order_dependence::EVAL_ORDER_DEPENDENCE), - LintId::of(explicit_write::EXPLICIT_WRITE), - LintId::of(float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS), - LintId::of(float_literal::EXCESSIVE_PRECISION), - LintId::of(format::USELESS_FORMAT), - LintId::of(format_args::FORMAT_IN_FORMAT_ARGS), - LintId::of(format_args::TO_STRING_IN_FORMAT_ARGS), - LintId::of(formatting::POSSIBLE_MISSING_COMMA), - LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING), - LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING), - LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING), - LintId::of(from_over_into::FROM_OVER_INTO), - LintId::of(from_str_radix_10::FROM_STR_RADIX_10), - LintId::of(functions::DOUBLE_MUST_USE), - LintId::of(functions::MUST_USE_UNIT), - LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF), - LintId::of(functions::RESULT_UNIT_ERR), - LintId::of(functions::TOO_MANY_ARGUMENTS), - LintId::of(get_last_with_len::GET_LAST_WITH_LEN), - LintId::of(identity_op::IDENTITY_OP), - LintId::of(if_let_mutex::IF_LET_MUTEX), - LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING), - LintId::of(infinite_iter::INFINITE_ITER), - LintId::of(inherent_to_string::INHERENT_TO_STRING), - LintId::of(inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY), - LintId::of(init_numbered_fields::INIT_NUMBERED_FIELDS), - LintId::of(inline_fn_without_body::INLINE_FN_WITHOUT_BODY), - LintId::of(int_plus_one::INT_PLUS_ONE), - LintId::of(large_const_arrays::LARGE_CONST_ARRAYS), - LintId::of(large_enum_variant::LARGE_ENUM_VARIANT), - LintId::of(len_zero::COMPARISON_TO_EMPTY), - LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY), - LintId::of(len_zero::LEN_ZERO), - LintId::of(let_underscore::LET_UNDERSCORE_LOCK), - LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES), - LintId::of(lifetimes::NEEDLESS_LIFETIMES), - LintId::of(literal_representation::INCONSISTENT_DIGIT_GROUPING), - LintId::of(literal_representation::MISTYPED_LITERAL_SUFFIXES), - LintId::of(literal_representation::UNUSUAL_BYTE_GROUPINGS), - LintId::of(loops::EMPTY_LOOP), - LintId::of(loops::EXPLICIT_COUNTER_LOOP), - LintId::of(loops::FOR_KV_MAP), - LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES), - LintId::of(loops::ITER_NEXT_LOOP), - LintId::of(loops::MANUAL_FLATTEN), - LintId::of(loops::MANUAL_MEMCPY), - LintId::of(loops::MUT_RANGE_BOUND), - LintId::of(loops::NEEDLESS_COLLECT), - LintId::of(loops::NEEDLESS_RANGE_LOOP), - LintId::of(loops::NEVER_LOOP), - LintId::of(loops::SAME_ITEM_PUSH), - LintId::of(loops::SINGLE_ELEMENT_LOOP), - LintId::of(loops::WHILE_IMMUTABLE_CONDITION), - LintId::of(loops::WHILE_LET_LOOP), - LintId::of(loops::WHILE_LET_ON_ITERATOR), - LintId::of(main_recursion::MAIN_RECURSION), - LintId::of(manual_async_fn::MANUAL_ASYNC_FN), - LintId::of(manual_bits::MANUAL_BITS), - LintId::of(manual_map::MANUAL_MAP), - LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE), - LintId::of(manual_strip::MANUAL_STRIP), - LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR), - LintId::of(map_clone::MAP_CLONE), - LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN), - LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN), - LintId::of(match_result_ok::MATCH_RESULT_OK), - LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH), - LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH), - LintId::of(matches::MATCH_AS_REF), - LintId::of(matches::MATCH_LIKE_MATCHES_MACRO), - LintId::of(matches::MATCH_OVERLAPPING_ARM), - LintId::of(matches::MATCH_REF_PATS), - LintId::of(matches::MATCH_SINGLE_BINDING), - LintId::of(matches::REDUNDANT_PATTERN_MATCHING), - LintId::of(matches::SINGLE_MATCH), - LintId::of(matches::WILDCARD_IN_OR_PATTERNS), - LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE), - LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT), - LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT), - LintId::of(methods::BIND_INSTEAD_OF_MAP), - LintId::of(methods::BYTES_NTH), - LintId::of(methods::CHARS_LAST_CMP), - LintId::of(methods::CHARS_NEXT_CMP), - LintId::of(methods::CLONE_DOUBLE_REF), - LintId::of(methods::CLONE_ON_COPY), - LintId::of(methods::EXPECT_FUN_CALL), - LintId::of(methods::EXTEND_WITH_DRAIN), - LintId::of(methods::FILTER_MAP_IDENTITY), - LintId::of(methods::FILTER_NEXT), - LintId::of(methods::FLAT_MAP_IDENTITY), - LintId::of(methods::INSPECT_FOR_EACH), - LintId::of(methods::INTO_ITER_ON_REF), - LintId::of(methods::ITERATOR_STEP_BY_ZERO), - LintId::of(methods::ITER_CLONED_COLLECT), - LintId::of(methods::ITER_COUNT), - LintId::of(methods::ITER_NEXT_SLICE), - LintId::of(methods::ITER_NTH), - LintId::of(methods::ITER_NTH_ZERO), - LintId::of(methods::ITER_OVEREAGER_CLONED), - LintId::of(methods::ITER_SKIP_NEXT), - LintId::of(methods::MANUAL_FILTER_MAP), - LintId::of(methods::MANUAL_FIND_MAP), - LintId::of(methods::MANUAL_SATURATING_ARITHMETIC), - LintId::of(methods::MANUAL_SPLIT_ONCE), - LintId::of(methods::MANUAL_STR_REPEAT), - LintId::of(methods::MAP_COLLECT_RESULT_UNIT), - LintId::of(methods::MAP_FLATTEN), - LintId::of(methods::MAP_IDENTITY), - LintId::of(methods::NEEDLESS_SPLITN), - LintId::of(methods::NEW_RET_NO_SELF), - LintId::of(methods::OK_EXPECT), - LintId::of(methods::OPTION_AS_REF_DEREF), - LintId::of(methods::OPTION_FILTER_MAP), - LintId::of(methods::OPTION_MAP_OR_NONE), - LintId::of(methods::OR_FUN_CALL), - LintId::of(methods::RESULT_MAP_OR_INTO_OPTION), - LintId::of(methods::SEARCH_IS_SOME), - LintId::of(methods::SHOULD_IMPLEMENT_TRAIT), - LintId::of(methods::SINGLE_CHAR_ADD_STR), - LintId::of(methods::SINGLE_CHAR_PATTERN), - LintId::of(methods::SKIP_WHILE_NEXT), - LintId::of(methods::STRING_EXTEND_CHARS), - LintId::of(methods::SUSPICIOUS_MAP), - LintId::of(methods::SUSPICIOUS_SPLITN), - LintId::of(methods::UNINIT_ASSUMED_INIT), - LintId::of(methods::UNNECESSARY_FILTER_MAP), - LintId::of(methods::UNNECESSARY_FOLD), - LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS), - LintId::of(methods::UNNECESSARY_TO_OWNED), - LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT), - LintId::of(methods::USELESS_ASREF), - LintId::of(methods::WRONG_SELF_CONVENTION), - LintId::of(methods::ZST_OFFSET), - LintId::of(minmax::MIN_MAX), - LintId::of(misc::CMP_NAN), - LintId::of(misc::CMP_OWNED), - LintId::of(misc::MODULO_ONE), - LintId::of(misc::SHORT_CIRCUIT_STATEMENT), - LintId::of(misc::TOPLEVEL_REF_ARG), - LintId::of(misc::ZERO_PTR), - LintId::of(misc_early::BUILTIN_TYPE_SHADOW), - LintId::of(misc_early::DOUBLE_NEG), - LintId::of(misc_early::DUPLICATE_UNDERSCORE_ARGUMENT), - LintId::of(misc_early::MIXED_CASE_HEX_LITERALS), - LintId::of(misc_early::REDUNDANT_PATTERN), - LintId::of(misc_early::UNNEEDED_WILDCARD_PATTERN), - LintId::of(misc_early::ZERO_PREFIXED_LITERAL), - LintId::of(mut_key::MUTABLE_KEY_TYPE), - LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK), - LintId::of(mut_reference::UNNECESSARY_MUT_PASSED), - LintId::of(needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE), - LintId::of(needless_bool::BOOL_COMPARISON), - LintId::of(needless_bool::NEEDLESS_BOOL), - LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE), - LintId::of(needless_late_init::NEEDLESS_LATE_INIT), - LintId::of(needless_option_as_deref::NEEDLESS_OPTION_AS_DEREF), - LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK), - LintId::of(needless_update::NEEDLESS_UPDATE), - LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD), - LintId::of(neg_multiply::NEG_MULTIPLY), - LintId::of(new_without_default::NEW_WITHOUT_DEFAULT), - LintId::of(no_effect::NO_EFFECT), - LintId::of(no_effect::UNNECESSARY_OPERATION), - LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST), - LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST), - LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS), - LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS), - LintId::of(octal_escapes::OCTAL_ESCAPES), - LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS), - LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP), - LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL), - LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL), - LintId::of(precedence::PRECEDENCE), - LintId::of(ptr::CMP_NULL), - LintId::of(ptr::INVALID_NULL_PTR_USAGE), - LintId::of(ptr::MUT_FROM_REF), - LintId::of(ptr::PTR_ARG), - LintId::of(ptr_eq::PTR_EQ), - LintId::of(ptr_offset_with_cast::PTR_OFFSET_WITH_CAST), - LintId::of(question_mark::QUESTION_MARK), - LintId::of(ranges::MANUAL_RANGE_CONTAINS), - LintId::of(ranges::RANGE_ZIP_WITH_LEN), - LintId::of(ranges::REVERSED_EMPTY_RANGES), - LintId::of(redundant_clone::REDUNDANT_CLONE), - LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL), - LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES), - LintId::of(redundant_slicing::REDUNDANT_SLICING), - LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES), - LintId::of(reference::DEREF_ADDROF), - LintId::of(regex::INVALID_REGEX), - LintId::of(repeat_once::REPEAT_ONCE), - LintId::of(returns::LET_AND_RETURN), - LintId::of(returns::NEEDLESS_RETURN), - LintId::of(self_assignment::SELF_ASSIGNMENT), - LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS), - LintId::of(serde_api::SERDE_API_MISUSE), - LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS), - LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT), - LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION), - LintId::of(stable_sort_primitive::STABLE_SORT_PRIMITIVE), - LintId::of(strings::STRING_FROM_UTF8_AS_BYTES), - LintId::of(strlen_on_c_strings::STRLEN_ON_C_STRINGS), - LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL), - LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL), - LintId::of(swap::ALMOST_SWAPPED), - LintId::of(swap::MANUAL_SWAP), - LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS), - LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT), - LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME), - LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY), - LintId::of(transmute::CROSSPOINTER_TRANSMUTE), - LintId::of(transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS), - LintId::of(transmute::TRANSMUTE_BYTES_TO_STR), - LintId::of(transmute::TRANSMUTE_FLOAT_TO_INT), - LintId::of(transmute::TRANSMUTE_INT_TO_BOOL), - LintId::of(transmute::TRANSMUTE_INT_TO_CHAR), - LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT), - LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES), - LintId::of(transmute::TRANSMUTE_PTR_TO_REF), - LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR), - LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE), - LintId::of(transmute::WRONG_TRANSMUTE), - LintId::of(transmuting_null::TRANSMUTING_NULL), - LintId::of(try_err::TRY_ERR), - LintId::of(types::BORROWED_BOX), - LintId::of(types::BOX_COLLECTION), - LintId::of(types::REDUNDANT_ALLOCATION), - LintId::of(types::TYPE_COMPLEXITY), - LintId::of(types::VEC_BOX), - LintId::of(undropped_manually_drops::UNDROPPED_MANUALLY_DROPS), - LintId::of(unicode::INVISIBLE_CHARACTERS), - LintId::of(uninit_vec::UNINIT_VEC), - LintId::of(unit_hash::UNIT_HASH), - LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD), - LintId::of(unit_types::UNIT_ARG), - LintId::of(unit_types::UNIT_CMP), - LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS), - LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS), - LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY), - LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME), - LintId::of(unused_io_amount::UNUSED_IO_AMOUNT), - LintId::of(unused_unit::UNUSED_UNIT), - LintId::of(unwrap::PANICKING_UNWRAP), - LintId::of(unwrap::UNNECESSARY_UNWRAP), - LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS), - LintId::of(useless_conversion::USELESS_CONVERSION), - LintId::of(vec::USELESS_VEC), - LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH), - LintId::of(vec_resize_to_zero::VEC_RESIZE_TO_ZERO), - LintId::of(write::PRINTLN_EMPTY_STRING), - LintId::of(write::PRINT_LITERAL), - LintId::of(write::PRINT_WITH_NEWLINE), - LintId::of(write::WRITELN_EMPTY_STRING), - LintId::of(write::WRITE_LITERAL), - LintId::of(write::WRITE_WITH_NEWLINE), - LintId::of(zero_div_zero::ZERO_DIVIDED_BY_ZERO), -]) +store.register_group(true, "clippy::all", Some("clippy_all"), [ + Some(LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS)), + Some(LintId::of(approx_const::APPROX_CONSTANT)), + Some(LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS)), + Some(LintId::of(assign_ops::ASSIGN_OP_PATTERN)), + Some(LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP)), + Some(LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC)), + Some(LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS)), + Some(LintId::of(attrs::DEPRECATED_CFG_ATTR)), + Some(LintId::of(attrs::DEPRECATED_SEMVER)), + Some(LintId::of(attrs::MISMATCHED_TARGET_OS)), + Some(LintId::of(attrs::USELESS_ATTRIBUTE)), + Some(LintId::of(bit_mask::BAD_BIT_MASK)), + Some(LintId::of(bit_mask::INEFFECTIVE_BIT_MASK)), + Some(LintId::of(blacklisted_name::BLACKLISTED_NAME)), + Some(LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS)), + Some(LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON)), + Some(LintId::of(booleans::LOGIC_BUG)), + Some(LintId::of(booleans::NONMINIMAL_BOOL)), + Some(LintId::of(casts::CAST_REF_TO_MUT)), + Some(LintId::of(casts::CHAR_LIT_AS_U8)), + Some(LintId::of(casts::FN_TO_NUMERIC_CAST)), + Some(LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION)), + Some(LintId::of(casts::UNNECESSARY_CAST)), + Some(LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF)), + Some(LintId::of(collapsible_if::COLLAPSIBLE_IF)), + Some(LintId::of(collapsible_match::COLLAPSIBLE_MATCH)), + Some(LintId::of(comparison_chain::COMPARISON_CHAIN)), + Some(LintId::of(copies::IFS_SAME_COND)), + Some(LintId::of(copies::IF_SAME_THEN_ELSE)), + Some(LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT)), + Some(LintId::of(dereference::NEEDLESS_BORROW)), + Some(LintId::of(derivable_impls::DERIVABLE_IMPLS)), + Some(LintId::of(derive::DERIVE_HASH_XOR_EQ)), + Some(LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD)), + Some(LintId::of(disallowed_methods::DISALLOWED_METHODS)), + Some(LintId::of(disallowed_types::DISALLOWED_TYPES)), + Some(LintId::of(doc::MISSING_SAFETY_DOC)), + Some(LintId::of(doc::NEEDLESS_DOCTEST_MAIN)), + Some(LintId::of(double_comparison::DOUBLE_COMPARISONS)), + Some(LintId::of(double_parens::DOUBLE_PARENS)), + Some(LintId::of(drop_forget_ref::DROP_COPY)), + Some(LintId::of(drop_forget_ref::DROP_REF)), + Some(LintId::of(drop_forget_ref::FORGET_COPY)), + Some(LintId::of(drop_forget_ref::FORGET_REF)), + Some(LintId::of(duration_subsec::DURATION_SUBSEC)), + Some(LintId::of(entry::MAP_ENTRY)), + Some(LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT)), + Some(LintId::of(enum_variants::ENUM_VARIANT_NAMES)), + Some(LintId::of(enum_variants::MODULE_INCEPTION)), + Some(LintId::of(eq_op::EQ_OP)), + Some(LintId::of(eq_op::OP_REF)), + Some(LintId::of(erasing_op::ERASING_OP)), + Some(LintId::of(escape::BOXED_LOCAL)), + Some(LintId::of(eta_reduction::REDUNDANT_CLOSURE)), + Some(LintId::of(eval_order_dependence::DIVERGING_SUB_EXPRESSION)), + Some(LintId::of(eval_order_dependence::EVAL_ORDER_DEPENDENCE)), + Some(LintId::of(explicit_write::EXPLICIT_WRITE)), + Some(LintId::of(float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS)), + Some(LintId::of(float_literal::EXCESSIVE_PRECISION)), + Some(LintId::of(format::USELESS_FORMAT)), + Some(LintId::of(format_args::FORMAT_IN_FORMAT_ARGS)), + Some(LintId::of(format_args::TO_STRING_IN_FORMAT_ARGS)), + Some(LintId::of(formatting::POSSIBLE_MISSING_COMMA)), + Some(LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING)), + Some(LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING)), + Some(LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING)), + Some(LintId::of(from_over_into::FROM_OVER_INTO)), + Some(LintId::of(from_str_radix_10::FROM_STR_RADIX_10)), + Some(LintId::of(functions::DOUBLE_MUST_USE)), + Some(LintId::of(functions::MUST_USE_UNIT)), + Some(LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF)), + Some(LintId::of(functions::RESULT_UNIT_ERR)), + Some(LintId::of(functions::TOO_MANY_ARGUMENTS)), + Some(LintId::of(get_last_with_len::GET_LAST_WITH_LEN)), + Some(LintId::of(identity_op::IDENTITY_OP)), + Some(LintId::of(if_let_mutex::IF_LET_MUTEX)), + Some(LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING)), + Some(LintId::of(infinite_iter::INFINITE_ITER)), + Some(LintId::of(inherent_to_string::INHERENT_TO_STRING)), + Some(LintId::of(inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY)), + Some(LintId::of(init_numbered_fields::INIT_NUMBERED_FIELDS)), + Some(LintId::of(inline_fn_without_body::INLINE_FN_WITHOUT_BODY)), + Some(LintId::of(int_plus_one::INT_PLUS_ONE)), + Some(LintId::of(large_const_arrays::LARGE_CONST_ARRAYS)), + Some(LintId::of(large_enum_variant::LARGE_ENUM_VARIANT)), + Some(LintId::of(len_zero::COMPARISON_TO_EMPTY)), + Some(LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY)), + Some(LintId::of(len_zero::LEN_ZERO)), + Some(LintId::of(let_underscore::LET_UNDERSCORE_LOCK)), + Some(LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES)), + Some(LintId::of(lifetimes::NEEDLESS_LIFETIMES)), + Some(LintId::of(literal_representation::INCONSISTENT_DIGIT_GROUPING)), + Some(LintId::of(literal_representation::MISTYPED_LITERAL_SUFFIXES)), + Some(LintId::of(literal_representation::UNUSUAL_BYTE_GROUPINGS)), + Some(LintId::of(loops::EMPTY_LOOP)), + Some(LintId::of(loops::EXPLICIT_COUNTER_LOOP)), + Some(LintId::of(loops::FOR_KV_MAP)), + Some(LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES)), + Some(LintId::of(loops::ITER_NEXT_LOOP)), + Some(LintId::of(loops::MANUAL_FLATTEN)), + Some(LintId::of(loops::MANUAL_MEMCPY)), + Some(LintId::of(loops::MUT_RANGE_BOUND)), + Some(LintId::of(loops::NEEDLESS_COLLECT)), + Some(LintId::of(loops::NEEDLESS_RANGE_LOOP)), + Some(LintId::of(loops::NEVER_LOOP)), + Some(LintId::of(loops::SAME_ITEM_PUSH)), + Some(LintId::of(loops::SINGLE_ELEMENT_LOOP)), + Some(LintId::of(loops::WHILE_IMMUTABLE_CONDITION)), + Some(LintId::of(loops::WHILE_LET_LOOP)), + Some(LintId::of(loops::WHILE_LET_ON_ITERATOR)), + Some(LintId::of(main_recursion::MAIN_RECURSION)), + Some(LintId::of(manual_async_fn::MANUAL_ASYNC_FN)), + Some(LintId::of(manual_bits::MANUAL_BITS)), + Some(LintId::of(manual_map::MANUAL_MAP)), + Some(LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE)), + Some(LintId::of(manual_strip::MANUAL_STRIP)), + Some(LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR)), + Some(LintId::of(map_clone::MAP_CLONE)), + Some(LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN)), + Some(LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN)), + Some(LintId::of(match_result_ok::MATCH_RESULT_OK)), + Some(LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH)), + Some(LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH)), + Some(LintId::of(matches::MATCH_AS_REF)), + Some(LintId::of(matches::MATCH_LIKE_MATCHES_MACRO)), + Some(LintId::of(matches::MATCH_OVERLAPPING_ARM)), + Some(LintId::of(matches::MATCH_REF_PATS)), + Some(LintId::of(matches::MATCH_SINGLE_BINDING)), + Some(LintId::of(matches::REDUNDANT_PATTERN_MATCHING)), + Some(LintId::of(matches::SINGLE_MATCH)), + Some(LintId::of(matches::WILDCARD_IN_OR_PATTERNS)), + Some(LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE)), + Some(LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT)), + Some(LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT)), + Some(LintId::of(methods::BIND_INSTEAD_OF_MAP)), + Some(LintId::of(methods::BYTES_NTH)), + Some(LintId::of(methods::CHARS_LAST_CMP)), + Some(LintId::of(methods::CHARS_NEXT_CMP)), + Some(LintId::of(methods::CLONE_DOUBLE_REF)), + Some(LintId::of(methods::CLONE_ON_COPY)), + Some(LintId::of(methods::EXPECT_FUN_CALL)), + Some(LintId::of(methods::EXTEND_WITH_DRAIN)), + Some(LintId::of(methods::FILTER_MAP_IDENTITY)), + Some(LintId::of(methods::FILTER_NEXT)), + Some(LintId::of(methods::FLAT_MAP_IDENTITY)), + Some(LintId::of(methods::INSPECT_FOR_EACH)), + Some(LintId::of(methods::INTO_ITER_ON_REF)), + Some(LintId::of(methods::ITERATOR_STEP_BY_ZERO)), + Some(LintId::of(methods::ITER_CLONED_COLLECT)), + Some(LintId::of(methods::ITER_COUNT)), + Some(LintId::of(methods::ITER_NEXT_SLICE)), + Some(LintId::of(methods::ITER_NTH)), + Some(LintId::of(methods::ITER_NTH_ZERO)), + Some(LintId::of(methods::ITER_OVEREAGER_CLONED)), + Some(LintId::of(methods::ITER_SKIP_NEXT)), + Some(LintId::of(methods::MANUAL_FILTER_MAP)), + Some(LintId::of(methods::MANUAL_FIND_MAP)), + Some(LintId::of(methods::MANUAL_SATURATING_ARITHMETIC)), + Some(LintId::of(methods::MANUAL_SPLIT_ONCE)), + Some(LintId::of(methods::MANUAL_STR_REPEAT)), + Some(LintId::of(methods::MAP_COLLECT_RESULT_UNIT)), + Some(LintId::of(methods::MAP_FLATTEN)), + Some(LintId::of(methods::MAP_IDENTITY)), + Some(LintId::of(methods::NEEDLESS_SPLITN)), + Some(LintId::of(methods::NEW_RET_NO_SELF)), + Some(LintId::of(methods::OK_EXPECT)), + Some(LintId::of(methods::OPTION_AS_REF_DEREF)), + Some(LintId::of(methods::OPTION_FILTER_MAP)), + Some(LintId::of(methods::OPTION_MAP_OR_NONE)), + Some(LintId::of(methods::OR_FUN_CALL)), + Some(LintId::of(methods::RESULT_MAP_OR_INTO_OPTION)), + Some(LintId::of(methods::SEARCH_IS_SOME)), + Some(LintId::of(methods::SHOULD_IMPLEMENT_TRAIT)), + Some(LintId::of(methods::SINGLE_CHAR_ADD_STR)), + Some(LintId::of(methods::SINGLE_CHAR_PATTERN)), + Some(LintId::of(methods::SKIP_WHILE_NEXT)), + Some(LintId::of(methods::STRING_EXTEND_CHARS)), + Some(LintId::of(methods::SUSPICIOUS_MAP)), + Some(LintId::of(methods::SUSPICIOUS_SPLITN)), + Some(LintId::of(methods::UNINIT_ASSUMED_INIT)), + Some(LintId::of(methods::UNNECESSARY_FILTER_MAP)), + Some(LintId::of(methods::UNNECESSARY_FOLD)), + Some(LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS)), + Some(LintId::of(methods::UNNECESSARY_TO_OWNED)), + Some(LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT)), + Some(LintId::of(methods::USELESS_ASREF)), + Some(LintId::of(methods::WRONG_SELF_CONVENTION)), + Some(LintId::of(methods::ZST_OFFSET)), + Some(LintId::of(minmax::MIN_MAX)), + Some(LintId::of(misc::CMP_NAN)), + Some(LintId::of(misc::CMP_OWNED)), + Some(LintId::of(misc::MODULO_ONE)), + Some(LintId::of(misc::SHORT_CIRCUIT_STATEMENT)), + Some(LintId::of(misc::TOPLEVEL_REF_ARG)), + Some(LintId::of(misc::ZERO_PTR)), + Some(LintId::of(misc_early::BUILTIN_TYPE_SHADOW)), + Some(LintId::of(misc_early::DOUBLE_NEG)), + Some(LintId::of(misc_early::DUPLICATE_UNDERSCORE_ARGUMENT)), + Some(LintId::of(misc_early::MIXED_CASE_HEX_LITERALS)), + Some(LintId::of(misc_early::REDUNDANT_PATTERN)), + Some(LintId::of(misc_early::UNNEEDED_WILDCARD_PATTERN)), + Some(LintId::of(misc_early::ZERO_PREFIXED_LITERAL)), + Some(LintId::of(mut_key::MUTABLE_KEY_TYPE)), + Some(LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK)), + Some(LintId::of(mut_reference::UNNECESSARY_MUT_PASSED)), + Some(LintId::of(needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE)), + Some(LintId::of(needless_bool::BOOL_COMPARISON)), + Some(LintId::of(needless_bool::NEEDLESS_BOOL)), + Some(LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE)), + Some(LintId::of(needless_late_init::NEEDLESS_LATE_INIT)), + Some(LintId::of(needless_option_as_deref::NEEDLESS_OPTION_AS_DEREF)), + Some(LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK)), + Some(LintId::of(needless_update::NEEDLESS_UPDATE)), + Some(LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD)), + Some(LintId::of(neg_multiply::NEG_MULTIPLY)), + Some(LintId::of(new_without_default::NEW_WITHOUT_DEFAULT)), + Some(LintId::of(no_effect::NO_EFFECT)), + Some(LintId::of(no_effect::UNNECESSARY_OPERATION)), + Some(LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST)), + Some(LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST)), + Some(LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS)), + Some(LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS)), + Some(LintId::of(octal_escapes::OCTAL_ESCAPES)), + Some(LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS)), + Some(LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP)), + Some(LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL)), + Some(LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL)), + Some(LintId::of(precedence::PRECEDENCE)), + Some(LintId::of(ptr::CMP_NULL)), + Some(LintId::of(ptr::INVALID_NULL_PTR_USAGE)), + Some(LintId::of(ptr::MUT_FROM_REF)), + Some(LintId::of(ptr::PTR_ARG)), + Some(LintId::of(ptr_eq::PTR_EQ)), + Some(LintId::of(ptr_offset_with_cast::PTR_OFFSET_WITH_CAST)), + Some(LintId::of(question_mark::QUESTION_MARK)), + Some(LintId::of(ranges::MANUAL_RANGE_CONTAINS)), + Some(LintId::of(ranges::RANGE_ZIP_WITH_LEN)), + Some(LintId::of(ranges::REVERSED_EMPTY_RANGES)), + Some(LintId::of(redundant_clone::REDUNDANT_CLONE)), + Some(LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL)), + Some(LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES)), + Some(LintId::of(redundant_slicing::REDUNDANT_SLICING)), + Some(LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES)), + Some(LintId::of(reference::DEREF_ADDROF)), + Some(LintId::of(regex::INVALID_REGEX)), + Some(LintId::of(repeat_once::REPEAT_ONCE)), + Some(LintId::of(returns::LET_AND_RETURN)), + Some(LintId::of(returns::NEEDLESS_RETURN)), + Some(LintId::of(self_assignment::SELF_ASSIGNMENT)), + Some(LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS)), + Some(LintId::of(serde_api::SERDE_API_MISUSE)), + Some(LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS)), + Some(LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT)), + Some(LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION)), + Some(LintId::of(stable_sort_primitive::STABLE_SORT_PRIMITIVE)), + Some(LintId::of(strings::STRING_FROM_UTF8_AS_BYTES)), + Some(LintId::of(strlen_on_c_strings::STRLEN_ON_C_STRINGS)), + Some(LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL)), + Some(LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL)), + Some(LintId::of(swap::ALMOST_SWAPPED)), + Some(LintId::of(swap::MANUAL_SWAP)), + Some(LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS)), + Some(LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT)), + Some(LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME)), + Some(LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY)), + Some(LintId::of(transmute::CROSSPOINTER_TRANSMUTE)), + Some(LintId::of(transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS)), + Some(LintId::of(transmute::TRANSMUTE_BYTES_TO_STR)), + Some(LintId::of(transmute::TRANSMUTE_FLOAT_TO_INT)), + Some(LintId::of(transmute::TRANSMUTE_INT_TO_BOOL)), + Some(LintId::of(transmute::TRANSMUTE_INT_TO_CHAR)), + Some(LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT)), + Some(LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES)), + Some(LintId::of(transmute::TRANSMUTE_PTR_TO_REF)), + Some(LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR)), + Some(LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE)), + Some(LintId::of(transmute::WRONG_TRANSMUTE)), + Some(LintId::of(transmuting_null::TRANSMUTING_NULL)), + Some(LintId::of(try_err::TRY_ERR)), + Some(LintId::of(types::BORROWED_BOX)), + Some(LintId::of(types::BOX_COLLECTION)), + Some(LintId::of(types::REDUNDANT_ALLOCATION)), + Some(LintId::of(types::TYPE_COMPLEXITY)), + Some(LintId::of(types::VEC_BOX)), + Some(LintId::of(undropped_manually_drops::UNDROPPED_MANUALLY_DROPS)), + Some(LintId::of(unicode::INVISIBLE_CHARACTERS)), + Some(LintId::of(uninit_vec::UNINIT_VEC)), + Some(LintId::of(unit_hash::UNIT_HASH)), + Some(LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD)), + Some(LintId::of(unit_types::UNIT_ARG)), + Some(LintId::of(unit_types::UNIT_CMP)), + Some(LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS)), + Some(LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS)), + Some(LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY)), + Some(LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME)), + Some(LintId::of(unused_io_amount::UNUSED_IO_AMOUNT)), + Some(LintId::of(unused_unit::UNUSED_UNIT)), + Some(LintId::of(unwrap::PANICKING_UNWRAP)), + Some(LintId::of(unwrap::UNNECESSARY_UNWRAP)), + Some(LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS)), + Some(LintId::of(useless_conversion::USELESS_CONVERSION)), + Some(LintId::of(vec::USELESS_VEC)), + Some(LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH)), + Some(LintId::of(vec_resize_to_zero::VEC_RESIZE_TO_ZERO)), + Some(LintId::of(write::PRINTLN_EMPTY_STRING)), + Some(LintId::of(write::PRINT_LITERAL)), + Some(LintId::of(write::PRINT_WITH_NEWLINE)), + Some(LintId::of(write::WRITELN_EMPTY_STRING)), + Some(LintId::of(write::WRITE_LITERAL)), + Some(LintId::of(write::WRITE_WITH_NEWLINE)), + Some(LintId::of(zero_div_zero::ZERO_DIVIDED_BY_ZERO)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_cargo.rs b/clippy_lints/src/lib.register_cargo.rs index c890523fe5ae..017b75ee79ac 100644 --- a/clippy_lints/src/lib.register_cargo.rs +++ b/clippy_lints/src/lib.register_cargo.rs @@ -2,10 +2,10 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::cargo", Some("clippy_cargo"), vec![ - LintId::of(cargo::CARGO_COMMON_METADATA), - LintId::of(cargo::MULTIPLE_CRATE_VERSIONS), - LintId::of(cargo::NEGATIVE_FEATURE_NAMES), - LintId::of(cargo::REDUNDANT_FEATURE_NAMES), - LintId::of(cargo::WILDCARD_DEPENDENCIES), -]) +store.register_group(true, "clippy::cargo", Some("clippy_cargo"), [ + Some(LintId::of(cargo::CARGO_COMMON_METADATA)), + Some(LintId::of(cargo::MULTIPLE_CRATE_VERSIONS)), + Some(LintId::of(cargo::NEGATIVE_FEATURE_NAMES)), + Some(LintId::of(cargo::REDUNDANT_FEATURE_NAMES)), + Some(LintId::of(cargo::WILDCARD_DEPENDENCIES)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_complexity.rs b/clippy_lints/src/lib.register_complexity.rs index bd5ff613447c..97bd7fd963a6 100644 --- a/clippy_lints/src/lib.register_complexity.rs +++ b/clippy_lints/src/lib.register_complexity.rs @@ -2,95 +2,95 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec![ - LintId::of(attrs::DEPRECATED_CFG_ATTR), - LintId::of(booleans::NONMINIMAL_BOOL), - LintId::of(casts::CHAR_LIT_AS_U8), - LintId::of(casts::UNNECESSARY_CAST), - LintId::of(derivable_impls::DERIVABLE_IMPLS), - LintId::of(double_comparison::DOUBLE_COMPARISONS), - LintId::of(double_parens::DOUBLE_PARENS), - LintId::of(duration_subsec::DURATION_SUBSEC), - LintId::of(eval_order_dependence::DIVERGING_SUB_EXPRESSION), - LintId::of(explicit_write::EXPLICIT_WRITE), - LintId::of(format::USELESS_FORMAT), - LintId::of(functions::TOO_MANY_ARGUMENTS), - LintId::of(get_last_with_len::GET_LAST_WITH_LEN), - LintId::of(identity_op::IDENTITY_OP), - LintId::of(int_plus_one::INT_PLUS_ONE), - LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES), - LintId::of(lifetimes::NEEDLESS_LIFETIMES), - LintId::of(loops::EXPLICIT_COUNTER_LOOP), - LintId::of(loops::MANUAL_FLATTEN), - LintId::of(loops::SINGLE_ELEMENT_LOOP), - LintId::of(loops::WHILE_LET_LOOP), - LintId::of(manual_strip::MANUAL_STRIP), - LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR), - LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN), - LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN), - LintId::of(matches::MATCH_AS_REF), - LintId::of(matches::MATCH_SINGLE_BINDING), - LintId::of(matches::WILDCARD_IN_OR_PATTERNS), - LintId::of(methods::BIND_INSTEAD_OF_MAP), - LintId::of(methods::CLONE_ON_COPY), - LintId::of(methods::FILTER_MAP_IDENTITY), - LintId::of(methods::FILTER_NEXT), - LintId::of(methods::FLAT_MAP_IDENTITY), - LintId::of(methods::INSPECT_FOR_EACH), - LintId::of(methods::ITER_COUNT), - LintId::of(methods::MANUAL_FILTER_MAP), - LintId::of(methods::MANUAL_FIND_MAP), - LintId::of(methods::MANUAL_SPLIT_ONCE), - LintId::of(methods::MAP_FLATTEN), - LintId::of(methods::MAP_IDENTITY), - LintId::of(methods::NEEDLESS_SPLITN), - LintId::of(methods::OPTION_AS_REF_DEREF), - LintId::of(methods::OPTION_FILTER_MAP), - LintId::of(methods::SEARCH_IS_SOME), - LintId::of(methods::SKIP_WHILE_NEXT), - LintId::of(methods::UNNECESSARY_FILTER_MAP), - LintId::of(methods::USELESS_ASREF), - LintId::of(misc::SHORT_CIRCUIT_STATEMENT), - LintId::of(misc_early::UNNEEDED_WILDCARD_PATTERN), - LintId::of(misc_early::ZERO_PREFIXED_LITERAL), - LintId::of(needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE), - LintId::of(needless_bool::BOOL_COMPARISON), - LintId::of(needless_bool::NEEDLESS_BOOL), - LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE), - LintId::of(needless_option_as_deref::NEEDLESS_OPTION_AS_DEREF), - LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK), - LintId::of(needless_update::NEEDLESS_UPDATE), - LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD), - LintId::of(no_effect::NO_EFFECT), - LintId::of(no_effect::UNNECESSARY_OPERATION), - LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL), - LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL), - LintId::of(precedence::PRECEDENCE), - LintId::of(ptr_offset_with_cast::PTR_OFFSET_WITH_CAST), - LintId::of(ranges::RANGE_ZIP_WITH_LEN), - LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL), - LintId::of(redundant_slicing::REDUNDANT_SLICING), - LintId::of(reference::DEREF_ADDROF), - LintId::of(repeat_once::REPEAT_ONCE), - LintId::of(strings::STRING_FROM_UTF8_AS_BYTES), - LintId::of(strlen_on_c_strings::STRLEN_ON_C_STRINGS), - LintId::of(swap::MANUAL_SWAP), - LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT), - LintId::of(transmute::CROSSPOINTER_TRANSMUTE), - LintId::of(transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS), - LintId::of(transmute::TRANSMUTE_BYTES_TO_STR), - LintId::of(transmute::TRANSMUTE_FLOAT_TO_INT), - LintId::of(transmute::TRANSMUTE_INT_TO_BOOL), - LintId::of(transmute::TRANSMUTE_INT_TO_CHAR), - LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT), - LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES), - LintId::of(transmute::TRANSMUTE_PTR_TO_REF), - LintId::of(types::BORROWED_BOX), - LintId::of(types::TYPE_COMPLEXITY), - LintId::of(types::VEC_BOX), - LintId::of(unit_types::UNIT_ARG), - LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY), - LintId::of(unwrap::UNNECESSARY_UNWRAP), - LintId::of(useless_conversion::USELESS_CONVERSION), - LintId::of(zero_div_zero::ZERO_DIVIDED_BY_ZERO), -]) +store.register_group(true, "clippy::complexity", Some("clippy_complexity"), [ + Some(LintId::of(attrs::DEPRECATED_CFG_ATTR)), + Some(LintId::of(booleans::NONMINIMAL_BOOL)), + Some(LintId::of(casts::CHAR_LIT_AS_U8)), + Some(LintId::of(casts::UNNECESSARY_CAST)), + Some(LintId::of(derivable_impls::DERIVABLE_IMPLS)), + Some(LintId::of(double_comparison::DOUBLE_COMPARISONS)), + Some(LintId::of(double_parens::DOUBLE_PARENS)), + Some(LintId::of(duration_subsec::DURATION_SUBSEC)), + Some(LintId::of(eval_order_dependence::DIVERGING_SUB_EXPRESSION)), + Some(LintId::of(explicit_write::EXPLICIT_WRITE)), + Some(LintId::of(format::USELESS_FORMAT)), + Some(LintId::of(functions::TOO_MANY_ARGUMENTS)), + Some(LintId::of(get_last_with_len::GET_LAST_WITH_LEN)), + Some(LintId::of(identity_op::IDENTITY_OP)), + Some(LintId::of(int_plus_one::INT_PLUS_ONE)), + Some(LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES)), + Some(LintId::of(lifetimes::NEEDLESS_LIFETIMES)), + Some(LintId::of(loops::EXPLICIT_COUNTER_LOOP)), + Some(LintId::of(loops::MANUAL_FLATTEN)), + Some(LintId::of(loops::SINGLE_ELEMENT_LOOP)), + Some(LintId::of(loops::WHILE_LET_LOOP)), + Some(LintId::of(manual_strip::MANUAL_STRIP)), + Some(LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR)), + Some(LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN)), + Some(LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN)), + Some(LintId::of(matches::MATCH_AS_REF)), + Some(LintId::of(matches::MATCH_SINGLE_BINDING)), + Some(LintId::of(matches::WILDCARD_IN_OR_PATTERNS)), + Some(LintId::of(methods::BIND_INSTEAD_OF_MAP)), + Some(LintId::of(methods::CLONE_ON_COPY)), + Some(LintId::of(methods::FILTER_MAP_IDENTITY)), + Some(LintId::of(methods::FILTER_NEXT)), + Some(LintId::of(methods::FLAT_MAP_IDENTITY)), + Some(LintId::of(methods::INSPECT_FOR_EACH)), + Some(LintId::of(methods::ITER_COUNT)), + Some(LintId::of(methods::MANUAL_FILTER_MAP)), + Some(LintId::of(methods::MANUAL_FIND_MAP)), + Some(LintId::of(methods::MANUAL_SPLIT_ONCE)), + Some(LintId::of(methods::MAP_FLATTEN)), + Some(LintId::of(methods::MAP_IDENTITY)), + Some(LintId::of(methods::NEEDLESS_SPLITN)), + Some(LintId::of(methods::OPTION_AS_REF_DEREF)), + Some(LintId::of(methods::OPTION_FILTER_MAP)), + Some(LintId::of(methods::SEARCH_IS_SOME)), + Some(LintId::of(methods::SKIP_WHILE_NEXT)), + Some(LintId::of(methods::UNNECESSARY_FILTER_MAP)), + Some(LintId::of(methods::USELESS_ASREF)), + Some(LintId::of(misc::SHORT_CIRCUIT_STATEMENT)), + Some(LintId::of(misc_early::UNNEEDED_WILDCARD_PATTERN)), + Some(LintId::of(misc_early::ZERO_PREFIXED_LITERAL)), + Some(LintId::of(needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE)), + Some(LintId::of(needless_bool::BOOL_COMPARISON)), + Some(LintId::of(needless_bool::NEEDLESS_BOOL)), + Some(LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE)), + Some(LintId::of(needless_option_as_deref::NEEDLESS_OPTION_AS_DEREF)), + Some(LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK)), + Some(LintId::of(needless_update::NEEDLESS_UPDATE)), + Some(LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD)), + Some(LintId::of(no_effect::NO_EFFECT)), + Some(LintId::of(no_effect::UNNECESSARY_OPERATION)), + Some(LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL)), + Some(LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL)), + Some(LintId::of(precedence::PRECEDENCE)), + Some(LintId::of(ptr_offset_with_cast::PTR_OFFSET_WITH_CAST)), + Some(LintId::of(ranges::RANGE_ZIP_WITH_LEN)), + Some(LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL)), + Some(LintId::of(redundant_slicing::REDUNDANT_SLICING)), + Some(LintId::of(reference::DEREF_ADDROF)), + Some(LintId::of(repeat_once::REPEAT_ONCE)), + Some(LintId::of(strings::STRING_FROM_UTF8_AS_BYTES)), + Some(LintId::of(strlen_on_c_strings::STRLEN_ON_C_STRINGS)), + Some(LintId::of(swap::MANUAL_SWAP)), + Some(LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT)), + Some(LintId::of(transmute::CROSSPOINTER_TRANSMUTE)), + Some(LintId::of(transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS)), + Some(LintId::of(transmute::TRANSMUTE_BYTES_TO_STR)), + Some(LintId::of(transmute::TRANSMUTE_FLOAT_TO_INT)), + Some(LintId::of(transmute::TRANSMUTE_INT_TO_BOOL)), + Some(LintId::of(transmute::TRANSMUTE_INT_TO_CHAR)), + Some(LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT)), + Some(LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES)), + Some(LintId::of(transmute::TRANSMUTE_PTR_TO_REF)), + Some(LintId::of(types::BORROWED_BOX)), + Some(LintId::of(types::TYPE_COMPLEXITY)), + Some(LintId::of(types::VEC_BOX)), + Some(LintId::of(unit_types::UNIT_ARG)), + Some(LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY)), + Some(LintId::of(unwrap::UNNECESSARY_UNWRAP)), + Some(LintId::of(useless_conversion::USELESS_CONVERSION)), + Some(LintId::of(zero_div_zero::ZERO_DIVIDED_BY_ZERO)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_correctness.rs b/clippy_lints/src/lib.register_correctness.rs index d013daa8e082..7cce7f29b60e 100644 --- a/clippy_lints/src/lib.register_correctness.rs +++ b/clippy_lints/src/lib.register_correctness.rs @@ -2,75 +2,75 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::correctness", Some("clippy_correctness"), vec![ - LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS), - LintId::of(approx_const::APPROX_CONSTANT), - LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC), - LintId::of(attrs::DEPRECATED_SEMVER), - LintId::of(attrs::MISMATCHED_TARGET_OS), - LintId::of(attrs::USELESS_ATTRIBUTE), - LintId::of(bit_mask::BAD_BIT_MASK), - LintId::of(bit_mask::INEFFECTIVE_BIT_MASK), - LintId::of(booleans::LOGIC_BUG), - LintId::of(casts::CAST_REF_TO_MUT), - LintId::of(copies::IFS_SAME_COND), - LintId::of(copies::IF_SAME_THEN_ELSE), - LintId::of(derive::DERIVE_HASH_XOR_EQ), - LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD), - LintId::of(drop_forget_ref::DROP_COPY), - LintId::of(drop_forget_ref::DROP_REF), - LintId::of(drop_forget_ref::FORGET_COPY), - LintId::of(drop_forget_ref::FORGET_REF), - LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT), - LintId::of(eq_op::EQ_OP), - LintId::of(erasing_op::ERASING_OP), - LintId::of(formatting::POSSIBLE_MISSING_COMMA), - LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF), - LintId::of(if_let_mutex::IF_LET_MUTEX), - LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING), - LintId::of(infinite_iter::INFINITE_ITER), - LintId::of(inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY), - LintId::of(inline_fn_without_body::INLINE_FN_WITHOUT_BODY), - LintId::of(let_underscore::LET_UNDERSCORE_LOCK), - LintId::of(literal_representation::MISTYPED_LITERAL_SUFFIXES), - LintId::of(loops::ITER_NEXT_LOOP), - LintId::of(loops::NEVER_LOOP), - LintId::of(loops::WHILE_IMMUTABLE_CONDITION), - LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH), - LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT), - LintId::of(methods::CLONE_DOUBLE_REF), - LintId::of(methods::ITERATOR_STEP_BY_ZERO), - LintId::of(methods::SUSPICIOUS_SPLITN), - LintId::of(methods::UNINIT_ASSUMED_INIT), - LintId::of(methods::ZST_OFFSET), - LintId::of(minmax::MIN_MAX), - LintId::of(misc::CMP_NAN), - LintId::of(misc::MODULO_ONE), - LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS), - LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS), - LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP), - LintId::of(ptr::INVALID_NULL_PTR_USAGE), - LintId::of(ptr::MUT_FROM_REF), - LintId::of(ranges::REVERSED_EMPTY_RANGES), - LintId::of(regex::INVALID_REGEX), - LintId::of(self_assignment::SELF_ASSIGNMENT), - LintId::of(serde_api::SERDE_API_MISUSE), - LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT), - LintId::of(swap::ALMOST_SWAPPED), - LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY), - LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR), - LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE), - LintId::of(transmute::WRONG_TRANSMUTE), - LintId::of(transmuting_null::TRANSMUTING_NULL), - LintId::of(undropped_manually_drops::UNDROPPED_MANUALLY_DROPS), - LintId::of(unicode::INVISIBLE_CHARACTERS), - LintId::of(uninit_vec::UNINIT_VEC), - LintId::of(unit_hash::UNIT_HASH), - LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD), - LintId::of(unit_types::UNIT_CMP), - LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS), - LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS), - LintId::of(unused_io_amount::UNUSED_IO_AMOUNT), - LintId::of(unwrap::PANICKING_UNWRAP), - LintId::of(vec_resize_to_zero::VEC_RESIZE_TO_ZERO), -]) +store.register_group(true, "clippy::correctness", Some("clippy_correctness"), [ + Some(LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS)), + Some(LintId::of(approx_const::APPROX_CONSTANT)), + Some(LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC)), + Some(LintId::of(attrs::DEPRECATED_SEMVER)), + Some(LintId::of(attrs::MISMATCHED_TARGET_OS)), + Some(LintId::of(attrs::USELESS_ATTRIBUTE)), + Some(LintId::of(bit_mask::BAD_BIT_MASK)), + Some(LintId::of(bit_mask::INEFFECTIVE_BIT_MASK)), + Some(LintId::of(booleans::LOGIC_BUG)), + Some(LintId::of(casts::CAST_REF_TO_MUT)), + Some(LintId::of(copies::IFS_SAME_COND)), + Some(LintId::of(copies::IF_SAME_THEN_ELSE)), + Some(LintId::of(derive::DERIVE_HASH_XOR_EQ)), + Some(LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD)), + Some(LintId::of(drop_forget_ref::DROP_COPY)), + Some(LintId::of(drop_forget_ref::DROP_REF)), + Some(LintId::of(drop_forget_ref::FORGET_COPY)), + Some(LintId::of(drop_forget_ref::FORGET_REF)), + Some(LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT)), + Some(LintId::of(eq_op::EQ_OP)), + Some(LintId::of(erasing_op::ERASING_OP)), + Some(LintId::of(formatting::POSSIBLE_MISSING_COMMA)), + Some(LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF)), + Some(LintId::of(if_let_mutex::IF_LET_MUTEX)), + Some(LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING)), + Some(LintId::of(infinite_iter::INFINITE_ITER)), + Some(LintId::of(inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY)), + Some(LintId::of(inline_fn_without_body::INLINE_FN_WITHOUT_BODY)), + Some(LintId::of(let_underscore::LET_UNDERSCORE_LOCK)), + Some(LintId::of(literal_representation::MISTYPED_LITERAL_SUFFIXES)), + Some(LintId::of(loops::ITER_NEXT_LOOP)), + Some(LintId::of(loops::NEVER_LOOP)), + Some(LintId::of(loops::WHILE_IMMUTABLE_CONDITION)), + Some(LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH)), + Some(LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT)), + Some(LintId::of(methods::CLONE_DOUBLE_REF)), + Some(LintId::of(methods::ITERATOR_STEP_BY_ZERO)), + Some(LintId::of(methods::SUSPICIOUS_SPLITN)), + Some(LintId::of(methods::UNINIT_ASSUMED_INIT)), + Some(LintId::of(methods::ZST_OFFSET)), + Some(LintId::of(minmax::MIN_MAX)), + Some(LintId::of(misc::CMP_NAN)), + Some(LintId::of(misc::MODULO_ONE)), + Some(LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS)), + Some(LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS)), + Some(LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP)), + Some(LintId::of(ptr::INVALID_NULL_PTR_USAGE)), + Some(LintId::of(ptr::MUT_FROM_REF)), + Some(LintId::of(ranges::REVERSED_EMPTY_RANGES)), + Some(LintId::of(regex::INVALID_REGEX)), + Some(LintId::of(self_assignment::SELF_ASSIGNMENT)), + Some(LintId::of(serde_api::SERDE_API_MISUSE)), + Some(LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT)), + Some(LintId::of(swap::ALMOST_SWAPPED)), + Some(LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY)), + Some(LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR)), + Some(LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE)), + Some(LintId::of(transmute::WRONG_TRANSMUTE)), + Some(LintId::of(transmuting_null::TRANSMUTING_NULL)), + Some(LintId::of(undropped_manually_drops::UNDROPPED_MANUALLY_DROPS)), + Some(LintId::of(unicode::INVISIBLE_CHARACTERS)), + Some(LintId::of(uninit_vec::UNINIT_VEC)), + Some(LintId::of(unit_hash::UNIT_HASH)), + Some(LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD)), + Some(LintId::of(unit_types::UNIT_CMP)), + Some(LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS)), + Some(LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS)), + Some(LintId::of(unused_io_amount::UNUSED_IO_AMOUNT)), + Some(LintId::of(unwrap::PANICKING_UNWRAP)), + Some(LintId::of(vec_resize_to_zero::VEC_RESIZE_TO_ZERO)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_internal.rs b/clippy_lints/src/lib.register_internal.rs index 7d4c7d2adb5b..8910cb44b927 100644 --- a/clippy_lints/src/lib.register_internal.rs +++ b/clippy_lints/src/lib.register_internal.rs @@ -2,19 +2,19 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::internal", Some("clippy_internal"), vec![ - LintId::of(utils::internal_lints::CLIPPY_LINTS_INTERNAL), - LintId::of(utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS), - LintId::of(utils::internal_lints::COMPILER_LINT_FUNCTIONS), - LintId::of(utils::internal_lints::DEFAULT_LINT), - LintId::of(utils::internal_lints::IF_CHAIN_STYLE), - LintId::of(utils::internal_lints::INTERNING_DEFINED_SYMBOL), - LintId::of(utils::internal_lints::INVALID_CLIPPY_VERSION_ATTRIBUTE), - 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), -]) +store.register_group(true, "clippy::internal", Some("clippy_internal"), [ + Some(LintId::of(utils::internal_lints::CLIPPY_LINTS_INTERNAL)), + Some(LintId::of(utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS)), + Some(LintId::of(utils::internal_lints::COMPILER_LINT_FUNCTIONS)), + Some(LintId::of(utils::internal_lints::DEFAULT_LINT)), + Some(LintId::of(utils::internal_lints::IF_CHAIN_STYLE)), + Some(LintId::of(utils::internal_lints::INTERNING_DEFINED_SYMBOL)), + Some(LintId::of(utils::internal_lints::INVALID_CLIPPY_VERSION_ATTRIBUTE)), + Some(LintId::of(utils::internal_lints::INVALID_PATHS)), + Some(LintId::of(utils::internal_lints::LINT_WITHOUT_LINT_PASS)), + Some(LintId::of(utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM)), + Some(LintId::of(utils::internal_lints::MISSING_CLIPPY_VERSION_ATTRIBUTE)), + Some(LintId::of(utils::internal_lints::OUTER_EXPN_EXPN_DATA)), + Some(LintId::of(utils::internal_lints::PRODUCE_ICE)), + Some(LintId::of(utils::internal_lints::UNNECESSARY_SYMBOL_STR)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_nursery.rs b/clippy_lints/src/lib.register_nursery.rs index a73537901002..8f0864b7d6db 100644 --- a/clippy_lints/src/lib.register_nursery.rs +++ b/clippy_lints/src/lib.register_nursery.rs @@ -2,30 +2,30 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![ - LintId::of(attrs::EMPTY_LINE_AFTER_OUTER_ATTR), - LintId::of(cognitive_complexity::COGNITIVE_COMPLEXITY), - LintId::of(copies::BRANCHES_SHARING_CODE), - LintId::of(equatable_if_let::EQUATABLE_IF_LET), - LintId::of(fallible_impl_from::FALLIBLE_IMPL_FROM), - LintId::of(floating_point_arithmetic::IMPRECISE_FLOPS), - LintId::of(floating_point_arithmetic::SUBOPTIMAL_FLOPS), - LintId::of(future_not_send::FUTURE_NOT_SEND), - LintId::of(index_refutable_slice::INDEX_REFUTABLE_SLICE), - LintId::of(let_if_seq::USELESS_LET_IF_SEQ), - LintId::of(missing_const_for_fn::MISSING_CONST_FOR_FN), - LintId::of(mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL), - LintId::of(mutex_atomic::MUTEX_ATOMIC), - LintId::of(mutex_atomic::MUTEX_INTEGER), - LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY), - LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES), - LintId::of(option_if_let_else::OPTION_IF_LET_ELSE), - LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE), - LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE), - LintId::of(regex::TRIVIAL_REGEX), - LintId::of(strings::STRING_LIT_AS_BYTES), - LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS), - LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY), - LintId::of(transmute::USELESS_TRANSMUTE), - LintId::of(use_self::USE_SELF), -]) +store.register_group(true, "clippy::nursery", Some("clippy_nursery"), [ + Some(LintId::of(attrs::EMPTY_LINE_AFTER_OUTER_ATTR)), + Some(LintId::of(cognitive_complexity::COGNITIVE_COMPLEXITY)), + Some(LintId::of(copies::BRANCHES_SHARING_CODE)), + Some(LintId::of(equatable_if_let::EQUATABLE_IF_LET)), + Some(LintId::of(fallible_impl_from::FALLIBLE_IMPL_FROM)), + Some(LintId::of(floating_point_arithmetic::IMPRECISE_FLOPS)), + Some(LintId::of(floating_point_arithmetic::SUBOPTIMAL_FLOPS)), + Some(LintId::of(future_not_send::FUTURE_NOT_SEND)), + Some(LintId::of(index_refutable_slice::INDEX_REFUTABLE_SLICE)), + Some(LintId::of(let_if_seq::USELESS_LET_IF_SEQ)), + Some(LintId::of(missing_const_for_fn::MISSING_CONST_FOR_FN)), + Some(LintId::of(mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL)), + Some(LintId::of(mutex_atomic::MUTEX_ATOMIC)), + Some(LintId::of(mutex_atomic::MUTEX_INTEGER)), + Some(LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY)), + Some(LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES)), + Some(LintId::of(option_if_let_else::OPTION_IF_LET_ELSE)), + Some(LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE)), + Some(LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE)), + Some(LintId::of(regex::TRIVIAL_REGEX)), + Some(LintId::of(strings::STRING_LIT_AS_BYTES)), + Some(LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS)), + Some(LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY)), + Some(LintId::of(transmute::USELESS_TRANSMUTE)), + Some(LintId::of(use_self::USE_SELF)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_pedantic.rs b/clippy_lints/src/lib.register_pedantic.rs index 1292675f4a96..7f3e4696405b 100644 --- a/clippy_lints/src/lib.register_pedantic.rs +++ b/clippy_lints/src/lib.register_pedantic.rs @@ -2,100 +2,100 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![ - LintId::of(attrs::INLINE_ALWAYS), - LintId::of(await_holding_invalid::AWAIT_HOLDING_LOCK), - LintId::of(await_holding_invalid::AWAIT_HOLDING_REFCELL_REF), - LintId::of(bit_mask::VERBOSE_BIT_MASK), - LintId::of(borrow_as_ptr::BORROW_AS_PTR), - LintId::of(bytecount::NAIVE_BYTECOUNT), - LintId::of(case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS), - LintId::of(casts::CAST_LOSSLESS), - LintId::of(casts::CAST_POSSIBLE_TRUNCATION), - LintId::of(casts::CAST_POSSIBLE_WRAP), - LintId::of(casts::CAST_PRECISION_LOSS), - LintId::of(casts::CAST_PTR_ALIGNMENT), - LintId::of(casts::CAST_SIGN_LOSS), - LintId::of(casts::PTR_AS_PTR), - LintId::of(checked_conversions::CHECKED_CONVERSIONS), - LintId::of(copies::SAME_FUNCTIONS_IN_IF_CONDITION), - LintId::of(copy_iterator::COPY_ITERATOR), - LintId::of(default::DEFAULT_TRAIT_ACCESS), - LintId::of(dereference::EXPLICIT_DEREF_METHODS), - LintId::of(dereference::REF_BINDING_TO_REFERENCE), - LintId::of(derive::EXPL_IMPL_CLONE_ON_COPY), - LintId::of(derive::UNSAFE_DERIVE_DESERIALIZE), - LintId::of(doc::DOC_MARKDOWN), - LintId::of(doc::MISSING_ERRORS_DOC), - LintId::of(doc::MISSING_PANICS_DOC), - LintId::of(empty_enum::EMPTY_ENUM), - LintId::of(enum_variants::MODULE_NAME_REPETITIONS), - LintId::of(eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS), - LintId::of(excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS), - LintId::of(excessive_bools::STRUCT_EXCESSIVE_BOOLS), - LintId::of(functions::MUST_USE_CANDIDATE), - LintId::of(functions::TOO_MANY_LINES), - LintId::of(if_not_else::IF_NOT_ELSE), - LintId::of(implicit_hasher::IMPLICIT_HASHER), - LintId::of(implicit_saturating_sub::IMPLICIT_SATURATING_SUB), - LintId::of(inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR), - LintId::of(infinite_iter::MAYBE_INFINITE_ITER), - LintId::of(invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS), - LintId::of(items_after_statements::ITEMS_AFTER_STATEMENTS), - LintId::of(iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR), - LintId::of(large_stack_arrays::LARGE_STACK_ARRAYS), - LintId::of(let_underscore::LET_UNDERSCORE_DROP), - LintId::of(literal_representation::LARGE_DIGIT_GROUPS), - LintId::of(literal_representation::UNREADABLE_LITERAL), - LintId::of(loops::EXPLICIT_INTO_ITER_LOOP), - LintId::of(loops::EXPLICIT_ITER_LOOP), - LintId::of(macro_use::MACRO_USE_IMPORTS), - LintId::of(manual_assert::MANUAL_ASSERT), - LintId::of(manual_ok_or::MANUAL_OK_OR), - LintId::of(match_on_vec_items::MATCH_ON_VEC_ITEMS), - LintId::of(matches::MATCH_BOOL), - LintId::of(matches::MATCH_SAME_ARMS), - LintId::of(matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS), - LintId::of(matches::MATCH_WILD_ERR_ARM), - LintId::of(matches::SINGLE_MATCH_ELSE), - LintId::of(methods::CLONED_INSTEAD_OF_COPIED), - LintId::of(methods::FILTER_MAP_NEXT), - LintId::of(methods::FLAT_MAP_OPTION), - LintId::of(methods::FROM_ITER_INSTEAD_OF_COLLECT), - LintId::of(methods::IMPLICIT_CLONE), - LintId::of(methods::INEFFICIENT_TO_STRING), - LintId::of(methods::MAP_UNWRAP_OR), - LintId::of(misc::FLOAT_CMP), - LintId::of(misc::USED_UNDERSCORE_BINDING), - LintId::of(mut_mut::MUT_MUT), - LintId::of(needless_bitwise_bool::NEEDLESS_BITWISE_BOOL), - LintId::of(needless_continue::NEEDLESS_CONTINUE), - LintId::of(needless_for_each::NEEDLESS_FOR_EACH), - LintId::of(needless_pass_by_value::NEEDLESS_PASS_BY_VALUE), - LintId::of(no_effect::NO_EFFECT_UNDERSCORE_BINDING), - LintId::of(non_expressive_names::MANY_SINGLE_CHAR_NAMES), - LintId::of(non_expressive_names::SIMILAR_NAMES), - LintId::of(pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE), - LintId::of(pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF), - LintId::of(ranges::RANGE_MINUS_ONE), - LintId::of(ranges::RANGE_PLUS_ONE), - LintId::of(redundant_else::REDUNDANT_ELSE), - LintId::of(ref_option_ref::REF_OPTION_REF), - LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE), - LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED), - LintId::of(strings::STRING_ADD_ASSIGN), - LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS), - LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS), - LintId::of(transmute::TRANSMUTE_PTR_TO_PTR), - LintId::of(types::LINKEDLIST), - LintId::of(types::OPTION_OPTION), - LintId::of(unicode::UNICODE_NOT_NFC), - LintId::of(unit_types::LET_UNIT_VALUE), - LintId::of(unnecessary_wraps::UNNECESSARY_WRAPS), - LintId::of(unnested_or_patterns::UNNESTED_OR_PATTERNS), - LintId::of(unused_async::UNUSED_ASYNC), - LintId::of(unused_self::UNUSED_SELF), - LintId::of(wildcard_imports::ENUM_GLOB_USE), - LintId::of(wildcard_imports::WILDCARD_IMPORTS), - LintId::of(zero_sized_map_values::ZERO_SIZED_MAP_VALUES), -]) +store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), [ + Some(LintId::of(attrs::INLINE_ALWAYS)), + Some(LintId::of(await_holding_invalid::AWAIT_HOLDING_LOCK)), + Some(LintId::of(await_holding_invalid::AWAIT_HOLDING_REFCELL_REF)), + Some(LintId::of(bit_mask::VERBOSE_BIT_MASK)), + Some(LintId::of(borrow_as_ptr::BORROW_AS_PTR)), + Some(LintId::of(bytecount::NAIVE_BYTECOUNT)), + Some(LintId::of(case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS)), + Some(LintId::of(casts::CAST_LOSSLESS)), + Some(LintId::of(casts::CAST_POSSIBLE_TRUNCATION)), + Some(LintId::of(casts::CAST_POSSIBLE_WRAP)), + Some(LintId::of(casts::CAST_PRECISION_LOSS)), + Some(LintId::of(casts::CAST_PTR_ALIGNMENT)), + Some(LintId::of(casts::CAST_SIGN_LOSS)), + Some(LintId::of(casts::PTR_AS_PTR)), + Some(LintId::of(checked_conversions::CHECKED_CONVERSIONS)), + Some(LintId::of(copies::SAME_FUNCTIONS_IN_IF_CONDITION)), + Some(LintId::of(copy_iterator::COPY_ITERATOR)), + Some(LintId::of(default::DEFAULT_TRAIT_ACCESS)), + Some(LintId::of(dereference::EXPLICIT_DEREF_METHODS)), + Some(LintId::of(dereference::REF_BINDING_TO_REFERENCE)), + Some(LintId::of(derive::EXPL_IMPL_CLONE_ON_COPY)), + Some(LintId::of(derive::UNSAFE_DERIVE_DESERIALIZE)), + Some(LintId::of(doc::DOC_MARKDOWN)), + Some(LintId::of(doc::MISSING_ERRORS_DOC)), + Some(LintId::of(doc::MISSING_PANICS_DOC)), + Some(LintId::of(empty_enum::EMPTY_ENUM)), + Some(LintId::of(enum_variants::MODULE_NAME_REPETITIONS)), + Some(LintId::of(eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS)), + Some(LintId::of(excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS)), + Some(LintId::of(excessive_bools::STRUCT_EXCESSIVE_BOOLS)), + Some(LintId::of(functions::MUST_USE_CANDIDATE)), + Some(LintId::of(functions::TOO_MANY_LINES)), + Some(LintId::of(if_not_else::IF_NOT_ELSE)), + Some(LintId::of(implicit_hasher::IMPLICIT_HASHER)), + Some(LintId::of(implicit_saturating_sub::IMPLICIT_SATURATING_SUB)), + Some(LintId::of(inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR)), + Some(LintId::of(infinite_iter::MAYBE_INFINITE_ITER)), + Some(LintId::of(invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS)), + Some(LintId::of(items_after_statements::ITEMS_AFTER_STATEMENTS)), + Some(LintId::of(iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR)), + Some(LintId::of(large_stack_arrays::LARGE_STACK_ARRAYS)), + Some(LintId::of(let_underscore::LET_UNDERSCORE_DROP)), + Some(LintId::of(literal_representation::LARGE_DIGIT_GROUPS)), + Some(LintId::of(literal_representation::UNREADABLE_LITERAL)), + Some(LintId::of(loops::EXPLICIT_INTO_ITER_LOOP)), + Some(LintId::of(loops::EXPLICIT_ITER_LOOP)), + Some(LintId::of(macro_use::MACRO_USE_IMPORTS)), + Some(LintId::of(manual_assert::MANUAL_ASSERT)), + Some(LintId::of(manual_ok_or::MANUAL_OK_OR)), + Some(LintId::of(match_on_vec_items::MATCH_ON_VEC_ITEMS)), + Some(LintId::of(matches::MATCH_BOOL)), + Some(LintId::of(matches::MATCH_SAME_ARMS)), + Some(LintId::of(matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS)), + Some(LintId::of(matches::MATCH_WILD_ERR_ARM)), + Some(LintId::of(matches::SINGLE_MATCH_ELSE)), + Some(LintId::of(methods::CLONED_INSTEAD_OF_COPIED)), + Some(LintId::of(methods::FILTER_MAP_NEXT)), + Some(LintId::of(methods::FLAT_MAP_OPTION)), + Some(LintId::of(methods::FROM_ITER_INSTEAD_OF_COLLECT)), + Some(LintId::of(methods::IMPLICIT_CLONE)), + Some(LintId::of(methods::INEFFICIENT_TO_STRING)), + Some(LintId::of(methods::MAP_UNWRAP_OR)), + Some(LintId::of(misc::FLOAT_CMP)), + Some(LintId::of(misc::USED_UNDERSCORE_BINDING)), + Some(LintId::of(mut_mut::MUT_MUT)), + Some(LintId::of(needless_bitwise_bool::NEEDLESS_BITWISE_BOOL)), + Some(LintId::of(needless_continue::NEEDLESS_CONTINUE)), + Some(LintId::of(needless_for_each::NEEDLESS_FOR_EACH)), + Some(LintId::of(needless_pass_by_value::NEEDLESS_PASS_BY_VALUE)), + Some(LintId::of(no_effect::NO_EFFECT_UNDERSCORE_BINDING)), + Some(LintId::of(non_expressive_names::MANY_SINGLE_CHAR_NAMES)), + Some(LintId::of(non_expressive_names::SIMILAR_NAMES)), + Some(LintId::of(pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE)), + Some(LintId::of(pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF)), + Some(LintId::of(ranges::RANGE_MINUS_ONE)), + Some(LintId::of(ranges::RANGE_PLUS_ONE)), + Some(LintId::of(redundant_else::REDUNDANT_ELSE)), + Some(LintId::of(ref_option_ref::REF_OPTION_REF)), + Some(LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE)), + Some(LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED)), + Some(LintId::of(strings::STRING_ADD_ASSIGN)), + Some(LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS)), + Some(LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS)), + Some(LintId::of(transmute::TRANSMUTE_PTR_TO_PTR)), + Some(LintId::of(types::LINKEDLIST)), + Some(LintId::of(types::OPTION_OPTION)), + Some(LintId::of(unicode::UNICODE_NOT_NFC)), + Some(LintId::of(unit_types::LET_UNIT_VALUE)), + Some(LintId::of(unnecessary_wraps::UNNECESSARY_WRAPS)), + Some(LintId::of(unnested_or_patterns::UNNESTED_OR_PATTERNS)), + Some(LintId::of(unused_async::UNUSED_ASYNC)), + Some(LintId::of(unused_self::UNUSED_SELF)), + Some(LintId::of(wildcard_imports::ENUM_GLOB_USE)), + Some(LintId::of(wildcard_imports::WILDCARD_IMPORTS)), + Some(LintId::of(zero_sized_map_values::ZERO_SIZED_MAP_VALUES)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_perf.rs b/clippy_lints/src/lib.register_perf.rs index c44ef124bfa0..ef7c9f3f1a30 100644 --- a/clippy_lints/src/lib.register_perf.rs +++ b/clippy_lints/src/lib.register_perf.rs @@ -2,29 +2,29 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![ - LintId::of(entry::MAP_ENTRY), - LintId::of(escape::BOXED_LOCAL), - LintId::of(format_args::FORMAT_IN_FORMAT_ARGS), - LintId::of(format_args::TO_STRING_IN_FORMAT_ARGS), - LintId::of(large_const_arrays::LARGE_CONST_ARRAYS), - LintId::of(large_enum_variant::LARGE_ENUM_VARIANT), - LintId::of(loops::MANUAL_MEMCPY), - LintId::of(loops::NEEDLESS_COLLECT), - LintId::of(methods::EXPECT_FUN_CALL), - LintId::of(methods::EXTEND_WITH_DRAIN), - LintId::of(methods::ITER_NTH), - LintId::of(methods::ITER_OVEREAGER_CLONED), - LintId::of(methods::MANUAL_STR_REPEAT), - LintId::of(methods::OR_FUN_CALL), - LintId::of(methods::SINGLE_CHAR_PATTERN), - LintId::of(methods::UNNECESSARY_TO_OWNED), - LintId::of(misc::CMP_OWNED), - LintId::of(redundant_clone::REDUNDANT_CLONE), - LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION), - LintId::of(stable_sort_primitive::STABLE_SORT_PRIMITIVE), - LintId::of(types::BOX_COLLECTION), - LintId::of(types::REDUNDANT_ALLOCATION), - LintId::of(vec::USELESS_VEC), - LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH), -]) +store.register_group(true, "clippy::perf", Some("clippy_perf"), [ + Some(LintId::of(entry::MAP_ENTRY)), + Some(LintId::of(escape::BOXED_LOCAL)), + Some(LintId::of(format_args::FORMAT_IN_FORMAT_ARGS)), + Some(LintId::of(format_args::TO_STRING_IN_FORMAT_ARGS)), + Some(LintId::of(large_const_arrays::LARGE_CONST_ARRAYS)), + Some(LintId::of(large_enum_variant::LARGE_ENUM_VARIANT)), + Some(LintId::of(loops::MANUAL_MEMCPY)), + Some(LintId::of(loops::NEEDLESS_COLLECT)), + Some(LintId::of(methods::EXPECT_FUN_CALL)), + Some(LintId::of(methods::EXTEND_WITH_DRAIN)), + Some(LintId::of(methods::ITER_NTH)), + Some(LintId::of(methods::ITER_OVEREAGER_CLONED)), + Some(LintId::of(methods::MANUAL_STR_REPEAT)), + Some(LintId::of(methods::OR_FUN_CALL)), + Some(LintId::of(methods::SINGLE_CHAR_PATTERN)), + Some(LintId::of(methods::UNNECESSARY_TO_OWNED)), + Some(LintId::of(misc::CMP_OWNED)), + Some(LintId::of(redundant_clone::REDUNDANT_CLONE)), + Some(LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION)), + Some(LintId::of(stable_sort_primitive::STABLE_SORT_PRIMITIVE)), + Some(LintId::of(types::BOX_COLLECTION)), + Some(LintId::of(types::REDUNDANT_ALLOCATION)), + Some(LintId::of(vec::USELESS_VEC)), + Some(LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_restriction.rs b/clippy_lints/src/lib.register_restriction.rs index 5a89fdb05a99..92dea5b14119 100644 --- a/clippy_lints/src/lib.register_restriction.rs +++ b/clippy_lints/src/lib.register_restriction.rs @@ -2,72 +2,72 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![ - LintId::of(arithmetic::FLOAT_ARITHMETIC), - LintId::of(arithmetic::INTEGER_ARITHMETIC), - LintId::of(as_conversions::AS_CONVERSIONS), - LintId::of(asm_syntax::INLINE_ASM_X86_ATT_SYNTAX), - LintId::of(asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX), - LintId::of(casts::FN_TO_NUMERIC_CAST_ANY), - LintId::of(create_dir::CREATE_DIR), - LintId::of(dbg_macro::DBG_MACRO), - LintId::of(default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK), - LintId::of(default_union_representation::DEFAULT_UNION_REPRESENTATION), - LintId::of(disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS), - LintId::of(else_if_without_else::ELSE_IF_WITHOUT_ELSE), - LintId::of(exhaustive_items::EXHAUSTIVE_ENUMS), - LintId::of(exhaustive_items::EXHAUSTIVE_STRUCTS), - LintId::of(exit::EXIT), - LintId::of(float_literal::LOSSY_FLOAT_LITERAL), - LintId::of(if_then_some_else_none::IF_THEN_SOME_ELSE_NONE), - LintId::of(implicit_return::IMPLICIT_RETURN), - LintId::of(indexing_slicing::INDEXING_SLICING), - LintId::of(inherent_impl::MULTIPLE_INHERENT_IMPL), - LintId::of(integer_division::INTEGER_DIVISION), - LintId::of(let_underscore::LET_UNDERSCORE_MUST_USE), - LintId::of(literal_representation::DECIMAL_LITERAL_REPRESENTATION), - LintId::of(map_err_ignore::MAP_ERR_IGNORE), - LintId::of(matches::REST_PAT_IN_FULLY_BOUND_STRUCTS), - LintId::of(matches::WILDCARD_ENUM_MATCH_ARM), - LintId::of(mem_forget::MEM_FORGET), - LintId::of(methods::CLONE_ON_REF_PTR), - LintId::of(methods::EXPECT_USED), - LintId::of(methods::FILETYPE_IS_FILE), - LintId::of(methods::GET_UNWRAP), - LintId::of(methods::UNWRAP_USED), - LintId::of(misc::FLOAT_CMP_CONST), - LintId::of(misc_early::SEPARATED_LITERAL_SUFFIX), - LintId::of(misc_early::UNNEEDED_FIELD_PATTERN), - LintId::of(misc_early::UNSEPARATED_LITERAL_SUFFIX), - LintId::of(missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS), - LintId::of(missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES), - LintId::of(missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS), - LintId::of(module_style::MOD_MODULE_FILES), - LintId::of(module_style::SELF_NAMED_MODULE_FILES), - LintId::of(modulo_arithmetic::MODULO_ARITHMETIC), - LintId::of(panic_in_result_fn::PANIC_IN_RESULT_FN), - LintId::of(panic_unimplemented::PANIC), - LintId::of(panic_unimplemented::TODO), - LintId::of(panic_unimplemented::UNIMPLEMENTED), - LintId::of(panic_unimplemented::UNREACHABLE), - LintId::of(pattern_type_mismatch::PATTERN_TYPE_MISMATCH), - LintId::of(same_name_method::SAME_NAME_METHOD), - LintId::of(shadow::SHADOW_REUSE), - LintId::of(shadow::SHADOW_SAME), - LintId::of(shadow::SHADOW_UNRELATED), - LintId::of(single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES), - LintId::of(strings::STRING_ADD), - LintId::of(strings::STRING_SLICE), - LintId::of(strings::STRING_TO_STRING), - LintId::of(strings::STR_TO_STRING), - LintId::of(types::RC_BUFFER), - LintId::of(types::RC_MUTEX), - LintId::of(undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS), - LintId::of(unicode::NON_ASCII_LITERAL), - LintId::of(unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS), - LintId::of(unwrap_in_result::UNWRAP_IN_RESULT), - LintId::of(verbose_file_reads::VERBOSE_FILE_READS), - LintId::of(write::PRINT_STDERR), - LintId::of(write::PRINT_STDOUT), - LintId::of(write::USE_DEBUG), -]) +store.register_group(true, "clippy::restriction", Some("clippy_restriction"), [ + Some(LintId::of(arithmetic::FLOAT_ARITHMETIC)), + Some(LintId::of(arithmetic::INTEGER_ARITHMETIC)), + Some(LintId::of(as_conversions::AS_CONVERSIONS)), + Some(LintId::of(asm_syntax::INLINE_ASM_X86_ATT_SYNTAX)), + Some(LintId::of(asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX)), + Some(LintId::of(casts::FN_TO_NUMERIC_CAST_ANY)), + Some(LintId::of(create_dir::CREATE_DIR)), + Some(LintId::of(dbg_macro::DBG_MACRO)), + Some(LintId::of(default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK)), + Some(LintId::of(default_union_representation::DEFAULT_UNION_REPRESENTATION)), + Some(LintId::of(disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS)), + Some(LintId::of(else_if_without_else::ELSE_IF_WITHOUT_ELSE)), + Some(LintId::of(exhaustive_items::EXHAUSTIVE_ENUMS)), + Some(LintId::of(exhaustive_items::EXHAUSTIVE_STRUCTS)), + Some(LintId::of(exit::EXIT)), + Some(LintId::of(float_literal::LOSSY_FLOAT_LITERAL)), + Some(LintId::of(if_then_some_else_none::IF_THEN_SOME_ELSE_NONE)), + Some(LintId::of(implicit_return::IMPLICIT_RETURN)), + Some(LintId::of(indexing_slicing::INDEXING_SLICING)), + Some(LintId::of(inherent_impl::MULTIPLE_INHERENT_IMPL)), + Some(LintId::of(integer_division::INTEGER_DIVISION)), + Some(LintId::of(let_underscore::LET_UNDERSCORE_MUST_USE)), + Some(LintId::of(literal_representation::DECIMAL_LITERAL_REPRESENTATION)), + Some(LintId::of(map_err_ignore::MAP_ERR_IGNORE)), + Some(LintId::of(matches::REST_PAT_IN_FULLY_BOUND_STRUCTS)), + Some(LintId::of(matches::WILDCARD_ENUM_MATCH_ARM)), + Some(LintId::of(mem_forget::MEM_FORGET)), + Some(LintId::of(methods::CLONE_ON_REF_PTR)), + Some(LintId::of(methods::EXPECT_USED)), + Some(LintId::of(methods::FILETYPE_IS_FILE)), + Some(LintId::of(methods::GET_UNWRAP)), + Some(LintId::of(methods::UNWRAP_USED)), + Some(LintId::of(misc::FLOAT_CMP_CONST)), + Some(LintId::of(misc_early::SEPARATED_LITERAL_SUFFIX)), + Some(LintId::of(misc_early::UNNEEDED_FIELD_PATTERN)), + Some(LintId::of(misc_early::UNSEPARATED_LITERAL_SUFFIX)), + Some(LintId::of(missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS)), + Some(LintId::of(missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES)), + Some(LintId::of(missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS)), + Some(LintId::of(module_style::MOD_MODULE_FILES)), + Some(LintId::of(module_style::SELF_NAMED_MODULE_FILES)), + Some(LintId::of(modulo_arithmetic::MODULO_ARITHMETIC)), + Some(LintId::of(panic_in_result_fn::PANIC_IN_RESULT_FN)), + Some(LintId::of(panic_unimplemented::PANIC)), + Some(LintId::of(panic_unimplemented::TODO)), + Some(LintId::of(panic_unimplemented::UNIMPLEMENTED)), + Some(LintId::of(panic_unimplemented::UNREACHABLE)), + Some(LintId::of(pattern_type_mismatch::PATTERN_TYPE_MISMATCH)), + Some(LintId::of(same_name_method::SAME_NAME_METHOD)), + Some(LintId::of(shadow::SHADOW_REUSE)), + Some(LintId::of(shadow::SHADOW_SAME)), + Some(LintId::of(shadow::SHADOW_UNRELATED)), + Some(LintId::of(single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES)), + Some(LintId::of(strings::STRING_ADD)), + Some(LintId::of(strings::STRING_SLICE)), + Some(LintId::of(strings::STRING_TO_STRING)), + Some(LintId::of(strings::STR_TO_STRING)), + Some(LintId::of(types::RC_BUFFER)), + Some(LintId::of(types::RC_MUTEX)), + Some(LintId::of(undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS)), + Some(LintId::of(unicode::NON_ASCII_LITERAL)), + Some(LintId::of(unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS)), + Some(LintId::of(unwrap_in_result::UNWRAP_IN_RESULT)), + Some(LintId::of(verbose_file_reads::VERBOSE_FILE_READS)), + Some(LintId::of(write::PRINT_STDERR)), + Some(LintId::of(write::PRINT_STDOUT)), + Some(LintId::of(write::USE_DEBUG)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_style.rs b/clippy_lints/src/lib.register_style.rs index 05211476ff23..6648632f79ea 100644 --- a/clippy_lints/src/lib.register_style.rs +++ b/clippy_lints/src/lib.register_style.rs @@ -2,117 +2,117 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::style", Some("clippy_style"), vec![ - LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS), - LintId::of(assign_ops::ASSIGN_OP_PATTERN), - LintId::of(blacklisted_name::BLACKLISTED_NAME), - LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS), - LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON), - LintId::of(casts::FN_TO_NUMERIC_CAST), - LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION), - LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF), - LintId::of(collapsible_if::COLLAPSIBLE_IF), - LintId::of(collapsible_match::COLLAPSIBLE_MATCH), - LintId::of(comparison_chain::COMPARISON_CHAIN), - LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT), - LintId::of(dereference::NEEDLESS_BORROW), - LintId::of(disallowed_methods::DISALLOWED_METHODS), - LintId::of(disallowed_types::DISALLOWED_TYPES), - LintId::of(doc::MISSING_SAFETY_DOC), - LintId::of(doc::NEEDLESS_DOCTEST_MAIN), - LintId::of(enum_variants::ENUM_VARIANT_NAMES), - LintId::of(enum_variants::MODULE_INCEPTION), - LintId::of(eq_op::OP_REF), - LintId::of(eta_reduction::REDUNDANT_CLOSURE), - LintId::of(float_literal::EXCESSIVE_PRECISION), - LintId::of(from_over_into::FROM_OVER_INTO), - LintId::of(from_str_radix_10::FROM_STR_RADIX_10), - LintId::of(functions::DOUBLE_MUST_USE), - LintId::of(functions::MUST_USE_UNIT), - LintId::of(functions::RESULT_UNIT_ERR), - LintId::of(inherent_to_string::INHERENT_TO_STRING), - LintId::of(init_numbered_fields::INIT_NUMBERED_FIELDS), - LintId::of(len_zero::COMPARISON_TO_EMPTY), - LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY), - LintId::of(len_zero::LEN_ZERO), - LintId::of(literal_representation::INCONSISTENT_DIGIT_GROUPING), - LintId::of(literal_representation::UNUSUAL_BYTE_GROUPINGS), - LintId::of(loops::FOR_KV_MAP), - LintId::of(loops::NEEDLESS_RANGE_LOOP), - LintId::of(loops::SAME_ITEM_PUSH), - LintId::of(loops::WHILE_LET_ON_ITERATOR), - LintId::of(main_recursion::MAIN_RECURSION), - LintId::of(manual_async_fn::MANUAL_ASYNC_FN), - LintId::of(manual_bits::MANUAL_BITS), - LintId::of(manual_map::MANUAL_MAP), - LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE), - LintId::of(map_clone::MAP_CLONE), - LintId::of(match_result_ok::MATCH_RESULT_OK), - LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH), - LintId::of(matches::MATCH_LIKE_MATCHES_MACRO), - LintId::of(matches::MATCH_OVERLAPPING_ARM), - LintId::of(matches::MATCH_REF_PATS), - LintId::of(matches::REDUNDANT_PATTERN_MATCHING), - LintId::of(matches::SINGLE_MATCH), - LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE), - LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT), - LintId::of(methods::BYTES_NTH), - LintId::of(methods::CHARS_LAST_CMP), - LintId::of(methods::CHARS_NEXT_CMP), - LintId::of(methods::INTO_ITER_ON_REF), - LintId::of(methods::ITER_CLONED_COLLECT), - LintId::of(methods::ITER_NEXT_SLICE), - LintId::of(methods::ITER_NTH_ZERO), - LintId::of(methods::ITER_SKIP_NEXT), - LintId::of(methods::MANUAL_SATURATING_ARITHMETIC), - LintId::of(methods::MAP_COLLECT_RESULT_UNIT), - LintId::of(methods::NEW_RET_NO_SELF), - LintId::of(methods::OK_EXPECT), - LintId::of(methods::OPTION_MAP_OR_NONE), - LintId::of(methods::RESULT_MAP_OR_INTO_OPTION), - LintId::of(methods::SHOULD_IMPLEMENT_TRAIT), - LintId::of(methods::SINGLE_CHAR_ADD_STR), - LintId::of(methods::STRING_EXTEND_CHARS), - LintId::of(methods::UNNECESSARY_FOLD), - LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS), - LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT), - LintId::of(methods::WRONG_SELF_CONVENTION), - LintId::of(misc::TOPLEVEL_REF_ARG), - LintId::of(misc::ZERO_PTR), - LintId::of(misc_early::BUILTIN_TYPE_SHADOW), - LintId::of(misc_early::DOUBLE_NEG), - LintId::of(misc_early::DUPLICATE_UNDERSCORE_ARGUMENT), - LintId::of(misc_early::MIXED_CASE_HEX_LITERALS), - LintId::of(misc_early::REDUNDANT_PATTERN), - LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK), - LintId::of(mut_reference::UNNECESSARY_MUT_PASSED), - LintId::of(needless_late_init::NEEDLESS_LATE_INIT), - LintId::of(neg_multiply::NEG_MULTIPLY), - LintId::of(new_without_default::NEW_WITHOUT_DEFAULT), - LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST), - LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST), - LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS), - LintId::of(ptr::CMP_NULL), - LintId::of(ptr::PTR_ARG), - LintId::of(ptr_eq::PTR_EQ), - LintId::of(question_mark::QUESTION_MARK), - LintId::of(ranges::MANUAL_RANGE_CONTAINS), - LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES), - LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES), - LintId::of(returns::LET_AND_RETURN), - LintId::of(returns::NEEDLESS_RETURN), - LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS), - LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS), - LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS), - LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME), - LintId::of(try_err::TRY_ERR), - LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME), - LintId::of(unused_unit::UNUSED_UNIT), - LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS), - LintId::of(write::PRINTLN_EMPTY_STRING), - LintId::of(write::PRINT_LITERAL), - LintId::of(write::PRINT_WITH_NEWLINE), - LintId::of(write::WRITELN_EMPTY_STRING), - LintId::of(write::WRITE_LITERAL), - LintId::of(write::WRITE_WITH_NEWLINE), -]) +store.register_group(true, "clippy::style", Some("clippy_style"), [ + Some(LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS)), + Some(LintId::of(assign_ops::ASSIGN_OP_PATTERN)), + Some(LintId::of(blacklisted_name::BLACKLISTED_NAME)), + Some(LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS)), + Some(LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON)), + Some(LintId::of(casts::FN_TO_NUMERIC_CAST)), + Some(LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION)), + Some(LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF)), + Some(LintId::of(collapsible_if::COLLAPSIBLE_IF)), + Some(LintId::of(collapsible_match::COLLAPSIBLE_MATCH)), + Some(LintId::of(comparison_chain::COMPARISON_CHAIN)), + Some(LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT)), + Some(LintId::of(dereference::NEEDLESS_BORROW)), + Some(LintId::of(disallowed_methods::DISALLOWED_METHODS)), + Some(LintId::of(disallowed_types::DISALLOWED_TYPES)), + Some(LintId::of(doc::MISSING_SAFETY_DOC)), + Some(LintId::of(doc::NEEDLESS_DOCTEST_MAIN)), + Some(LintId::of(enum_variants::ENUM_VARIANT_NAMES)), + Some(LintId::of(enum_variants::MODULE_INCEPTION)), + Some(LintId::of(eq_op::OP_REF)), + Some(LintId::of(eta_reduction::REDUNDANT_CLOSURE)), + Some(LintId::of(float_literal::EXCESSIVE_PRECISION)), + Some(LintId::of(from_over_into::FROM_OVER_INTO)), + Some(LintId::of(from_str_radix_10::FROM_STR_RADIX_10)), + Some(LintId::of(functions::DOUBLE_MUST_USE)), + Some(LintId::of(functions::MUST_USE_UNIT)), + Some(LintId::of(functions::RESULT_UNIT_ERR)), + Some(LintId::of(inherent_to_string::INHERENT_TO_STRING)), + Some(LintId::of(init_numbered_fields::INIT_NUMBERED_FIELDS)), + Some(LintId::of(len_zero::COMPARISON_TO_EMPTY)), + Some(LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY)), + Some(LintId::of(len_zero::LEN_ZERO)), + Some(LintId::of(literal_representation::INCONSISTENT_DIGIT_GROUPING)), + Some(LintId::of(literal_representation::UNUSUAL_BYTE_GROUPINGS)), + Some(LintId::of(loops::FOR_KV_MAP)), + Some(LintId::of(loops::NEEDLESS_RANGE_LOOP)), + Some(LintId::of(loops::SAME_ITEM_PUSH)), + Some(LintId::of(loops::WHILE_LET_ON_ITERATOR)), + Some(LintId::of(main_recursion::MAIN_RECURSION)), + Some(LintId::of(manual_async_fn::MANUAL_ASYNC_FN)), + Some(LintId::of(manual_bits::MANUAL_BITS)), + Some(LintId::of(manual_map::MANUAL_MAP)), + Some(LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE)), + Some(LintId::of(map_clone::MAP_CLONE)), + Some(LintId::of(match_result_ok::MATCH_RESULT_OK)), + Some(LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH)), + Some(LintId::of(matches::MATCH_LIKE_MATCHES_MACRO)), + Some(LintId::of(matches::MATCH_OVERLAPPING_ARM)), + Some(LintId::of(matches::MATCH_REF_PATS)), + Some(LintId::of(matches::REDUNDANT_PATTERN_MATCHING)), + Some(LintId::of(matches::SINGLE_MATCH)), + Some(LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE)), + Some(LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT)), + Some(LintId::of(methods::BYTES_NTH)), + Some(LintId::of(methods::CHARS_LAST_CMP)), + Some(LintId::of(methods::CHARS_NEXT_CMP)), + Some(LintId::of(methods::INTO_ITER_ON_REF)), + Some(LintId::of(methods::ITER_CLONED_COLLECT)), + Some(LintId::of(methods::ITER_NEXT_SLICE)), + Some(LintId::of(methods::ITER_NTH_ZERO)), + Some(LintId::of(methods::ITER_SKIP_NEXT)), + Some(LintId::of(methods::MANUAL_SATURATING_ARITHMETIC)), + Some(LintId::of(methods::MAP_COLLECT_RESULT_UNIT)), + Some(LintId::of(methods::NEW_RET_NO_SELF)), + Some(LintId::of(methods::OK_EXPECT)), + Some(LintId::of(methods::OPTION_MAP_OR_NONE)), + Some(LintId::of(methods::RESULT_MAP_OR_INTO_OPTION)), + Some(LintId::of(methods::SHOULD_IMPLEMENT_TRAIT)), + Some(LintId::of(methods::SINGLE_CHAR_ADD_STR)), + Some(LintId::of(methods::STRING_EXTEND_CHARS)), + Some(LintId::of(methods::UNNECESSARY_FOLD)), + Some(LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS)), + Some(LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT)), + Some(LintId::of(methods::WRONG_SELF_CONVENTION)), + Some(LintId::of(misc::TOPLEVEL_REF_ARG)), + Some(LintId::of(misc::ZERO_PTR)), + Some(LintId::of(misc_early::BUILTIN_TYPE_SHADOW)), + Some(LintId::of(misc_early::DOUBLE_NEG)), + Some(LintId::of(misc_early::DUPLICATE_UNDERSCORE_ARGUMENT)), + Some(LintId::of(misc_early::MIXED_CASE_HEX_LITERALS)), + Some(LintId::of(misc_early::REDUNDANT_PATTERN)), + Some(LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK)), + Some(LintId::of(mut_reference::UNNECESSARY_MUT_PASSED)), + Some(LintId::of(needless_late_init::NEEDLESS_LATE_INIT)), + Some(LintId::of(neg_multiply::NEG_MULTIPLY)), + Some(LintId::of(new_without_default::NEW_WITHOUT_DEFAULT)), + Some(LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST)), + Some(LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST)), + Some(LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS)), + Some(LintId::of(ptr::CMP_NULL)), + Some(LintId::of(ptr::PTR_ARG)), + Some(LintId::of(ptr_eq::PTR_EQ)), + Some(LintId::of(question_mark::QUESTION_MARK)), + Some(LintId::of(ranges::MANUAL_RANGE_CONTAINS)), + Some(LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES)), + Some(LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES)), + Some(LintId::of(returns::LET_AND_RETURN)), + Some(LintId::of(returns::NEEDLESS_RETURN)), + Some(LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS)), + Some(LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS)), + Some(LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS)), + Some(LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME)), + Some(LintId::of(try_err::TRY_ERR)), + Some(LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME)), + Some(LintId::of(unused_unit::UNUSED_UNIT)), + Some(LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS)), + Some(LintId::of(write::PRINTLN_EMPTY_STRING)), + Some(LintId::of(write::PRINT_LITERAL)), + Some(LintId::of(write::PRINT_WITH_NEWLINE)), + Some(LintId::of(write::WRITELN_EMPTY_STRING)), + Some(LintId::of(write::WRITE_LITERAL)), + Some(LintId::of(write::WRITE_WITH_NEWLINE)), +].iter().copied().flatten().collect::>()) diff --git a/clippy_lints/src/lib.register_suspicious.rs b/clippy_lints/src/lib.register_suspicious.rs index 10f8ae4b7f7f..37b6225e6450 100644 --- a/clippy_lints/src/lib.register_suspicious.rs +++ b/clippy_lints/src/lib.register_suspicious.rs @@ -2,20 +2,20 @@ // Use that command to update this file and do not edit by hand. // Manual edits will be overwritten. -store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec![ - LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP), - LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS), - LintId::of(eval_order_dependence::EVAL_ORDER_DEPENDENCE), - LintId::of(float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS), - LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING), - LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING), - LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING), - LintId::of(loops::EMPTY_LOOP), - LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES), - LintId::of(loops::MUT_RANGE_BOUND), - LintId::of(methods::SUSPICIOUS_MAP), - LintId::of(mut_key::MUTABLE_KEY_TYPE), - LintId::of(octal_escapes::OCTAL_ESCAPES), - LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL), - LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL), -]) +store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), [ + Some(LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP)), + Some(LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS)), + Some(LintId::of(eval_order_dependence::EVAL_ORDER_DEPENDENCE)), + Some(LintId::of(float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS)), + Some(LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING)), + Some(LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING)), + Some(LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING)), + Some(LintId::of(loops::EMPTY_LOOP)), + Some(LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES)), + Some(LintId::of(loops::MUT_RANGE_BOUND)), + Some(LintId::of(methods::SUSPICIOUS_MAP)), + Some(LintId::of(mut_key::MUTABLE_KEY_TYPE)), + Some(LintId::of(octal_escapes::OCTAL_ESCAPES)), + Some(LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL)), + Some(LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL)), +].iter().copied().flatten().collect::>()) From bc43b89ed64fe08402ec01154567dbdf0df6b275 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Tue, 15 Feb 2022 00:28:04 +0100 Subject: [PATCH 4/9] Set version to `nightly` for `1.60.0` lints --- clippy_lints/src/borrow_as_ptr.rs | 2 +- clippy_lints/src/default_union_representation.rs | 2 +- clippy_lints/src/lib.register_all.rs | 4 ++-- clippy_lints/src/lib.register_correctness.rs | 2 +- clippy_lints/src/lib.register_pedantic.rs | 2 +- clippy_lints/src/lib.register_restriction.rs | 2 +- clippy_lints/src/lib.register_style.rs | 2 +- clippy_lints/src/manual_bits.rs | 2 +- clippy_lints/src/transmute/mod.rs | 2 +- clippy_lints/src/utils/internal_lints.rs | 5 +++-- tests/ui-internal/check_clippy_version_attribute.stderr | 4 ++-- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/clippy_lints/src/borrow_as_ptr.rs b/clippy_lints/src/borrow_as_ptr.rs index 9f8eb488c29b..6c1f5ff3c193 100644 --- a/clippy_lints/src/borrow_as_ptr.rs +++ b/clippy_lints/src/borrow_as_ptr.rs @@ -36,7 +36,7 @@ declare_clippy_lint! { /// let mut val_mut = 1; /// let p_mut = std::ptr::addr_of_mut!(val_mut); /// ``` - #[clippy::version = "1.60.0"] + #[clippy::version = "nightly"] pub BORROW_AS_PTR, pedantic, "borrowing just to cast to a raw pointer" diff --git a/clippy_lints/src/default_union_representation.rs b/clippy_lints/src/default_union_representation.rs index 9b5da0bd8a66..bc3c31c53c28 100644 --- a/clippy_lints/src/default_union_representation.rs +++ b/clippy_lints/src/default_union_representation.rs @@ -43,7 +43,7 @@ declare_clippy_lint! { /// }; /// } /// ``` - #[clippy::version = "1.60.0"] + #[clippy::version = "nightly"] pub DEFAULT_UNION_REPRESENTATION, restriction, "unions without a `#[repr(C)]` attribute" diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs index e45f25eab0e8..1fed7aba41a2 100644 --- a/clippy_lints/src/lib.register_all.rs +++ b/clippy_lints/src/lib.register_all.rs @@ -115,7 +115,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), [ Some(LintId::of(loops::WHILE_LET_ON_ITERATOR)), Some(LintId::of(main_recursion::MAIN_RECURSION)), Some(LintId::of(manual_async_fn::MANUAL_ASYNC_FN)), - Some(LintId::of(manual_bits::MANUAL_BITS)), + clippy_utils::nightly::is_nightly_run().then_some(LintId::of(manual_bits::MANUAL_BITS)), Some(LintId::of(manual_map::MANUAL_MAP)), Some(LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE)), Some(LintId::of(manual_strip::MANUAL_STRIP)), @@ -277,7 +277,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), [ Some(LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT)), Some(LintId::of(transmute::TRANSMUTE_NUM_TO_BYTES)), Some(LintId::of(transmute::TRANSMUTE_PTR_TO_REF)), - Some(LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR)), + clippy_utils::nightly::is_nightly_run().then_some(LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR)), Some(LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE)), Some(LintId::of(transmute::WRONG_TRANSMUTE)), Some(LintId::of(transmuting_null::TRANSMUTING_NULL)), diff --git a/clippy_lints/src/lib.register_correctness.rs b/clippy_lints/src/lib.register_correctness.rs index 7cce7f29b60e..9de565afd9ba 100644 --- a/clippy_lints/src/lib.register_correctness.rs +++ b/clippy_lints/src/lib.register_correctness.rs @@ -58,7 +58,7 @@ store.register_group(true, "clippy::correctness", Some("clippy_correctness"), [ Some(LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT)), Some(LintId::of(swap::ALMOST_SWAPPED)), Some(LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY)), - Some(LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR)), + clippy_utils::nightly::is_nightly_run().then_some(LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR)), Some(LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE)), Some(LintId::of(transmute::WRONG_TRANSMUTE)), Some(LintId::of(transmuting_null::TRANSMUTING_NULL)), diff --git a/clippy_lints/src/lib.register_pedantic.rs b/clippy_lints/src/lib.register_pedantic.rs index 7f3e4696405b..bfc7fb2c00e3 100644 --- a/clippy_lints/src/lib.register_pedantic.rs +++ b/clippy_lints/src/lib.register_pedantic.rs @@ -7,7 +7,7 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), [ Some(LintId::of(await_holding_invalid::AWAIT_HOLDING_LOCK)), Some(LintId::of(await_holding_invalid::AWAIT_HOLDING_REFCELL_REF)), Some(LintId::of(bit_mask::VERBOSE_BIT_MASK)), - Some(LintId::of(borrow_as_ptr::BORROW_AS_PTR)), + clippy_utils::nightly::is_nightly_run().then_some(LintId::of(borrow_as_ptr::BORROW_AS_PTR)), Some(LintId::of(bytecount::NAIVE_BYTECOUNT)), Some(LintId::of(case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS)), Some(LintId::of(casts::CAST_LOSSLESS)), diff --git a/clippy_lints/src/lib.register_restriction.rs b/clippy_lints/src/lib.register_restriction.rs index 92dea5b14119..1e082529c148 100644 --- a/clippy_lints/src/lib.register_restriction.rs +++ b/clippy_lints/src/lib.register_restriction.rs @@ -12,7 +12,7 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), [ Some(LintId::of(create_dir::CREATE_DIR)), Some(LintId::of(dbg_macro::DBG_MACRO)), Some(LintId::of(default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK)), - Some(LintId::of(default_union_representation::DEFAULT_UNION_REPRESENTATION)), + clippy_utils::nightly::is_nightly_run().then_some(LintId::of(default_union_representation::DEFAULT_UNION_REPRESENTATION)), Some(LintId::of(disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS)), Some(LintId::of(else_if_without_else::ELSE_IF_WITHOUT_ELSE)), Some(LintId::of(exhaustive_items::EXHAUSTIVE_ENUMS)), diff --git a/clippy_lints/src/lib.register_style.rs b/clippy_lints/src/lib.register_style.rs index 6648632f79ea..82996e749a5a 100644 --- a/clippy_lints/src/lib.register_style.rs +++ b/clippy_lints/src/lib.register_style.rs @@ -43,7 +43,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), [ Some(LintId::of(loops::WHILE_LET_ON_ITERATOR)), Some(LintId::of(main_recursion::MAIN_RECURSION)), Some(LintId::of(manual_async_fn::MANUAL_ASYNC_FN)), - Some(LintId::of(manual_bits::MANUAL_BITS)), + clippy_utils::nightly::is_nightly_run().then_some(LintId::of(manual_bits::MANUAL_BITS)), Some(LintId::of(manual_map::MANUAL_MAP)), Some(LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE)), Some(LintId::of(map_clone::MAP_CLONE)), diff --git a/clippy_lints/src/manual_bits.rs b/clippy_lints/src/manual_bits.rs index 809aa168a7a0..f297add38a1b 100644 --- a/clippy_lints/src/manual_bits.rs +++ b/clippy_lints/src/manual_bits.rs @@ -25,7 +25,7 @@ declare_clippy_lint! { /// ```rust /// usize::BITS; /// ``` - #[clippy::version = "1.60.0"] + #[clippy::version = "nightly"] pub MANUAL_BITS, style, "manual implementation of `size_of::() * 8` can be simplified with `T::BITS`" diff --git a/clippy_lints/src/transmute/mod.rs b/clippy_lints/src/transmute/mod.rs index 22a8c53a5852..d66470d45824 100644 --- a/clippy_lints/src/transmute/mod.rs +++ b/clippy_lints/src/transmute/mod.rs @@ -375,7 +375,7 @@ declare_clippy_lint! { /// struct Foo(u32, T); /// let _ = unsafe { core::mem::transmute::, Foo>(Foo(0u32, 0u32)) }; /// ``` - #[clippy::version = "1.60.0"] + #[clippy::version = "nightly"] pub TRANSMUTE_UNDEFINED_REPR, correctness, "transmute to or from a type with an undefined representation" diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index dc0f515bfe5c..11c90647ccc0 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -322,6 +322,7 @@ declare_clippy_lint! { /// /// Valid values are: /// * "pre 1.29.0" + /// * "nightly" /// * any valid semantic version pub INVALID_CLIPPY_VERSION_ATTRIBUTE, internal, @@ -491,7 +492,7 @@ fn check_invalid_clippy_version_attribute(cx: &LateContext<'_>, item: &'_ Item<' if let Some(value) = extract_clippy_version_value(cx, item) { // The `sym!` macro doesn't work as it only expects a single token. // It's better to keep it this way and have a direct `Symbol::intern` call here. - if value == Symbol::intern("pre 1.29.0") { + if value == Symbol::intern("pre 1.29.0") || value == Symbol::intern("nightly") { return; } @@ -502,7 +503,7 @@ fn check_invalid_clippy_version_attribute(cx: &LateContext<'_>, item: &'_ Item<' item.span, "this item has an invalid `clippy::version` attribute", None, - "please use a valid sematic version, see `doc/adding_lints.md`", + "please use a valid sematic version or `nightly`, see `doc/adding_lints.md`", ); } } else { diff --git a/tests/ui-internal/check_clippy_version_attribute.stderr b/tests/ui-internal/check_clippy_version_attribute.stderr index 9302e02ccb9c..e15463418f10 100644 --- a/tests/ui-internal/check_clippy_version_attribute.stderr +++ b/tests/ui-internal/check_clippy_version_attribute.stderr @@ -16,7 +16,7 @@ note: the lint level is defined here LL | #![deny(clippy::internal)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::invalid_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]` - = help: please use a valid sematic version, see `doc/adding_lints.md` + = help: please use a valid sematic version or `nightly`, 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 item has an invalid `clippy::version` attribute @@ -31,7 +31,7 @@ LL | | report_in_external_macro: true LL | | } | |_^ | - = help: please use a valid sematic version, see `doc/adding_lints.md` + = help: please use a valid sematic version or `nightly`, 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 From 1751f4e9db6d26040d97d21121a773fe3e265755 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Tue, 15 Feb 2022 15:30:23 +0100 Subject: [PATCH 5/9] Fix CI and force inline for nightly functions --- clippy_dev/src/update_lints.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs index eca7487358ac..4f538dfee8ab 100644 --- a/clippy_dev/src/update_lints.rs +++ b/clippy_dev/src/update_lints.rs @@ -320,6 +320,37 @@ fn gen_deprecated<'a>(lints: impl Iterator) -> String { output } +fn gen_nightly_lint_list<'a>( + internal_lints: impl Iterator, + usable_lints: impl Iterator, +) -> String { + let mut details: Vec<_> = internal_lints + .map(|l| (false, l)) + .chain(usable_lints.map(|l| (true, l))) + .filter(|(_, l)| l.version.as_ref().map_or(false, |v| v == "nightly")) + .map(|(p, l)| (p, &l.module, l.name.to_uppercase())) + .collect(); + details.sort_unstable(); + + let mut output = GENERATED_FILE_COMMENT.to_string(); + output.push_str("clippy_utils::nightly::set_nightly_lints([\n"); + // The test lint "FOREVER_NIGHTLY_LINT" is in the `internal_warn` group which is + // not processed by `update_lints`. For testing purposes we still need the lint to be + // registered in the `nightly_lints` list. This manually adds this one lint. + output.push_str(" #[cfg(feature = \"internal\")]\n"); + output.push_str(" LintId::of(utils::internal_lints::FOREVER_NIGHTLY_LINT),\n"); + + for (is_public, module_name, lint_name) in details { + if !is_public { + output.push_str(" #[cfg(feature = \"internal\")]\n"); + } + output.push_str(&format!(" LintId::of({}::{}),\n", module_name, lint_name)); + } + output.push_str("])\n"); + + output +} + /// Generates the code for registering lints #[must_use] fn gen_register_lint_list<'a>( From e504db3884d24315bf67fbd8b6628def908c0938 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Tue, 15 Feb 2022 22:30:28 +0100 Subject: [PATCH 6/9] Use a macro to create `declare_clippy_lint` macro (DRY) This was first suggested by `@camsteffen` in rust-lang/rust-clippy#6830. Back then, it was decided to avoid this implementation to keep the macro simple. Now it makes sense to again use this macro, as the implementation of the macro will get a bit more complicated to support nightly lints. Credit where credit is due: Co-authored-by: camsteffen --- clippy_lints/src/lib.rs | 86 +++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 55 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index f2661a82c0d2..a3400b6277ed 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -97,65 +97,41 @@ use rustc_session::Session; /// } /// ``` /// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints -#[macro_export] -macro_rules! declare_clippy_lint { - { $(#[$attr:meta])* pub $name:tt, style, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, correctness, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Deny, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, suspicious, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, complexity, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, perf, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, pedantic, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, restriction, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, cargo, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, nursery, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, internal, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true - } - }; - { $(#[$attr:meta])* pub $name:tt, internal_warn, $description:tt } => { - declare_tool_lint! { - $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true +macro_rules! declare_clippy_lint_macro { + ({ $($category:tt: $level:tt,)* }, $d:tt) => { + macro_rules! declare_clippy_lint { + $( + ($d(#[$d meta:meta])* pub $d name:tt, $category, $d description:tt) => { + declare_tool_lint! { + $d(#[$d meta])* + pub clippy::$d name, + $level, + $d description, + report_in_external_macro: true + } + }; + )* } }; } +declare_clippy_lint_macro! { + { + correctness: Deny, + complexity: Warn, + internal_warn: Warn, + perf: Warn, + suspicious: Warn, + style: Warn, + cargo: Allow, + internal: Allow, + nursery: Allow, + pedantic: Allow, + restriction: Allow, + }, + $ +} + #[cfg(feature = "internal")] mod deprecated_lints; #[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))] From dfe5cddb302ed572a8fc413656f2a0b653d1a8d9 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Thu, 17 Feb 2022 22:52:19 +0100 Subject: [PATCH 7/9] Remove `declare_tool_lint!` import from Clippy --- clippy_lints/src/absurd_extreme_comparisons.rs | 2 +- clippy_lints/src/approx_const.rs | 2 +- clippy_lints/src/arithmetic.rs | 2 +- clippy_lints/src/as_conversions.rs | 2 +- clippy_lints/src/asm_syntax.rs | 2 +- clippy_lints/src/assertions_on_constants.rs | 2 +- clippy_lints/src/assign_ops.rs | 2 +- clippy_lints/src/async_yields_async.rs | 2 +- clippy_lints/src/attrs.rs | 2 +- clippy_lints/src/await_holding_invalid.rs | 2 +- clippy_lints/src/bit_mask.rs | 2 +- clippy_lints/src/blacklisted_name.rs | 2 +- clippy_lints/src/blocks_in_if_conditions.rs | 2 +- clippy_lints/src/bool_assert_comparison.rs | 2 +- clippy_lints/src/booleans.rs | 2 +- clippy_lints/src/borrow_as_ptr.rs | 2 +- clippy_lints/src/bytecount.rs | 2 +- clippy_lints/src/cargo/mod.rs | 2 +- clippy_lints/src/case_sensitive_file_extension_comparisons.rs | 2 +- clippy_lints/src/casts/mod.rs | 2 +- clippy_lints/src/checked_conversions.rs | 2 +- clippy_lints/src/cognitive_complexity.rs | 2 +- clippy_lints/src/collapsible_if.rs | 2 +- clippy_lints/src/collapsible_match.rs | 2 +- clippy_lints/src/comparison_chain.rs | 2 +- clippy_lints/src/copies.rs | 2 +- clippy_lints/src/copy_iterator.rs | 2 +- clippy_lints/src/create_dir.rs | 2 +- clippy_lints/src/dbg_macro.rs | 2 +- clippy_lints/src/default.rs | 2 +- clippy_lints/src/default_numeric_fallback.rs | 2 +- clippy_lints/src/default_union_representation.rs | 2 +- clippy_lints/src/dereference.rs | 2 +- clippy_lints/src/derivable_impls.rs | 2 +- clippy_lints/src/derive.rs | 2 +- clippy_lints/src/disallowed_methods.rs | 2 +- clippy_lints/src/disallowed_script_idents.rs | 2 +- clippy_lints/src/disallowed_types.rs | 2 +- clippy_lints/src/doc.rs | 2 +- clippy_lints/src/double_comparison.rs | 2 +- clippy_lints/src/double_parens.rs | 2 +- clippy_lints/src/drop_forget_ref.rs | 2 +- clippy_lints/src/duration_subsec.rs | 2 +- clippy_lints/src/else_if_without_else.rs | 2 +- clippy_lints/src/empty_enum.rs | 2 +- clippy_lints/src/entry.rs | 2 +- clippy_lints/src/enum_clike.rs | 2 +- clippy_lints/src/enum_variants.rs | 2 +- clippy_lints/src/eq_op.rs | 2 +- clippy_lints/src/equatable_if_let.rs | 2 +- clippy_lints/src/erasing_op.rs | 2 +- clippy_lints/src/escape.rs | 2 +- clippy_lints/src/eta_reduction.rs | 2 +- clippy_lints/src/eval_order_dependence.rs | 2 +- clippy_lints/src/excessive_bools.rs | 2 +- clippy_lints/src/exhaustive_items.rs | 2 +- clippy_lints/src/exit.rs | 2 +- clippy_lints/src/explicit_write.rs | 2 +- clippy_lints/src/fallible_impl_from.rs | 2 +- clippy_lints/src/float_equality_without_abs.rs | 2 +- clippy_lints/src/float_literal.rs | 2 +- clippy_lints/src/floating_point_arithmetic.rs | 2 +- clippy_lints/src/format.rs | 2 +- clippy_lints/src/format_args.rs | 2 +- clippy_lints/src/formatting.rs | 2 +- clippy_lints/src/from_over_into.rs | 2 +- clippy_lints/src/from_str_radix_10.rs | 2 +- clippy_lints/src/functions/mod.rs | 2 +- clippy_lints/src/future_not_send.rs | 2 +- clippy_lints/src/get_last_with_len.rs | 2 +- clippy_lints/src/identity_op.rs | 2 +- clippy_lints/src/if_let_mutex.rs | 2 +- clippy_lints/src/if_not_else.rs | 2 +- clippy_lints/src/if_then_some_else_none.rs | 2 +- clippy_lints/src/implicit_hasher.rs | 2 +- clippy_lints/src/implicit_return.rs | 2 +- clippy_lints/src/implicit_saturating_sub.rs | 2 +- clippy_lints/src/inconsistent_struct_constructor.rs | 2 +- clippy_lints/src/index_refutable_slice.rs | 2 +- clippy_lints/src/indexing_slicing.rs | 2 +- clippy_lints/src/infinite_iter.rs | 2 +- clippy_lints/src/inherent_impl.rs | 2 +- clippy_lints/src/inherent_to_string.rs | 2 +- clippy_lints/src/init_numbered_fields.rs | 2 +- clippy_lints/src/inline_fn_without_body.rs | 2 +- clippy_lints/src/int_plus_one.rs | 2 +- clippy_lints/src/integer_division.rs | 2 +- clippy_lints/src/invalid_upcast_comparisons.rs | 2 +- clippy_lints/src/items_after_statements.rs | 2 +- clippy_lints/src/iter_not_returning_iterator.rs | 2 +- clippy_lints/src/large_const_arrays.rs | 2 +- clippy_lints/src/large_enum_variant.rs | 2 +- clippy_lints/src/large_stack_arrays.rs | 2 +- clippy_lints/src/len_zero.rs | 2 +- clippy_lints/src/let_if_seq.rs | 2 +- clippy_lints/src/let_underscore.rs | 2 +- clippy_lints/src/lib.rs | 3 +-- clippy_lints/src/lifetimes.rs | 2 +- clippy_lints/src/literal_representation.rs | 2 +- clippy_lints/src/loops/mod.rs | 2 +- clippy_lints/src/macro_use.rs | 2 +- clippy_lints/src/main_recursion.rs | 2 +- clippy_lints/src/manual_assert.rs | 2 +- clippy_lints/src/manual_async_fn.rs | 2 +- clippy_lints/src/manual_bits.rs | 2 +- clippy_lints/src/manual_map.rs | 2 +- clippy_lints/src/manual_non_exhaustive.rs | 2 +- clippy_lints/src/manual_ok_or.rs | 2 +- clippy_lints/src/manual_strip.rs | 2 +- clippy_lints/src/manual_unwrap_or.rs | 2 +- clippy_lints/src/map_clone.rs | 2 +- clippy_lints/src/map_err_ignore.rs | 2 +- clippy_lints/src/map_unit_fn.rs | 2 +- clippy_lints/src/match_on_vec_items.rs | 2 +- clippy_lints/src/match_result_ok.rs | 2 +- clippy_lints/src/match_str_case_mismatch.rs | 2 +- clippy_lints/src/matches/mod.rs | 2 +- clippy_lints/src/mem_forget.rs | 2 +- clippy_lints/src/mem_replace.rs | 2 +- clippy_lints/src/methods/mod.rs | 2 +- clippy_lints/src/minmax.rs | 2 +- clippy_lints/src/misc.rs | 2 +- clippy_lints/src/misc_early/mod.rs | 2 +- clippy_lints/src/missing_const_for_fn.rs | 2 +- clippy_lints/src/missing_doc.rs | 2 +- clippy_lints/src/missing_enforced_import_rename.rs | 2 +- clippy_lints/src/missing_inline.rs | 2 +- clippy_lints/src/module_style.rs | 2 +- clippy_lints/src/modulo_arithmetic.rs | 2 +- clippy_lints/src/mut_key.rs | 2 +- clippy_lints/src/mut_mut.rs | 2 +- clippy_lints/src/mut_mutex_lock.rs | 2 +- clippy_lints/src/mut_reference.rs | 2 +- clippy_lints/src/mutable_debug_assertion.rs | 2 +- clippy_lints/src/mutex_atomic.rs | 2 +- clippy_lints/src/needless_arbitrary_self_type.rs | 2 +- clippy_lints/src/needless_bitwise_bool.rs | 2 +- clippy_lints/src/needless_bool.rs | 2 +- clippy_lints/src/needless_borrowed_ref.rs | 2 +- clippy_lints/src/needless_continue.rs | 2 +- clippy_lints/src/needless_for_each.rs | 2 +- clippy_lints/src/needless_late_init.rs | 2 +- clippy_lints/src/needless_option_as_deref.rs | 2 +- clippy_lints/src/needless_pass_by_value.rs | 2 +- clippy_lints/src/needless_question_mark.rs | 2 +- clippy_lints/src/needless_update.rs | 2 +- clippy_lints/src/neg_cmp_op_on_partial_ord.rs | 2 +- clippy_lints/src/neg_multiply.rs | 2 +- clippy_lints/src/new_without_default.rs | 2 +- clippy_lints/src/no_effect.rs | 2 +- clippy_lints/src/non_copy_const.rs | 2 +- clippy_lints/src/non_expressive_names.rs | 2 +- clippy_lints/src/non_octal_unix_permissions.rs | 2 +- clippy_lints/src/non_send_fields_in_send_ty.rs | 2 +- clippy_lints/src/nonstandard_macro_braces.rs | 2 +- clippy_lints/src/octal_escapes.rs | 2 +- clippy_lints/src/open_options.rs | 2 +- clippy_lints/src/option_env_unwrap.rs | 2 +- clippy_lints/src/option_if_let_else.rs | 2 +- clippy_lints/src/overflow_check_conditional.rs | 2 +- clippy_lints/src/panic_in_result_fn.rs | 2 +- clippy_lints/src/panic_unimplemented.rs | 2 +- clippy_lints/src/partialeq_ne_impl.rs | 2 +- clippy_lints/src/pass_by_ref_or_value.rs | 2 +- clippy_lints/src/path_buf_push_overwrite.rs | 2 +- clippy_lints/src/pattern_type_mismatch.rs | 2 +- clippy_lints/src/precedence.rs | 2 +- clippy_lints/src/ptr.rs | 2 +- clippy_lints/src/ptr_eq.rs | 2 +- clippy_lints/src/ptr_offset_with_cast.rs | 2 +- clippy_lints/src/question_mark.rs | 2 +- clippy_lints/src/ranges.rs | 2 +- clippy_lints/src/redundant_clone.rs | 2 +- clippy_lints/src/redundant_closure_call.rs | 2 +- clippy_lints/src/redundant_else.rs | 2 +- clippy_lints/src/redundant_field_names.rs | 2 +- clippy_lints/src/redundant_pub_crate.rs | 2 +- clippy_lints/src/redundant_slicing.rs | 2 +- clippy_lints/src/redundant_static_lifetimes.rs | 2 +- clippy_lints/src/ref_option_ref.rs | 2 +- clippy_lints/src/reference.rs | 2 +- clippy_lints/src/regex.rs | 2 +- clippy_lints/src/repeat_once.rs | 2 +- clippy_lints/src/return_self_not_must_use.rs | 2 +- clippy_lints/src/returns.rs | 2 +- clippy_lints/src/same_name_method.rs | 2 +- clippy_lints/src/self_assignment.rs | 2 +- clippy_lints/src/self_named_constructors.rs | 2 +- clippy_lints/src/semicolon_if_nothing_returned.rs | 2 +- clippy_lints/src/serde_api.rs | 2 +- clippy_lints/src/shadow.rs | 2 +- clippy_lints/src/single_char_lifetime_names.rs | 2 +- clippy_lints/src/single_component_path_imports.rs | 2 +- clippy_lints/src/size_of_in_element_count.rs | 2 +- clippy_lints/src/slow_vector_initialization.rs | 2 +- clippy_lints/src/stable_sort_primitive.rs | 2 +- clippy_lints/src/strings.rs | 2 +- clippy_lints/src/strlen_on_c_strings.rs | 2 +- clippy_lints/src/suspicious_operation_groupings.rs | 2 +- clippy_lints/src/suspicious_trait_impl.rs | 2 +- clippy_lints/src/swap.rs | 2 +- clippy_lints/src/tabs_in_doc_comments.rs | 2 +- clippy_lints/src/temporary_assignment.rs | 2 +- clippy_lints/src/to_digit_is_some.rs | 2 +- clippy_lints/src/to_string_in_display.rs | 2 +- clippy_lints/src/trailing_empty_array.rs | 2 +- clippy_lints/src/trait_bounds.rs | 2 +- clippy_lints/src/transmute/mod.rs | 2 +- clippy_lints/src/transmuting_null.rs | 2 +- clippy_lints/src/try_err.rs | 2 +- clippy_lints/src/types/mod.rs | 2 +- clippy_lints/src/undocumented_unsafe_blocks.rs | 2 +- clippy_lints/src/undropped_manually_drops.rs | 2 +- clippy_lints/src/unicode.rs | 2 +- clippy_lints/src/uninit_vec.rs | 2 +- clippy_lints/src/unit_hash.rs | 2 +- clippy_lints/src/unit_return_expecting_ord.rs | 2 +- clippy_lints/src/unit_types/mod.rs | 2 +- clippy_lints/src/unnamed_address.rs | 2 +- clippy_lints/src/unnecessary_self_imports.rs | 2 +- clippy_lints/src/unnecessary_sort_by.rs | 2 +- clippy_lints/src/unnecessary_wraps.rs | 2 +- clippy_lints/src/unnested_or_patterns.rs | 2 +- clippy_lints/src/unsafe_removed_from_name.rs | 2 +- clippy_lints/src/unused_async.rs | 2 +- clippy_lints/src/unused_io_amount.rs | 2 +- clippy_lints/src/unused_self.rs | 2 +- clippy_lints/src/unused_unit.rs | 2 +- clippy_lints/src/unwrap.rs | 2 +- clippy_lints/src/unwrap_in_result.rs | 2 +- clippy_lints/src/upper_case_acronyms.rs | 2 +- clippy_lints/src/use_self.rs | 2 +- clippy_lints/src/useless_conversion.rs | 2 +- clippy_lints/src/utils/author.rs | 2 +- clippy_lints/src/utils/inspector.rs | 2 +- clippy_lints/src/utils/internal_lints.rs | 2 +- clippy_lints/src/utils/internal_lints/metadata_collector.rs | 2 +- clippy_lints/src/vec.rs | 2 +- clippy_lints/src/vec_init_then_push.rs | 2 +- clippy_lints/src/vec_resize_to_zero.rs | 2 +- clippy_lints/src/verbose_file_reads.rs | 2 +- clippy_lints/src/wildcard_imports.rs | 2 +- clippy_lints/src/write.rs | 2 +- clippy_lints/src/zero_div_zero.rs | 2 +- clippy_lints/src/zero_sized_map_values.rs | 2 +- 245 files changed, 245 insertions(+), 246 deletions(-) diff --git a/clippy_lints/src/absurd_extreme_comparisons.rs b/clippy_lints/src/absurd_extreme_comparisons.rs index 7665aa8380b3..f90f34f73dcb 100644 --- a/clippy_lints/src/absurd_extreme_comparisons.rs +++ b/clippy_lints/src/absurd_extreme_comparisons.rs @@ -1,7 +1,7 @@ use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use clippy_utils::comparisons::{normalize_comparison, Rel}; use clippy_utils::consts::{constant, Constant}; diff --git a/clippy_lints/src/approx_const.rs b/clippy_lints/src/approx_const.rs index e109ee0009ee..5ac3d5773a44 100644 --- a/clippy_lints/src/approx_const.rs +++ b/clippy_lints/src/approx_const.rs @@ -4,7 +4,7 @@ use rustc_ast::ast::{FloatTy, LitFloatType, LitKind}; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol; use std::f64::consts as f64; diff --git a/clippy_lints/src/arithmetic.rs b/clippy_lints/src/arithmetic.rs index e0c1d6ab6e12..c9bbe1716e41 100644 --- a/clippy_lints/src/arithmetic.rs +++ b/clippy_lints/src/arithmetic.rs @@ -2,7 +2,7 @@ use clippy_utils::consts::constant_simple; use clippy_utils::diagnostics::span_lint; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/as_conversions.rs b/clippy_lints/src/as_conversions.rs index 88b91d589074..10695e3b464e 100644 --- a/clippy_lints/src/as_conversions.rs +++ b/clippy_lints/src/as_conversions.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_ast::ast::{Expr, ExprKind}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/asm_syntax.rs b/clippy_lints/src/asm_syntax.rs index f419781dbc82..bfbfc8635e52 100644 --- a/clippy_lints/src/asm_syntax.rs +++ b/clippy_lints/src/asm_syntax.rs @@ -3,7 +3,7 @@ use std::fmt; use clippy_utils::diagnostics::span_lint_and_help; use rustc_ast::ast::{Expr, ExprKind, InlineAsmOptions}; use rustc_lint::{EarlyContext, EarlyLintPass, Lint}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; #[derive(Clone, Copy, PartialEq, Eq)] enum AsmStyle { diff --git a/clippy_lints/src/assertions_on_constants.rs b/clippy_lints/src/assertions_on_constants.rs index c82837746bd5..6fa9b90ce13b 100644 --- a/clippy_lints/src/assertions_on_constants.rs +++ b/clippy_lints/src/assertions_on_constants.rs @@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::macros::{find_assert_args, root_macro_call_first_node, PanicExpn}; use rustc_hir::Expr; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/assign_ops.rs b/clippy_lints/src/assign_ops.rs index 12c1bddf79d5..a9bcbf89b512 100644 --- a/clippy_lints/src/assign_ops.rs +++ b/clippy_lints/src/assign_ops.rs @@ -8,7 +8,7 @@ use rustc_errors::Applicability; use rustc_hir as hir; use rustc_hir::intravisit::{walk_expr, Visitor}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/async_yields_async.rs b/clippy_lints/src/async_yields_async.rs index 0619490e73c4..e7795681818f 100644 --- a/clippy_lints/src/async_yields_async.rs +++ b/clippy_lints/src/async_yields_async.rs @@ -4,7 +4,7 @@ use clippy_utils::ty::implements_trait; use rustc_errors::Applicability; use rustc_hir::{AsyncGeneratorKind, Body, BodyId, ExprKind, GeneratorKind, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index a58d12ddd6b4..91402d9776a5 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -15,7 +15,7 @@ use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintCon use rustc_middle::lint::in_external_macro; use rustc_middle::ty; use rustc_semver::RustcVersion; -use rustc_session::{declare_lint_pass, declare_tool_lint, impl_lint_pass}; +use rustc_session::{declare_lint_pass, impl_lint_pass}; use rustc_span::source_map::Span; use rustc_span::sym; use rustc_span::symbol::Symbol; diff --git a/clippy_lints/src/await_holding_invalid.rs b/clippy_lints/src/await_holding_invalid.rs index 1cc3418d4748..f15935e8183b 100644 --- a/clippy_lints/src/await_holding_invalid.rs +++ b/clippy_lints/src/await_holding_invalid.rs @@ -4,7 +4,7 @@ use rustc_hir::def_id::DefId; use rustc_hir::{AsyncGeneratorKind, Body, BodyId, GeneratorKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::GeneratorInteriorTypeCause; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/bit_mask.rs b/clippy_lints/src/bit_mask.rs index ca4af66cad16..b5be88516116 100644 --- a/clippy_lints/src/bit_mask.rs +++ b/clippy_lints/src/bit_mask.rs @@ -6,7 +6,7 @@ use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/blacklisted_name.rs b/clippy_lints/src/blacklisted_name.rs index 1600fb25d89e..fada8424f8f3 100644 --- a/clippy_lints/src/blacklisted_name.rs +++ b/clippy_lints/src/blacklisted_name.rs @@ -2,7 +2,7 @@ use clippy_utils::{diagnostics::span_lint, is_test_module_or_function}; use rustc_data_structures::fx::FxHashSet; use rustc_hir::{Item, Pat, PatKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/blocks_in_if_conditions.rs b/clippy_lints/src/blocks_in_if_conditions.rs index 4c4dd85d518a..66bb0aeaf73a 100644 --- a/clippy_lints/src/blocks_in_if_conditions.rs +++ b/clippy_lints/src/blocks_in_if_conditions.rs @@ -9,7 +9,7 @@ use rustc_hir::intravisit::{walk_expr, Visitor}; use rustc_hir::{BlockCheckMode, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/bool_assert_comparison.rs b/clippy_lints/src/bool_assert_comparison.rs index c50e214be288..a63698a546eb 100644 --- a/clippy_lints/src/bool_assert_comparison.rs +++ b/clippy_lints/src/bool_assert_comparison.rs @@ -5,7 +5,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, Lit}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::Ident; declare_clippy_lint! { diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs index f7449c8dc72e..21cc6b851646 100644 --- a/clippy_lints/src/booleans.rs +++ b/clippy_lints/src/booleans.rs @@ -8,7 +8,7 @@ use rustc_errors::Applicability; use rustc_hir::intravisit::{walk_expr, FnKind, Visitor}; use rustc_hir::{BinOpKind, Body, Expr, ExprKind, FnDecl, HirId, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/borrow_as_ptr.rs b/clippy_lints/src/borrow_as_ptr.rs index 6c1f5ff3c193..73ca3bcccdb7 100644 --- a/clippy_lints/src/borrow_as_ptr.rs +++ b/clippy_lints/src/borrow_as_ptr.rs @@ -7,7 +7,7 @@ use rustc_errors::Applicability; use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, TyKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/bytecount.rs b/clippy_lints/src/bytecount.rs index 02d97bf43df8..a129e092092b 100644 --- a/clippy_lints/src/bytecount.rs +++ b/clippy_lints/src/bytecount.rs @@ -8,7 +8,7 @@ use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind, PatKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, UintTy}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/cargo/mod.rs b/clippy_lints/src/cargo/mod.rs index abe95c6663f7..f39389c97f9d 100644 --- a/clippy_lints/src/cargo/mod.rs +++ b/clippy_lints/src/cargo/mod.rs @@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint; use clippy_utils::is_lint_allowed; use rustc_hir::hir_id::CRATE_HIR_ID; use rustc_lint::{LateContext, LateLintPass, Lint}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::DUMMY_SP; mod common_metadata; diff --git a/clippy_lints/src/case_sensitive_file_extension_comparisons.rs b/clippy_lints/src/case_sensitive_file_extension_comparisons.rs index e71f110820c0..3843fc9daed4 100644 --- a/clippy_lints/src/case_sensitive_file_extension_comparisons.rs +++ b/clippy_lints/src/case_sensitive_file_extension_comparisons.rs @@ -4,7 +4,7 @@ use rustc_ast::ast::LitKind; use rustc_hir::{Expr, ExprKind, PathSegment}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{source_map::Spanned, symbol::sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index aee1e50b94a2..48e2ecae5e83 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -18,7 +18,7 @@ use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/checked_conversions.rs b/clippy_lints/src/checked_conversions.rs index 31cc3698592b..9209d1821653 100644 --- a/clippy_lints/src/checked_conversions.rs +++ b/clippy_lints/src/checked_conversions.rs @@ -10,7 +10,7 @@ use rustc_hir::{BinOp, BinOpKind, Expr, ExprKind, QPath, TyKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/cognitive_complexity.rs b/clippy_lints/src/cognitive_complexity.rs index 85f952375491..73a2fba7a519 100644 --- a/clippy_lints/src/cognitive_complexity.rs +++ b/clippy_lints/src/cognitive_complexity.rs @@ -8,7 +8,7 @@ use rustc_ast::ast::Attribute; use rustc_hir::intravisit::{walk_expr, FnKind, Visitor}; use rustc_hir::{Body, Expr, ExprKind, FnDecl, HirId}; use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; use rustc_span::{sym, BytePos}; diff --git a/clippy_lints/src/collapsible_if.rs b/clippy_lints/src/collapsible_if.rs index f03f34e5a4b3..cdf88db0b6a6 100644 --- a/clippy_lints/src/collapsible_if.rs +++ b/clippy_lints/src/collapsible_if.rs @@ -19,7 +19,7 @@ use if_chain::if_chain; use rustc_ast::ast; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/collapsible_match.rs b/clippy_lints/src/collapsible_match.rs index c71e9f10f79e..fbd0afd8682d 100644 --- a/clippy_lints/src/collapsible_match.rs +++ b/clippy_lints/src/collapsible_match.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_hir::LangItem::OptionNone; use rustc_hir::{Arm, Expr, Guard, HirId, Pat, PatKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{MultiSpan, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/comparison_chain.rs b/clippy_lints/src/comparison_chain.rs index 399d11472b09..53f5ef5132b9 100644 --- a/clippy_lints/src/comparison_chain.rs +++ b/clippy_lints/src/comparison_chain.rs @@ -3,7 +3,7 @@ use clippy_utils::ty::implements_trait; use clippy_utils::{get_trait_def_id, if_sequence, in_constant, is_else_clause, paths, SpanlessEq}; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index 8b79f1600aeb..71119c96910d 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -11,7 +11,7 @@ use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::{Block, Expr, ExprKind, HirId}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::hir::nested_filter; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{source_map::Span, symbol::Symbol, BytePos}; use std::borrow::Cow; diff --git a/clippy_lints/src/copy_iterator.rs b/clippy_lints/src/copy_iterator.rs index 026683f60062..f07b48fabb93 100644 --- a/clippy_lints/src/copy_iterator.rs +++ b/clippy_lints/src/copy_iterator.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_note; use clippy_utils::ty::is_copy; use rustc_hir::{Impl, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; use if_chain::if_chain; diff --git a/clippy_lints/src/create_dir.rs b/clippy_lints/src/create_dir.rs index 6bc4054a5abc..b9fb3e7bbbb6 100644 --- a/clippy_lints/src/create_dir.rs +++ b/clippy_lints/src/create_dir.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/dbg_macro.rs b/clippy_lints/src/dbg_macro.rs index df1a4128af35..38712ccdbd00 100644 --- a/clippy_lints/src/dbg_macro.rs +++ b/clippy_lints/src/dbg_macro.rs @@ -4,7 +4,7 @@ use clippy_utils::source::snippet_with_applicability; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/default.rs b/clippy_lints/src/default.rs index 3070588483c2..4e8faa49408c 100644 --- a/clippy_lints/src/default.rs +++ b/clippy_lints/src/default.rs @@ -9,7 +9,7 @@ use rustc_hir::def::Res; use rustc_hir::{Block, Expr, ExprKind, PatKind, QPath, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::{Ident, Symbol}; use rustc_span::Span; diff --git a/clippy_lints/src/default_numeric_fallback.rs b/clippy_lints/src/default_numeric_fallback.rs index fb201d2c012b..0efbb2f6154e 100644 --- a/clippy_lints/src/default_numeric_fallback.rs +++ b/clippy_lints/src/default_numeric_fallback.rs @@ -13,7 +13,7 @@ use rustc_middle::{ lint::in_external_macro, ty::{self, FloatTy, IntTy, PolyFnSig, Ty}, }; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::iter; declare_clippy_lint! { diff --git a/clippy_lints/src/default_union_representation.rs b/clippy_lints/src/default_union_representation.rs index bc3c31c53c28..b9b61cfe5a5c 100644 --- a/clippy_lints/src/default_union_representation.rs +++ b/clippy_lints/src/default_union_representation.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_hir::{self as hir, HirId, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::layout::LayoutOf; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/dereference.rs b/clippy_lints/src/dereference.rs index 6d0851d804c2..ec70f5a0f8bf 100644 --- a/clippy_lints/src/dereference.rs +++ b/clippy_lints/src/dereference.rs @@ -13,7 +13,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow, AutoBorrowMutability}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeckResults}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{symbol::sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/derivable_impls.rs b/clippy_lints/src/derivable_impls.rs index eccb18982f30..7b8a44527600 100644 --- a/clippy_lints/src/derivable_impls.rs +++ b/clippy_lints/src/derivable_impls.rs @@ -5,7 +5,7 @@ use rustc_hir::{ Body, Expr, ExprKind, GenericArg, Impl, ImplItemKind, Item, ItemKind, Node, PathSegment, QPath, TyKind, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/derive.rs b/clippy_lints/src/derive.rs index 7277e4080c5c..6ab642f9eab3 100644 --- a/clippy_lints/src/derive.rs +++ b/clippy_lints/src/derive.rs @@ -10,7 +10,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/disallowed_methods.rs b/clippy_lints/src/disallowed_methods.rs index 4c12202c84ab..aab23edefa6d 100644 --- a/clippy_lints/src/disallowed_methods.rs +++ b/clippy_lints/src/disallowed_methods.rs @@ -3,7 +3,7 @@ use clippy_utils::fn_def_id; use rustc_hir::{def::Res, def_id::DefIdMap, Expr}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use crate::utils::conf; diff --git a/clippy_lints/src/disallowed_script_idents.rs b/clippy_lints/src/disallowed_script_idents.rs index 0c27c3f9255f..e9abcf309939 100644 --- a/clippy_lints/src/disallowed_script_idents.rs +++ b/clippy_lints/src/disallowed_script_idents.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use rustc_ast::ast; use rustc_data_structures::fx::FxHashSet; use rustc_lint::{EarlyContext, EarlyLintPass, Level, LintContext}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use unicode_script::{Script, UnicodeScript}; declare_clippy_lint! { diff --git a/clippy_lints/src/disallowed_types.rs b/clippy_lints/src/disallowed_types.rs index 14f89edce615..255c3521137d 100644 --- a/clippy_lints/src/disallowed_types.rs +++ b/clippy_lints/src/disallowed_types.rs @@ -5,7 +5,7 @@ use rustc_hir::{ def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, TraitBoundModifier, Ty, TyKind, UseKind, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Span; use crate::utils::conf; diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index a00361e6062a..8c166fd08cd4 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -21,8 +21,8 @@ use rustc_middle::lint::in_external_macro; use rustc_middle::ty; use rustc_parse::maybe_new_parser_from_source_str; use rustc_parse::parser::ForceCollect; +use rustc_session::impl_lint_pass; use rustc_session::parse::ParseSess; -use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::def_id::LocalDefId; use rustc_span::edition::Edition; use rustc_span::source_map::{BytePos, FilePathMapping, MultiSpan, SourceMap, Span}; diff --git a/clippy_lints/src/double_comparison.rs b/clippy_lints/src/double_comparison.rs index 176092e5b280..1e7567db5448 100644 --- a/clippy_lints/src/double_comparison.rs +++ b/clippy_lints/src/double_comparison.rs @@ -6,7 +6,7 @@ use clippy_utils::source::snippet_with_applicability; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/double_parens.rs b/clippy_lints/src/double_parens.rs index e10f740d24a4..0f35aa180905 100644 --- a/clippy_lints/src/double_parens.rs +++ b/clippy_lints/src/double_parens.rs @@ -1,7 +1,7 @@ use clippy_utils::diagnostics::span_lint; use rustc_ast::ast::{Expr, ExprKind}; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/drop_forget_ref.rs b/clippy_lints/src/drop_forget_ref.rs index a8f8e3d8a42c..3e1ad77c6ea4 100644 --- a/clippy_lints/src/drop_forget_ref.rs +++ b/clippy_lints/src/drop_forget_ref.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/duration_subsec.rs b/clippy_lints/src/duration_subsec.rs index 09318f74527c..7bbbe0e06065 100644 --- a/clippy_lints/src/duration_subsec.rs +++ b/clippy_lints/src/duration_subsec.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::sym; diff --git a/clippy_lints/src/else_if_without_else.rs b/clippy_lints/src/else_if_without_else.rs index 0b9f54231c59..5a7bdb91a9aa 100644 --- a/clippy_lints/src/else_if_without_else.rs +++ b/clippy_lints/src/else_if_without_else.rs @@ -4,7 +4,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_ast::ast::{Expr, ExprKind}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/empty_enum.rs b/clippy_lints/src/empty_enum.rs index af9e65e63613..fc216bcbe33e 100644 --- a/clippy_lints/src/empty_enum.rs +++ b/clippy_lints/src/empty_enum.rs @@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/entry.rs b/clippy_lints/src/entry.rs index 1ae2e20c1e06..a463acf60293 100644 --- a/clippy_lints/src/entry.rs +++ b/clippy_lints/src/entry.rs @@ -14,7 +14,7 @@ use rustc_hir::{ Block, Expr, ExprKind, Guard, HirId, Pat, Stmt, StmtKind, UnOp, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{Span, SyntaxContext, DUMMY_SP}; declare_clippy_lint! { diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs index 3b6661c817be..4541e74e0560 100644 --- a/clippy_lints/src/enum_clike.rs +++ b/clippy_lints/src/enum_clike.rs @@ -7,7 +7,7 @@ use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::util::IntTypeExt; use rustc_middle::ty::{self, IntTy, UintTy}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::convert::TryFrom; declare_clippy_lint! { diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index 1f4353fa4f72..60f9111c99b2 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -5,7 +5,7 @@ use clippy_utils::source::is_present_in_source; use clippy_utils::str_utils::{camel_case_split, count_match_end, count_match_start}; use rustc_hir::{EnumDef, Item, ItemKind, Variant}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::Symbol; diff --git a/clippy_lints/src/eq_op.rs b/clippy_lints/src/eq_op.rs index 24d7613e6f8c..71845cf4f155 100644 --- a/clippy_lints/src/eq_op.rs +++ b/clippy_lints/src/eq_op.rs @@ -11,7 +11,7 @@ use rustc_hir::{ }; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, TyS}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/equatable_if_let.rs b/clippy_lints/src/equatable_if_let.rs index cf47e581ccb4..70d972b764ac 100644 --- a/clippy_lints/src/equatable_if_let.rs +++ b/clippy_lints/src/equatable_if_let.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, Pat, PatKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::Ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/erasing_op.rs b/clippy_lints/src/erasing_op.rs index c1a84973c421..4a3239ccafbb 100644 --- a/clippy_lints/src/erasing_op.rs +++ b/clippy_lints/src/erasing_op.rs @@ -5,7 +5,7 @@ use clippy_utils::ty::same_type_and_consts; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::TypeckResults; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/escape.rs b/clippy_lints/src/escape.rs index af591dd71aa1..82b29c122db1 100644 --- a/clippy_lints/src/escape.rs +++ b/clippy_lints/src/escape.rs @@ -7,7 +7,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::mir::FakeReadCause; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, TraitRef, Ty}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::kw; use rustc_target::spec::abi::Abi; diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index 263bff4873ca..504f05512775 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -12,7 +12,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow}; use rustc_middle::ty::subst::Subst; use rustc_middle::ty::{self, ClosureKind, Ty, TypeFoldable}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/eval_order_dependence.rs b/clippy_lints/src/eval_order_dependence.rs index 65599a0587d4..54891cba0f04 100644 --- a/clippy_lints/src/eval_order_dependence.rs +++ b/clippy_lints/src/eval_order_dependence.rs @@ -5,7 +5,7 @@ use rustc_hir::intravisit::{walk_expr, Visitor}; use rustc_hir::{BinOpKind, Block, Expr, ExprKind, Guard, HirId, Local, Node, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/excessive_bools.rs b/clippy_lints/src/excessive_bools.rs index 245a4fc12fd4..7ffa6f0294fd 100644 --- a/clippy_lints/src/excessive_bools.rs +++ b/clippy_lints/src/excessive_bools.rs @@ -1,7 +1,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_ast::ast::{AssocItemKind, Extern, Fn, FnSig, Impl, Item, ItemKind, Trait, Ty, TyKind}; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{sym, Span}; use std::convert::TryInto; diff --git a/clippy_lints/src/exhaustive_items.rs b/clippy_lints/src/exhaustive_items.rs index b0f50b5c144b..a4ae45cd20d0 100644 --- a/clippy_lints/src/exhaustive_items.rs +++ b/clippy_lints/src/exhaustive_items.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/exit.rs b/clippy_lints/src/exit.rs index cbf52d19334c..8f7ae4c9c303 100644 --- a/clippy_lints/src/exit.rs +++ b/clippy_lints/src/exit.rs @@ -3,7 +3,7 @@ use clippy_utils::{is_entrypoint_fn, match_def_path, paths}; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind, Item, ItemKind, Node}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/explicit_write.rs b/clippy_lints/src/explicit_write.rs index 3e2217c28da3..f72bb8c3310b 100644 --- a/clippy_lints/src/explicit_write.rs +++ b/clippy_lints/src/explicit_write.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/fallible_impl_from.rs b/clippy_lints/src/fallible_impl_from.rs index 574678b55421..5b23bfbbc794 100644 --- a/clippy_lints/src/fallible_impl_from.rs +++ b/clippy_lints/src/fallible_impl_from.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/float_equality_without_abs.rs b/clippy_lints/src/float_equality_without_abs.rs index ca8886228de2..b9b3783e5b44 100644 --- a/clippy_lints/src/float_equality_without_abs.rs +++ b/clippy_lints/src/float_equality_without_abs.rs @@ -7,7 +7,7 @@ use rustc_hir::def::{DefKind, Res}; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; declare_clippy_lint! { diff --git a/clippy_lints/src/float_literal.rs b/clippy_lints/src/float_literal.rs index 7a4397a7b746..f6c5cdcb37c4 100644 --- a/clippy_lints/src/float_literal.rs +++ b/clippy_lints/src/float_literal.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, FloatTy}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::fmt; declare_clippy_lint! { diff --git a/clippy_lints/src/floating_point_arithmetic.rs b/clippy_lints/src/floating_point_arithmetic.rs index 79ce53f7a5f2..1d3fc70dae7c 100644 --- a/clippy_lints/src/floating_point_arithmetic.rs +++ b/clippy_lints/src/floating_point_arithmetic.rs @@ -10,7 +10,7 @@ use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment, UnOp}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_ast::ast; diff --git a/clippy_lints/src/format.rs b/clippy_lints/src/format.rs index 395c920c9974..b9cc1ade8623 100644 --- a/clippy_lints/src/format.rs +++ b/clippy_lints/src/format.rs @@ -7,7 +7,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::kw; use rustc_span::{sym, BytePos, Span}; diff --git a/clippy_lints/src/format_args.rs b/clippy_lints/src/format_args.rs index 17b0749a4a99..2fa6e2adc4fb 100644 --- a/clippy_lints/src/format_args.rs +++ b/clippy_lints/src/format_args.rs @@ -9,7 +9,7 @@ use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::adjustment::{Adjust, Adjustment}; use rustc_middle::ty::Ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, ExpnData, ExpnKind, Span, Symbol}; declare_clippy_lint! { diff --git a/clippy_lints/src/formatting.rs b/clippy_lints/src/formatting.rs index 57964b8d48ea..0136c8d827e5 100644 --- a/clippy_lints/src/formatting.rs +++ b/clippy_lints/src/formatting.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_ast::ast::{BinOpKind, Block, Expr, ExprKind, StmtKind, UnOp}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/from_over_into.rs b/clippy_lints/src/from_over_into.rs index c2f52605151e..2befcd2e65be 100644 --- a/clippy_lints/src/from_over_into.rs +++ b/clippy_lints/src/from_over_into.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/from_str_radix_10.rs b/clippy_lints/src/from_str_radix_10.rs index 57b075132052..43c86e1acac4 100644 --- a/clippy_lints/src/from_str_radix_10.rs +++ b/clippy_lints/src/from_str_radix_10.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir::{def, Expr, ExprKind, PrimTy, QPath, TyKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::Ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs index ad031cbc09d4..ecea9e9a520b 100644 --- a/clippy_lints/src/functions/mod.rs +++ b/clippy_lints/src/functions/mod.rs @@ -7,7 +7,7 @@ mod too_many_lines; use rustc_hir as hir; use rustc_hir::intravisit; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/future_not_send.rs b/clippy_lints/src/future_not_send.rs index 43911a313d5a..eed8381adc40 100644 --- a/clippy_lints/src/future_not_send.rs +++ b/clippy_lints/src/future_not_send.rs @@ -6,7 +6,7 @@ use rustc_infer::infer::TyCtxtInferExt; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::subst::Subst; use rustc_middle::ty::{Opaque, PredicateKind::Trait}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; use rustc_trait_selection::traits::error_reporting::suggestions::InferCtxtExt; use rustc_trait_selection::traits::{self, FulfillmentError, TraitEngine}; diff --git a/clippy_lints/src/get_last_with_len.rs b/clippy_lints/src/get_last_with_len.rs index df29d9308e71..2632826cdfec 100644 --- a/clippy_lints/src/get_last_with_len.rs +++ b/clippy_lints/src/get_last_with_len.rs @@ -9,7 +9,7 @@ use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::sym; diff --git a/clippy_lints/src/identity_op.rs b/clippy_lints/src/identity_op.rs index f824f20ca40a..5895624d4360 100644 --- a/clippy_lints/src/identity_op.rs +++ b/clippy_lints/src/identity_op.rs @@ -2,7 +2,7 @@ use clippy_utils::source::snippet; use rustc_hir::{BinOp, BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use clippy_utils::consts::{constant_simple, Constant}; diff --git a/clippy_lints/src/if_let_mutex.rs b/clippy_lints/src/if_let_mutex.rs index e95017007849..6e8f9ff0291f 100644 --- a/clippy_lints/src/if_let_mutex.rs +++ b/clippy_lints/src/if_let_mutex.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_hir::intravisit::{self as visit, Visitor}; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/if_not_else.rs b/clippy_lints/src/if_not_else.rs index 3d59b783337a..d45d7460c26e 100644 --- a/clippy_lints/src/if_not_else.rs +++ b/clippy_lints/src/if_not_else.rs @@ -5,7 +5,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::is_else_clause; use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/if_then_some_else_none.rs b/clippy_lints/src/if_then_some_else_none.rs index 9525c163ece1..999fc253a0eb 100644 --- a/clippy_lints/src/if_then_some_else_none.rs +++ b/clippy_lints/src/if_then_some_else_none.rs @@ -7,7 +7,7 @@ use rustc_hir::{Expr, ExprKind, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/implicit_hasher.rs b/clippy_lints/src/implicit_hasher.rs index 5e4cde553b52..9f0d6752a880 100644 --- a/clippy_lints/src/implicit_hasher.rs +++ b/clippy_lints/src/implicit_hasher.rs @@ -9,7 +9,7 @@ use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::hir::nested_filter; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::{Ty, TypeckResults}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::sym; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/implicit_return.rs b/clippy_lints/src/implicit_return.rs index d650d6e9a858..96db55f260f9 100644 --- a/clippy_lints/src/implicit_return.rs +++ b/clippy_lints/src/implicit_return.rs @@ -9,7 +9,7 @@ use rustc_hir::intravisit::{FnKind, Visitor}; use rustc_hir::{Block, Body, Expr, ExprKind, FnDecl, FnRetTy, HirId}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{Span, SyntaxContext}; declare_clippy_lint! { diff --git a/clippy_lints/src/implicit_saturating_sub.rs b/clippy_lints/src/implicit_saturating_sub.rs index 6515975fbffd..c64f18a5bec6 100644 --- a/clippy_lints/src/implicit_saturating_sub.rs +++ b/clippy_lints/src/implicit_saturating_sub.rs @@ -5,7 +5,7 @@ use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{lang_items::LangItem, BinOpKind, Expr, ExprKind, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/inconsistent_struct_constructor.rs b/clippy_lints/src/inconsistent_struct_constructor.rs index 3d44a669d8f0..9e033b29bdbd 100644 --- a/clippy_lints/src/inconsistent_struct_constructor.rs +++ b/clippy_lints/src/inconsistent_struct_constructor.rs @@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; use rustc_hir::{self as hir, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::Symbol; declare_clippy_lint! { diff --git a/clippy_lints/src/index_refutable_slice.rs b/clippy_lints/src/index_refutable_slice.rs index 2a4bcd773c68..82ce57cdf4e3 100644 --- a/clippy_lints/src/index_refutable_slice.rs +++ b/clippy_lints/src/index_refutable_slice.rs @@ -12,7 +12,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; use rustc_middle::ty; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{symbol::Ident, Span}; use std::convert::TryInto; diff --git a/clippy_lints/src/indexing_slicing.rs b/clippy_lints/src/indexing_slicing.rs index 9ead4bb27a58..9bd5b364bd03 100644 --- a/clippy_lints/src/indexing_slicing.rs +++ b/clippy_lints/src/indexing_slicing.rs @@ -7,7 +7,7 @@ use rustc_ast::ast::RangeLimits; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/infinite_iter.rs b/clippy_lints/src/infinite_iter.rs index b2b9889f5dc7..2a85ec221364 100644 --- a/clippy_lints/src/infinite_iter.rs +++ b/clippy_lints/src/infinite_iter.rs @@ -3,7 +3,7 @@ use clippy_utils::ty::{implements_trait, is_type_diagnostic_item}; use clippy_utils::{higher, match_def_path, path_def_id, paths}; use rustc_hir::{BorrowKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::{sym, Symbol}; declare_clippy_lint! { diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs index 254d3f8a4d0f..3b2e5edf6d1e 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -5,7 +5,7 @@ use clippy_utils::is_lint_allowed; use rustc_data_structures::fx::FxHashMap; use rustc_hir::{def_id::LocalDefId, Item, ItemKind, Node}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; use std::collections::hash_map::Entry; diff --git a/clippy_lints/src/inherent_to_string.rs b/clippy_lints/src/inherent_to_string.rs index 55c04a1186fc..05295e4b0822 100644 --- a/clippy_lints/src/inherent_to_string.rs +++ b/clippy_lints/src/inherent_to_string.rs @@ -4,7 +4,7 @@ use clippy_utils::{get_trait_def_id, paths, return_ty, trait_ref_of_method}; use if_chain::if_chain; use rustc_hir::{ImplItem, ImplItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/init_numbered_fields.rs b/clippy_lints/src/init_numbered_fields.rs index 9284e0024099..c27435da0bcd 100644 --- a/clippy_lints/src/init_numbered_fields.rs +++ b/clippy_lints/src/init_numbered_fields.rs @@ -3,7 +3,7 @@ use clippy_utils::source::snippet_with_applicability; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::borrow::Cow; use std::cmp::Reverse; use std::collections::BinaryHeap; diff --git a/clippy_lints/src/inline_fn_without_body.rs b/clippy_lints/src/inline_fn_without_body.rs index df69d3dcc516..9d40a09607a0 100644 --- a/clippy_lints/src/inline_fn_without_body.rs +++ b/clippy_lints/src/inline_fn_without_body.rs @@ -6,7 +6,7 @@ use rustc_ast::ast::Attribute; use rustc_errors::Applicability; use rustc_hir::{TraitFn, TraitItem, TraitItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Symbol}; declare_clippy_lint! { diff --git a/clippy_lints/src/int_plus_one.rs b/clippy_lints/src/int_plus_one.rs index 3716d36ad881..a3bb70b9c978 100644 --- a/clippy_lints/src/int_plus_one.rs +++ b/clippy_lints/src/int_plus_one.rs @@ -5,7 +5,7 @@ use clippy_utils::source::snippet_opt; use rustc_ast::ast::{BinOpKind, Expr, ExprKind, Lit, LitKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/integer_division.rs b/clippy_lints/src/integer_division.rs index fa7862056788..8ca054e62b8f 100644 --- a/clippy_lints/src/integer_division.rs +++ b/clippy_lints/src/integer_division.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use if_chain::if_chain; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/invalid_upcast_comparisons.rs b/clippy_lints/src/invalid_upcast_comparisons.rs index 36e03e50a8e4..5e647c9431bd 100644 --- a/clippy_lints/src/invalid_upcast_comparisons.rs +++ b/clippy_lints/src/invalid_upcast_comparisons.rs @@ -2,7 +2,7 @@ use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, IntTy, UintTy}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; use clippy_utils::comparisons; diff --git a/clippy_lints/src/items_after_statements.rs b/clippy_lints/src/items_after_statements.rs index cdefe627efda..f40c0a9ca350 100644 --- a/clippy_lints/src/items_after_statements.rs +++ b/clippy_lints/src/items_after_statements.rs @@ -4,7 +4,7 @@ use clippy_utils::diagnostics::span_lint; use rustc_ast::ast::{Block, ItemKind, StmtKind}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/iter_not_returning_iterator.rs b/clippy_lints/src/iter_not_returning_iterator.rs index b56d87c5348c..f5cb9df2799a 100644 --- a/clippy_lints/src/iter_not_returning_iterator.rs +++ b/clippy_lints/src/iter_not_returning_iterator.rs @@ -1,7 +1,7 @@ use clippy_utils::{diagnostics::span_lint, get_parent_node, ty::implements_trait}; use rustc_hir::{def_id::LocalDefId, FnSig, ImplItem, ImplItemKind, Item, ItemKind, Node, TraitItem, TraitItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/large_const_arrays.rs b/clippy_lints/src/large_const_arrays.rs index 80260e4cd831..9be7b1a15137 100644 --- a/clippy_lints/src/large_const_arrays.rs +++ b/clippy_lints/src/large_const_arrays.rs @@ -6,7 +6,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::mir::interpret::ConstValue; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, ConstKind}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{BytePos, Pos, Span}; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/large_enum_variant.rs b/clippy_lints/src/large_enum_variant.rs index 0191713f60d3..56836f5dfe9f 100644 --- a/clippy_lints/src/large_enum_variant.rs +++ b/clippy_lints/src/large_enum_variant.rs @@ -7,7 +7,7 @@ use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::layout::LayoutOf; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/large_stack_arrays.rs b/clippy_lints/src/large_stack_arrays.rs index 1cc2c28c04ad..a15a8e843724 100644 --- a/clippy_lints/src/large_stack_arrays.rs +++ b/clippy_lints/src/large_stack_arrays.rs @@ -6,7 +6,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::mir::interpret::ConstValue; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, ConstKind}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/len_zero.rs b/clippy_lints/src/len_zero.rs index 3418d276c535..58c77201b89c 100644 --- a/clippy_lints/src/len_zero.rs +++ b/clippy_lints/src/len_zero.rs @@ -11,7 +11,7 @@ use rustc_hir::{ }; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, AssocKind, FnSig, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{ source_map::{Span, Spanned, Symbol}, symbol::sym, diff --git a/clippy_lints/src/let_if_seq.rs b/clippy_lints/src/let_if_seq.rs index db09d00d7303..a9ff27e3dd1f 100644 --- a/clippy_lints/src/let_if_seq.rs +++ b/clippy_lints/src/let_if_seq.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir as hir; use rustc_hir::BindingAnnotation; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/let_underscore.rs b/clippy_lints/src/let_underscore.rs index cb1ef01f5ba9..2683c6ecedc2 100644 --- a/clippy_lints/src/let_underscore.rs +++ b/clippy_lints/src/let_underscore.rs @@ -6,7 +6,7 @@ use rustc_hir::{Local, PatKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::subst::GenericArgKind; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index a3400b6277ed..842528c5f6f8 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -73,7 +73,6 @@ use rustc_session::Session; /// ``` /// #![feature(rustc_private)] /// extern crate rustc_session; -/// use rustc_session::declare_tool_lint; /// use clippy_lints::declare_clippy_lint; /// /// declare_clippy_lint! { @@ -102,7 +101,7 @@ macro_rules! declare_clippy_lint_macro { macro_rules! declare_clippy_lint { $( ($d(#[$d meta:meta])* pub $d name:tt, $category, $d description:tt) => { - declare_tool_lint! { + rustc_session::declare_tool_lint! { $d(#[$d meta])* pub clippy::$d name, $level, diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index b09c23f31e97..e168022fa2a0 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -11,7 +11,7 @@ use rustc_hir::{ TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WhereClause, WherePredicate, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::{kw, Ident, Symbol}; diff --git a/clippy_lints/src/literal_representation.rs b/clippy_lints/src/literal_representation.rs index b7430f49229a..3649d1fcf68b 100644 --- a/clippy_lints/src/literal_representation.rs +++ b/clippy_lints/src/literal_representation.rs @@ -9,7 +9,7 @@ use rustc_ast::ast::{Expr, ExprKind, Lit, LitKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use std::iter; declare_clippy_lint! { diff --git a/clippy_lints/src/loops/mod.rs b/clippy_lints/src/loops/mod.rs index 5bc32acf56ec..dedf8bdfa49a 100644 --- a/clippy_lints/src/loops/mod.rs +++ b/clippy_lints/src/loops/mod.rs @@ -21,7 +21,7 @@ mod while_let_on_iterator; use clippy_utils::higher; use rustc_hir::{Expr, ExprKind, LoopSource, Pat}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use utils::{make_iterator_snippet, IncrementVisitor, InitializeVisitor}; diff --git a/clippy_lints/src/macro_use.rs b/clippy_lints/src/macro_use.rs index 76c5cfadc2c1..bac9197cd790 100644 --- a/clippy_lints/src/macro_use.rs +++ b/clippy_lints/src/macro_use.rs @@ -7,7 +7,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{edition::Edition, sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/main_recursion.rs b/clippy_lints/src/main_recursion.rs index fad8fa467d4b..b2d71a320ade 100644 --- a/clippy_lints/src/main_recursion.rs +++ b/clippy_lints/src/main_recursion.rs @@ -4,7 +4,7 @@ use clippy_utils::{is_entrypoint_fn, is_no_std_crate}; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/manual_assert.rs b/clippy_lints/src/manual_assert.rs index 26b53ab5d683..97617123c4c0 100644 --- a/clippy_lints/src/manual_assert.rs +++ b/clippy_lints/src/manual_assert.rs @@ -5,7 +5,7 @@ use clippy_utils::{peel_blocks_with_stmt, sugg}; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/manual_async_fn.rs b/clippy_lints/src/manual_async_fn.rs index babc6fab3c0f..eeb6a3123080 100644 --- a/clippy_lints/src/manual_async_fn.rs +++ b/clippy_lints/src/manual_async_fn.rs @@ -10,7 +10,7 @@ use rustc_hir::{ IsAsync, ItemKind, LifetimeName, Term, TraitRef, Ty, TyKind, TypeBindingKind, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/manual_bits.rs b/clippy_lints/src/manual_bits.rs index f297add38a1b..6c5330ab9cde 100644 --- a/clippy_lints/src/manual_bits.rs +++ b/clippy_lints/src/manual_bits.rs @@ -7,7 +7,7 @@ use rustc_hir::{BinOpKind, Expr, ExprKind, GenericArg, QPath}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, Ty}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/manual_map.rs b/clippy_lints/src/manual_map.rs index 8475e367b09f..069158a7049c 100644 --- a/clippy_lints/src/manual_map.rs +++ b/clippy_lints/src/manual_map.rs @@ -16,7 +16,7 @@ use rustc_hir::{ }; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, SyntaxContext}; declare_clippy_lint! { diff --git a/clippy_lints/src/manual_non_exhaustive.rs b/clippy_lints/src/manual_non_exhaustive.rs index 33d1bb2985f4..067954fcc8cb 100644 --- a/clippy_lints/src/manual_non_exhaustive.rs +++ b/clippy_lints/src/manual_non_exhaustive.rs @@ -7,7 +7,7 @@ use rustc_ast::ast::{FieldDef, Item, ItemKind, Variant, VariantData, VisibilityK use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/manual_ok_or.rs b/clippy_lints/src/manual_ok_or.rs index bf4ab29d9087..18a535104508 100644 --- a/clippy_lints/src/manual_ok_or.rs +++ b/clippy_lints/src/manual_ok_or.rs @@ -9,7 +9,7 @@ use rustc_hir::{Expr, ExprKind, PatKind}; use rustc_lint::LintContext; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/manual_strip.rs b/clippy_lints/src/manual_strip.rs index aacabf303a70..2aa1317c4ba7 100644 --- a/clippy_lints/src/manual_strip.rs +++ b/clippy_lints/src/manual_strip.rs @@ -12,7 +12,7 @@ use rustc_hir::{BorrowKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::Span; diff --git a/clippy_lints/src/manual_unwrap_or.rs b/clippy_lints/src/manual_unwrap_or.rs index b3a91d9f18f5..03c15890c9d8 100644 --- a/clippy_lints/src/manual_unwrap_or.rs +++ b/clippy_lints/src/manual_unwrap_or.rs @@ -11,7 +11,7 @@ use rustc_hir::{Arm, Expr, ExprKind, PatKind}; use rustc_lint::LintContext; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/map_clone.rs b/clippy_lints/src/map_clone.rs index 3f8eeb736fbd..718d885e1323 100644 --- a/clippy_lints/src/map_clone.rs +++ b/clippy_lints/src/map_clone.rs @@ -10,7 +10,7 @@ use rustc_middle::mir::Mutability; use rustc_middle::ty; use rustc_middle::ty::adjustment::Adjust; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::Ident; use rustc_span::{sym, Span}; diff --git a/clippy_lints/src/map_err_ignore.rs b/clippy_lints/src/map_err_ignore.rs index e3a42de0b7c1..a6eeb4ac7be1 100644 --- a/clippy_lints/src/map_err_ignore.rs +++ b/clippy_lints/src/map_err_ignore.rs @@ -1,7 +1,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_hir::{CaptureBy, Expr, ExprKind, PatKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/map_unit_fn.rs b/clippy_lints/src/map_unit_fn.rs index 0f6ac4784324..56d3bfd12db9 100644 --- a/clippy_lints/src/map_unit_fn.rs +++ b/clippy_lints/src/map_unit_fn.rs @@ -7,7 +7,7 @@ use rustc_errors::Applicability; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/match_on_vec_items.rs b/clippy_lints/src/match_on_vec_items.rs index 583b577ffe25..29d2548680ff 100644 --- a/clippy_lints/src/match_on_vec_items.rs +++ b/clippy_lints/src/match_on_vec_items.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, LangItem, MatchSource}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/match_result_ok.rs b/clippy_lints/src/match_result_ok.rs index 77a4917ec58f..2979dc7a641f 100644 --- a/clippy_lints/src/match_result_ok.rs +++ b/clippy_lints/src/match_result_ok.rs @@ -7,7 +7,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, PatKind, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/match_str_case_mismatch.rs b/clippy_lints/src/match_str_case_mismatch.rs index 85aec93670b9..0fc9767880ec 100644 --- a/clippy_lints/src/match_str_case_mismatch.rs +++ b/clippy_lints/src/match_str_case_mismatch.rs @@ -7,7 +7,7 @@ use rustc_hir::{Arm, Expr, ExprKind, MatchSource, PatKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::Symbol; use rustc_span::{sym, Span}; diff --git a/clippy_lints/src/matches/mod.rs b/clippy_lints/src/matches/mod.rs index b5ee4561f06e..2df468c37cec 100644 --- a/clippy_lints/src/matches/mod.rs +++ b/clippy_lints/src/matches/mod.rs @@ -2,7 +2,7 @@ use clippy_utils::{meets_msrv, msrvs}; use rustc_hir::{Expr, ExprKind, Local, MatchSource, Pat}; use rustc_lint::{LateContext, LateLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; mod infalliable_detructuring_match; mod match_as_ref; diff --git a/clippy_lints/src/mem_forget.rs b/clippy_lints/src/mem_forget.rs index 5ffcfd4d2641..18e9c485b77e 100644 --- a/clippy_lints/src/mem_forget.rs +++ b/clippy_lints/src/mem_forget.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use clippy_utils::{match_def_path, paths}; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs index a184806d021b..e93ce4642623 100644 --- a/clippy_lints/src/mem_replace.rs +++ b/clippy_lints/src/mem_replace.rs @@ -9,7 +9,7 @@ use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, QPath}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::sym; diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index c2202cb1e577..047150b4b826 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -80,7 +80,7 @@ use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::{self, TraitRef, Ty}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{sym, Span}; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/minmax.rs b/clippy_lints/src/minmax.rs index 65d1f440b763..c77f3949cb8f 100644 --- a/clippy_lints/src/minmax.rs +++ b/clippy_lints/src/minmax.rs @@ -4,7 +4,7 @@ use clippy_utils::{match_trait_method, paths}; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; use std::cmp::Ordering; diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index ac82dd306a52..a40adf94c403 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -12,7 +12,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::hygiene::DesugaringKind; use rustc_span::source_map::{ExpnKind, Span}; use rustc_span::symbol::sym; diff --git a/clippy_lints/src/misc_early/mod.rs b/clippy_lints/src/misc_early/mod.rs index d955fad7d41a..1a8efb211797 100644 --- a/clippy_lints/src/misc_early/mod.rs +++ b/clippy_lints/src/misc_early/mod.rs @@ -14,7 +14,7 @@ use rustc_ast::visit::FnKind; use rustc_data_structures::fx::FxHashMap; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/missing_const_for_fn.rs b/clippy_lints/src/missing_const_for_fn.rs index bad9e0be82e6..ef7f7f9e5477 100644 --- a/clippy_lints/src/missing_const_for_fn.rs +++ b/clippy_lints/src/missing_const_for_fn.rs @@ -8,7 +8,7 @@ use rustc_hir::{Body, Constness, FnDecl, GenericParamKind, HirId}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Span; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index db6aab0671bd..e1463b7cac67 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -12,7 +12,7 @@ use rustc_ast::ast::{self, MetaItem, MetaItemKind}; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::ty; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::def_id::CRATE_DEF_ID; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/missing_enforced_import_rename.rs b/clippy_lints/src/missing_enforced_import_rename.rs index 3d0a23822838..5bb77f04fb24 100644 --- a/clippy_lints/src/missing_enforced_import_rename.rs +++ b/clippy_lints/src/missing_enforced_import_rename.rs @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; use rustc_hir::{def::Res, def_id::DefId, Item, ItemKind, UseKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Symbol; use crate::utils::conf::Rename; diff --git a/clippy_lints/src/missing_inline.rs b/clippy_lints/src/missing_inline.rs index ac2f16b49e3f..bbfddc23071d 100644 --- a/clippy_lints/src/missing_inline.rs +++ b/clippy_lints/src/missing_inline.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use rustc_ast::ast; use rustc_hir as hir; use rustc_lint::{self, LateContext, LateLintPass, LintContext}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/module_style.rs b/clippy_lints/src/module_style.rs index b8dfe9968806..092fb94d3334 100644 --- a/clippy_lints/src/module_style.rs +++ b/clippy_lints/src/module_style.rs @@ -6,7 +6,7 @@ use std::{ use rustc_ast::ast; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_lint::{EarlyContext, EarlyLintPass, Level, LintContext}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{FileName, RealFileName, SourceFile, Span, SyntaxContext}; declare_clippy_lint! { diff --git a/clippy_lints/src/modulo_arithmetic.rs b/clippy_lints/src/modulo_arithmetic.rs index d182a7d52497..7318ed57c0e0 100644 --- a/clippy_lints/src/modulo_arithmetic.rs +++ b/clippy_lints/src/modulo_arithmetic.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::fmt::Display; declare_clippy_lint! { diff --git a/clippy_lints/src/mut_key.rs b/clippy_lints/src/mut_key.rs index 1bdd805f6585..b766c118543c 100644 --- a/clippy_lints/src/mut_key.rs +++ b/clippy_lints/src/mut_key.rs @@ -4,7 +4,7 @@ use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::TypeFoldable; use rustc_middle::ty::{Adt, Array, Ref, Slice, Tuple, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::sym; use std::iter; diff --git a/clippy_lints/src/mut_mut.rs b/clippy_lints/src/mut_mut.rs index cb16f00047a3..24c389b3966d 100644 --- a/clippy_lints/src/mut_mut.rs +++ b/clippy_lints/src/mut_mut.rs @@ -5,7 +5,7 @@ use rustc_hir::intravisit; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/mut_mutex_lock.rs b/clippy_lints/src/mut_mutex_lock.rs index 7871be41d629..c636831b1250 100644 --- a/clippy_lints/src/mut_mutex_lock.rs +++ b/clippy_lints/src/mut_mutex_lock.rs @@ -5,7 +5,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, Mutability}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/mut_reference.rs b/clippy_lints/src/mut_reference.rs index 5c3e505c06c4..a077aa4dec8b 100644 --- a/clippy_lints/src/mut_reference.rs +++ b/clippy_lints/src/mut_reference.rs @@ -3,7 +3,7 @@ use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::subst::Subst; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::iter; declare_clippy_lint! { diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs index 4ba68c8eacd2..9cf6ea841e0c 100644 --- a/clippy_lints/src/mutable_debug_assertion.rs +++ b/clippy_lints/src/mutable_debug_assertion.rs @@ -5,7 +5,7 @@ use rustc_hir::{BorrowKind, Expr, ExprKind, MatchSource, Mutability}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/mutex_atomic.rs b/clippy_lints/src/mutex_atomic.rs index 73823779e493..3f612b33f825 100644 --- a/clippy_lints/src/mutex_atomic.rs +++ b/clippy_lints/src/mutex_atomic.rs @@ -7,7 +7,7 @@ use clippy_utils::ty::is_type_diagnostic_item; use rustc_hir::Expr; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_arbitrary_self_type.rs b/clippy_lints/src/needless_arbitrary_self_type.rs index 9838d3cad9f0..ca6f32ee6ea4 100644 --- a/clippy_lints/src/needless_arbitrary_self_type.rs +++ b/clippy_lints/src/needless_arbitrary_self_type.rs @@ -3,7 +3,7 @@ use if_chain::if_chain; use rustc_ast::ast::{BindingMode, Lifetime, Mutability, Param, PatKind, Path, TyKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::kw; use rustc_span::Span; diff --git a/clippy_lints/src/needless_bitwise_bool.rs b/clippy_lints/src/needless_bitwise_bool.rs index a8a8d174a823..31135522e346 100644 --- a/clippy_lints/src/needless_bitwise_bool.rs +++ b/clippy_lints/src/needless_bitwise_bool.rs @@ -5,7 +5,7 @@ use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/needless_bool.rs b/clippy_lints/src/needless_bool.rs index 778d49cb4b6e..bdc73c7f24b8 100644 --- a/clippy_lints/src/needless_bool.rs +++ b/clippy_lints/src/needless_bool.rs @@ -11,7 +11,7 @@ use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Block, Expr, ExprKind, HirId, Node, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::Span; diff --git a/clippy_lints/src/needless_borrowed_ref.rs b/clippy_lints/src/needless_borrowed_ref.rs index 0fcc419e7222..881de243b8f2 100644 --- a/clippy_lints/src/needless_borrowed_ref.rs +++ b/clippy_lints/src/needless_borrowed_ref.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{BindingAnnotation, Mutability, Node, Pat, PatKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/needless_continue.rs b/clippy_lints/src/needless_continue.rs index 98a3bce1ff38..a983a6ed4591 100644 --- a/clippy_lints/src/needless_continue.rs +++ b/clippy_lints/src/needless_continue.rs @@ -37,7 +37,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::source::{indent_of, snippet, snippet_block}; use rustc_ast::ast; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_for_each.rs b/clippy_lints/src/needless_for_each.rs index 6cf513b214e6..8e7a194dc934 100644 --- a/clippy_lints/src/needless_for_each.rs +++ b/clippy_lints/src/needless_for_each.rs @@ -4,7 +4,7 @@ use rustc_hir::{ Expr, ExprKind, Stmt, StmtKind, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{source_map::Span, sym, Symbol}; use if_chain::if_chain; diff --git a/clippy_lints/src/needless_late_init.rs b/clippy_lints/src/needless_late_init.rs index 9957afcbf04a..6d63fb88a861 100644 --- a/clippy_lints/src/needless_late_init.rs +++ b/clippy_lints/src/needless_late_init.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir::intravisit::Visitor; use rustc_hir::{Block, Expr, ExprKind, HirId, Local, LocalSource, MatchSource, Node, Pat, PatKind, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_option_as_deref.rs b/clippy_lints/src/needless_option_as_deref.rs index 9d3d7d1f24cb..d1a94a37e825 100644 --- a/clippy_lints/src/needless_option_as_deref.rs +++ b/clippy_lints/src/needless_option_as_deref.rs @@ -4,7 +4,7 @@ use clippy_utils::ty::is_type_diagnostic_item; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index ebd4fb0bf51c..4f50a750be99 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -14,7 +14,7 @@ use rustc_infer::infer::TyCtxtInferExt; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::mir::FakeReadCause; use rustc_middle::ty::{self, TypeFoldable}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::kw; use rustc_span::{sym, Span}; use rustc_target::spec::abi::Abi; diff --git a/clippy_lints/src/needless_question_mark.rs b/clippy_lints/src/needless_question_mark.rs index 8f85b00596c0..e316c8a80f30 100644 --- a/clippy_lints/src/needless_question_mark.rs +++ b/clippy_lints/src/needless_question_mark.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir::LangItem::{OptionSome, ResultOk}; use rustc_hir::{AsyncGeneratorKind, Block, Body, Expr, ExprKind, GeneratorKind, LangItem, MatchSource, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/needless_update.rs b/clippy_lints/src/needless_update.rs index ed315efaa2fa..051dc6d85095 100644 --- a/clippy_lints/src/needless_update.rs +++ b/clippy_lints/src/needless_update.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs index efe31a154418..5a62321f040e 100644 --- a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs +++ b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/neg_multiply.rs b/clippy_lints/src/neg_multiply.rs index 0d05c83ffe45..75f435a8a2b9 100644 --- a/clippy_lints/src/neg_multiply.rs +++ b/clippy_lints/src/neg_multiply.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index 47121ad84f2c..61b825c626e1 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -8,7 +8,7 @@ use rustc_hir as hir; use rustc_hir::HirIdSet; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/no_effect.rs b/clippy_lints/src/no_effect.rs index 5bf8a1ba1ca3..3b000ad81586 100644 --- a/clippy_lints/src/no_effect.rs +++ b/clippy_lints/src/no_effect.rs @@ -7,7 +7,7 @@ use rustc_errors::Applicability; use rustc_hir::def::{DefKind, Res}; use rustc_hir::{is_range_literal, BinOpKind, BlockCheckMode, Expr, ExprKind, PatKind, Stmt, StmtKind, UnsafeSource}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use std::ops::Deref; declare_clippy_lint! { diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index 21ac6548b017..e839dc8aac0d 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -16,7 +16,7 @@ use rustc_lint::{LateContext, LateLintPass, Lint}; use rustc_middle::mir::interpret::{ConstValue, ErrorHandled}; use rustc_middle::ty::adjustment::Adjust; use rustc_middle::ty::{self, Const, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{InnerSpan, Span, DUMMY_SP}; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs index 0d0c88b02c78..18b0f3d7bda4 100644 --- a/clippy_lints/src/non_expressive_names.rs +++ b/clippy_lints/src/non_expressive_names.rs @@ -5,7 +5,7 @@ use rustc_ast::ast::{ use rustc_ast::visit::{walk_block, walk_expr, walk_pat, Visitor}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; use rustc_span::sym; use rustc_span::symbol::{Ident, Symbol}; diff --git a/clippy_lints/src/non_octal_unix_permissions.rs b/clippy_lints/src/non_octal_unix_permissions.rs index ed022b9d5291..1c3e0fc570ba 100644 --- a/clippy_lints/src/non_octal_unix_permissions.rs +++ b/clippy_lints/src/non_octal_unix_permissions.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/non_send_fields_in_send_ty.rs b/clippy_lints/src/non_send_fields_in_send_ty.rs index ab1559c85d8b..6ababfe7e12f 100644 --- a/clippy_lints/src/non_send_fields_in_send_ty.rs +++ b/clippy_lints/src/non_send_fields_in_send_ty.rs @@ -8,7 +8,7 @@ use rustc_hir::{FieldDef, Item, ItemKind, Node}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::{self, subst::GenericArgKind, Ty}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/nonstandard_macro_braces.rs b/clippy_lints/src/nonstandard_macro_braces.rs index 4722c031006b..3655e067cbf5 100644 --- a/clippy_lints/src/nonstandard_macro_braces.rs +++ b/clippy_lints/src/nonstandard_macro_braces.rs @@ -10,7 +10,7 @@ use rustc_ast::ast; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_hir::def_id::DefId; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_span::{Span, Symbol}; use serde::{de, Deserialize}; diff --git a/clippy_lints/src/octal_escapes.rs b/clippy_lints/src/octal_escapes.rs index c19cea661042..c83482203d3c 100644 --- a/clippy_lints/src/octal_escapes.rs +++ b/clippy_lints/src/octal_escapes.rs @@ -4,7 +4,7 @@ use rustc_ast::token::{Lit, LitKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; use std::fmt::Write; diff --git a/clippy_lints/src/open_options.rs b/clippy_lints/src/open_options.rs index 5a0b5042018b..306d5786db8a 100644 --- a/clippy_lints/src/open_options.rs +++ b/clippy_lints/src/open_options.rs @@ -4,7 +4,7 @@ use clippy_utils::ty::match_type; use rustc_ast::ast::LitKind; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::{Span, Spanned}; declare_clippy_lint! { diff --git a/clippy_lints/src/option_env_unwrap.rs b/clippy_lints/src/option_env_unwrap.rs index 3f5286ba097b..e79bf83246c8 100644 --- a/clippy_lints/src/option_env_unwrap.rs +++ b/clippy_lints/src/option_env_unwrap.rs @@ -3,7 +3,7 @@ use clippy_utils::is_direct_expn_of; use if_chain::if_chain; use rustc_ast::ast::{Expr, ExprKind}; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/option_if_let_else.rs b/clippy_lints/src/option_if_let_else.rs index c9f807f2aa3a..b4f1711b8891 100644 --- a/clippy_lints/src/option_if_let_else.rs +++ b/clippy_lints/src/option_if_let_else.rs @@ -10,7 +10,7 @@ use rustc_errors::Applicability; use rustc_hir::LangItem::OptionSome; use rustc_hir::{def::Res, BindingAnnotation, Expr, ExprKind, Mutability, PatKind, Path, QPath, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/overflow_check_conditional.rs b/clippy_lints/src/overflow_check_conditional.rs index 6dabbd480311..1f187b44d080 100644 --- a/clippy_lints/src/overflow_check_conditional.rs +++ b/clippy_lints/src/overflow_check_conditional.rs @@ -3,7 +3,7 @@ use clippy_utils::SpanlessEq; use if_chain::if_chain; use rustc_hir::{BinOpKind, Expr, ExprKind, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/panic_in_result_fn.rs b/clippy_lints/src/panic_in_result_fn.rs index b7a56970b335..0e31f68cfeb5 100644 --- a/clippy_lints/src/panic_in_result_fn.rs +++ b/clippy_lints/src/panic_in_result_fn.rs @@ -6,7 +6,7 @@ use clippy_utils::visitors::expr_visitor_no_bodies; use rustc_hir as hir; use rustc_hir::intravisit::{FnKind, Visitor}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/panic_unimplemented.rs b/clippy_lints/src/panic_unimplemented.rs index 6ef6b9a20aa4..6dbc83d18a45 100644 --- a/clippy_lints/src/panic_unimplemented.rs +++ b/clippy_lints/src/panic_unimplemented.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use clippy_utils::macros::{is_panic, root_macro_call_first_node}; use rustc_hir::Expr; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/partialeq_ne_impl.rs b/clippy_lints/src/partialeq_ne_impl.rs index e827cdaae872..aaf3c2605966 100644 --- a/clippy_lints/src/partialeq_ne_impl.rs +++ b/clippy_lints/src/partialeq_ne_impl.rs @@ -3,7 +3,7 @@ use clippy_utils::is_automatically_derived; use if_chain::if_chain; use rustc_hir::{Impl, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/pass_by_ref_or_value.rs b/clippy_lints/src/pass_by_ref_or_value.rs index 3092ab8392a7..67a4850e2440 100644 --- a/clippy_lints/src/pass_by_ref_or_value.rs +++ b/clippy_lints/src/pass_by_ref_or_value.rs @@ -14,7 +14,7 @@ use rustc_hir::{BindingAnnotation, Body, FnDecl, HirId, Impl, ItemKind, MutTy, M use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; use rustc_middle::ty::layout::LayoutOf; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::def_id::LocalDefId; use rustc_span::{sym, Span}; use rustc_target::spec::abi::Abi; diff --git a/clippy_lints/src/path_buf_push_overwrite.rs b/clippy_lints/src/path_buf_push_overwrite.rs index 3f940ce61c03..2695899a6533 100644 --- a/clippy_lints/src/path_buf_push_overwrite.rs +++ b/clippy_lints/src/path_buf_push_overwrite.rs @@ -5,7 +5,7 @@ use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; use std::path::{Component, Path}; diff --git a/clippy_lints/src/pattern_type_mismatch.rs b/clippy_lints/src/pattern_type_mismatch.rs index be319ee110d2..2bf4ad9cd461 100644 --- a/clippy_lints/src/pattern_type_mismatch.rs +++ b/clippy_lints/src/pattern_type_mismatch.rs @@ -5,7 +5,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/precedence.rs b/clippy_lints/src/precedence.rs index cc0533c9f5d1..a65a3f475b94 100644 --- a/clippy_lints/src/precedence.rs +++ b/clippy_lints/src/precedence.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_ast::ast::{BinOpKind, Expr, ExprKind, LitKind, UnOp}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; const ALLOWED_ODD_FUNCTIONS: [&str; 14] = [ diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index e0ce1b7db003..60e3c2580706 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -17,7 +17,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, AssocItems, AssocKind, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::Symbol; use rustc_span::{sym, MultiSpan}; diff --git a/clippy_lints/src/ptr_eq.rs b/clippy_lints/src/ptr_eq.rs index 2bec93ac6060..0139de4fd0e3 100644 --- a/clippy_lints/src/ptr_eq.rs +++ b/clippy_lints/src/ptr_eq.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/ptr_offset_with_cast.rs b/clippy_lints/src/ptr_offset_with_cast.rs index b907f38afbb9..107041837789 100644 --- a/clippy_lints/src/ptr_offset_with_cast.rs +++ b/clippy_lints/src/ptr_offset_with_cast.rs @@ -3,7 +3,7 @@ use clippy_utils::source::snippet_opt; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; use std::fmt; diff --git a/clippy_lints/src/question_mark.rs b/clippy_lints/src/question_mark.rs index 6f634ded5fef..d467df63ede1 100644 --- a/clippy_lints/src/question_mark.rs +++ b/clippy_lints/src/question_mark.rs @@ -9,7 +9,7 @@ use rustc_errors::Applicability; use rustc_hir::LangItem::{OptionNone, OptionSome, ResultOk}; use rustc_hir::{BindingAnnotation, Expr, ExprKind, PatKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/ranges.rs b/clippy_lints/src/ranges.rs index e213c208794c..349c54ea046e 100644 --- a/clippy_lints/src/ranges.rs +++ b/clippy_lints/src/ranges.rs @@ -11,7 +11,7 @@ use rustc_hir::{BinOpKind, Expr, ExprKind, HirId, PathSegment, QPath}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::{Span, Spanned}; use rustc_span::sym; use std::cmp::Ordering; diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index 3e0e32857f1d..1f73b61c03e2 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -16,7 +16,7 @@ use rustc_middle::mir::{ }; use rustc_middle::ty::{self, fold::TypeVisitor, Ty}; use rustc_mir_dataflow::{Analysis, AnalysisDomain, CallReturnPlaces, GenKill, GenKillAnalysis, ResultsCursor}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::{BytePos, Span}; use rustc_span::sym; use std::convert::TryFrom; diff --git a/clippy_lints/src/redundant_closure_call.rs b/clippy_lints/src/redundant_closure_call.rs index 5a25008e95e5..b67c6d01ab39 100644 --- a/clippy_lints/src/redundant_closure_call.rs +++ b/clippy_lints/src/redundant_closure_call.rs @@ -11,7 +11,7 @@ use rustc_hir::intravisit::Visitor as HirVisitor; use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext}; use rustc_middle::hir::nested_filter; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/redundant_else.rs b/clippy_lints/src/redundant_else.rs index 73088ce1a87e..b7411eb3c629 100644 --- a/clippy_lints/src/redundant_else.rs +++ b/clippy_lints/src/redundant_else.rs @@ -3,7 +3,7 @@ use rustc_ast::ast::{Block, Expr, ExprKind, Stmt, StmtKind}; use rustc_ast::visit::{walk_expr, Visitor}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/redundant_field_names.rs b/clippy_lints/src/redundant_field_names.rs index 40a62fd6d201..97f8abc1350d 100644 --- a/clippy_lints/src/redundant_field_names.rs +++ b/clippy_lints/src/redundant_field_names.rs @@ -5,7 +5,7 @@ use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/redundant_pub_crate.rs b/clippy_lints/src/redundant_pub_crate.rs index 2cee3c14d7f3..3be083dafd49 100644 --- a/clippy_lints/src/redundant_pub_crate.rs +++ b/clippy_lints/src/redundant_pub_crate.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_then; use rustc_errors::Applicability; use rustc_hir::{Item, ItemKind, VisibilityKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/redundant_slicing.rs b/clippy_lints/src/redundant_slicing.rs index cd3aee556553..a32d2c5ae03c 100644 --- a/clippy_lints/src/redundant_slicing.rs +++ b/clippy_lints/src/redundant_slicing.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{BorrowKind, Expr, ExprKind, LangItem, Mutability}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/redundant_static_lifetimes.rs b/clippy_lints/src/redundant_static_lifetimes.rs index ea5064217abe..ae668005a5a1 100644 --- a/clippy_lints/src/redundant_static_lifetimes.rs +++ b/clippy_lints/src/redundant_static_lifetimes.rs @@ -5,7 +5,7 @@ use rustc_ast::ast::{Item, ItemKind, Ty, TyKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/ref_option_ref.rs b/clippy_lints/src/ref_option_ref.rs index 909d6971a549..3bc4f5992962 100644 --- a/clippy_lints/src/ref_option_ref.rs +++ b/clippy_lints/src/ref_option_ref.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{GenericArg, Mutability, Ty, TyKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/reference.rs b/clippy_lints/src/reference.rs index 811a7bb9c153..0427f1a9dd6b 100644 --- a/clippy_lints/src/reference.rs +++ b/clippy_lints/src/reference.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_ast::ast::{Expr, ExprKind, Mutability, UnOp}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::BytePos; declare_clippy_lint! { diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs index b6d04334de9e..0be8d3e5a125 100644 --- a/clippy_lints/src/regex.rs +++ b/clippy_lints/src/regex.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_ast::ast::{LitKind, StrStyle}; use rustc_hir::{BorrowKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::{BytePos, Span}; use std::convert::TryFrom; diff --git a/clippy_lints/src/repeat_once.rs b/clippy_lints/src/repeat_once.rs index 898c70ace66f..86a75972fd5c 100644 --- a/clippy_lints/src/repeat_once.rs +++ b/clippy_lints/src/repeat_once.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/return_self_not_must_use.rs b/clippy_lints/src/return_self_not_must_use.rs index 79f104eac0be..44886c123f01 100644 --- a/clippy_lints/src/return_self_not_must_use.rs +++ b/clippy_lints/src/return_self_not_must_use.rs @@ -6,7 +6,7 @@ use rustc_hir::intravisit::FnKind; use rustc_hir::{Body, FnDecl, HirId, TraitItem, TraitItemKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs index 8068fa22d9cc..305fdfa0c0e0 100644 --- a/clippy_lints/src/returns.rs +++ b/clippy_lints/src/returns.rs @@ -9,7 +9,7 @@ use rustc_hir::{Block, Body, Expr, ExprKind, FnDecl, HirId, MatchSource, PatKind use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::subst::GenericArgKind; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::hygiene::DesugaringKind; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/same_name_method.rs b/clippy_lints/src/same_name_method.rs index 22b458969551..a2623159325d 100644 --- a/clippy_lints/src/same_name_method.rs +++ b/clippy_lints/src/same_name_method.rs @@ -4,7 +4,7 @@ use rustc_hir::def::{DefKind, Res}; use rustc_hir::{Impl, ItemKind, Node, Path, QPath, TraitRef, TyKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::AssocKind; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::Symbol; use rustc_span::Span; use std::collections::{BTreeMap, BTreeSet}; diff --git a/clippy_lints/src/self_assignment.rs b/clippy_lints/src/self_assignment.rs index b14f0518bdb7..09abca651a52 100644 --- a/clippy_lints/src/self_assignment.rs +++ b/clippy_lints/src/self_assignment.rs @@ -3,7 +3,7 @@ use clippy_utils::eq_expr_value; use clippy_utils::source::snippet; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/self_named_constructors.rs b/clippy_lints/src/self_named_constructors.rs index 123d0ad0457d..8de3a84eef15 100644 --- a/clippy_lints/src/self_named_constructors.rs +++ b/clippy_lints/src/self_named_constructors.rs @@ -3,7 +3,7 @@ use clippy_utils::return_ty; use clippy_utils::ty::{contains_adt_constructor, contains_ty}; use rustc_hir::{Impl, ImplItem, ImplItemKind, ItemKind, Node}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/semicolon_if_nothing_returned.rs b/clippy_lints/src/semicolon_if_nothing_returned.rs index 729694da46d5..38081e244962 100644 --- a/clippy_lints/src/semicolon_if_nothing_returned.rs +++ b/clippy_lints/src/semicolon_if_nothing_returned.rs @@ -6,7 +6,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Block, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/serde_api.rs b/clippy_lints/src/serde_api.rs index 398e2c200de3..9c9406eae8d1 100644 --- a/clippy_lints/src/serde_api.rs +++ b/clippy_lints/src/serde_api.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use clippy_utils::{get_trait_def_id, paths}; use rustc_hir::{Impl, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs index ce05c5a6164f..e174e858dfd2 100644 --- a/clippy_lints/src/shadow.rs +++ b/clippy_lints/src/shadow.rs @@ -7,7 +7,7 @@ use rustc_hir::def_id::LocalDefId; use rustc_hir::hir_id::ItemLocalId; use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, Let, Node, Pat, PatKind, QPath, UnOp}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{Span, Symbol}; declare_clippy_lint! { diff --git a/clippy_lints/src/single_char_lifetime_names.rs b/clippy_lints/src/single_char_lifetime_names.rs index aa306a630c46..9f6a9d52d4f6 100644 --- a/clippy_lints/src/single_char_lifetime_names.rs +++ b/clippy_lints/src/single_char_lifetime_names.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_ast::ast::{GenericParam, GenericParamKind}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/single_component_path_imports.rs b/clippy_lints/src/single_component_path_imports.rs index 961cdb317e76..0ce86a8fed9e 100644 --- a/clippy_lints/src/single_component_path_imports.rs +++ b/clippy_lints/src/single_component_path_imports.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_sugg}; use rustc_ast::{ptr::P, Crate, Item, ItemKind, MacroDef, ModKind, UseTreeKind, VisibilityKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{edition::Edition, symbol::kw, Span, Symbol}; declare_clippy_lint! { diff --git a/clippy_lints/src/size_of_in_element_count.rs b/clippy_lints/src/size_of_in_element_count.rs index 971729e5c54b..6246bc4f0d1f 100644 --- a/clippy_lints/src/size_of_in_element_count.rs +++ b/clippy_lints/src/size_of_in_element_count.rs @@ -8,7 +8,7 @@ use rustc_hir::BinOpKind; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, Ty, TypeAndMut}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/slow_vector_initialization.rs b/clippy_lints/src/slow_vector_initialization.rs index b4ad5dcbe3e9..b4b00d06980c 100644 --- a/clippy_lints/src/slow_vector_initialization.rs +++ b/clippy_lints/src/slow_vector_initialization.rs @@ -8,7 +8,7 @@ use rustc_errors::Applicability; use rustc_hir::intravisit::{walk_block, walk_expr, walk_stmt, Visitor}; use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, HirId, PatKind, QPath, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/stable_sort_primitive.rs b/clippy_lints/src/stable_sort_primitive.rs index bcd28b429784..f45f77ec14f1 100644 --- a/clippy_lints/src/stable_sort_primitive.rs +++ b/clippy_lints/src/stable_sort_primitive.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index 3573f632a367..1bf20813ae23 100644 --- a/clippy_lints/src/strings.rs +++ b/clippy_lints/src/strings.rs @@ -9,7 +9,7 @@ use rustc_hir::{BinOpKind, BorrowKind, Expr, ExprKind, LangItem, QPath}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::sym; diff --git a/clippy_lints/src/strlen_on_c_strings.rs b/clippy_lints/src/strlen_on_c_strings.rs index 7bc9cf742e65..a8b86cf8f335 100644 --- a/clippy_lints/src/strlen_on_c_strings.rs +++ b/clippy_lints/src/strlen_on_c_strings.rs @@ -7,7 +7,7 @@ use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{Block, BlockCheckMode, Expr, ExprKind, Node, UnsafeSource}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/suspicious_operation_groupings.rs b/clippy_lints/src/suspicious_operation_groupings.rs index c3d984fb5ae1..ee2bb06aaada 100644 --- a/clippy_lints/src/suspicious_operation_groupings.rs +++ b/clippy_lints/src/suspicious_operation_groupings.rs @@ -7,7 +7,7 @@ use rustc_ast::ast::{BinOpKind, Expr, ExprKind, StmtKind}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::symbol::Ident; use rustc_span::Span; diff --git a/clippy_lints/src/suspicious_trait_impl.rs b/clippy_lints/src/suspicious_trait_impl.rs index 4294464dbf61..5680a462c676 100644 --- a/clippy_lints/src/suspicious_trait_impl.rs +++ b/clippy_lints/src/suspicious_trait_impl.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_hir as hir; use rustc_hir::intravisit::{walk_expr, Visitor}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/swap.rs b/clippy_lints/src/swap.rs index 1885f3ca414d..855c0284c19f 100644 --- a/clippy_lints/src/swap.rs +++ b/clippy_lints/src/swap.rs @@ -8,7 +8,7 @@ use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Block, Expr, ExprKind, PatKind, QPath, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; use rustc_span::{sym, Span}; diff --git a/clippy_lints/src/tabs_in_doc_comments.rs b/clippy_lints/src/tabs_in_doc_comments.rs index 15543b6a2627..f8e9e0274923 100644 --- a/clippy_lints/src/tabs_in_doc_comments.rs +++ b/clippy_lints/src/tabs_in_doc_comments.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg; use rustc_ast::ast; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::{BytePos, Span}; use std::convert::TryFrom; diff --git a/clippy_lints/src/temporary_assignment.rs b/clippy_lints/src/temporary_assignment.rs index 3766b8f8ed10..8a3a573c22f5 100644 --- a/clippy_lints/src/temporary_assignment.rs +++ b/clippy_lints/src/temporary_assignment.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint; use clippy_utils::is_adjusted; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/to_digit_is_some.rs b/clippy_lints/src/to_digit_is_some.rs index aa6c01b3a7cd..b2e9b8ef88f0 100644 --- a/clippy_lints/src/to_digit_is_some.rs +++ b/clippy_lints/src/to_digit_is_some.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/to_string_in_display.rs b/clippy_lints/src/to_string_in_display.rs index 03060d78fc5a..d1d405f5b0d5 100644 --- a/clippy_lints/src/to_string_in_display.rs +++ b/clippy_lints/src/to_string_in_display.rs @@ -3,7 +3,7 @@ use clippy_utils::{is_diag_trait_item, match_def_path, path_to_local_id, paths}; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/trailing_empty_array.rs b/clippy_lints/src/trailing_empty_array.rs index c9b2ce476e89..d1ea809d6f25 100644 --- a/clippy_lints/src/trailing_empty_array.rs +++ b/clippy_lints/src/trailing_empty_array.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_hir::{HirId, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::Const; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/trait_bounds.rs b/clippy_lints/src/trait_bounds.rs index 5257f5302cd9..fce23fd2f74d 100644 --- a/clippy_lints/src/trait_bounds.rs +++ b/clippy_lints/src/trait_bounds.rs @@ -12,7 +12,7 @@ use rustc_hir::{ WherePredicate, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/transmute/mod.rs b/clippy_lints/src/transmute/mod.rs index d66470d45824..b3b868a56448 100644 --- a/clippy_lints/src/transmute/mod.rs +++ b/clippy_lints/src/transmute/mod.rs @@ -18,7 +18,7 @@ use clippy_utils::in_constant; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/transmuting_null.rs b/clippy_lints/src/transmuting_null.rs index 7939dfedc3a2..440a13eac6c3 100644 --- a/clippy_lints/src/transmuting_null.rs +++ b/clippy_lints/src/transmuting_null.rs @@ -6,7 +6,7 @@ use rustc_ast::LitKind; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/try_err.rs b/clippy_lints/src/try_err.rs index 4da32c52e750..b4ca4385bc4a 100644 --- a/clippy_lints/src/try_err.rs +++ b/clippy_lints/src/try_err.rs @@ -9,7 +9,7 @@ use rustc_hir::{Expr, ExprKind, LangItem, MatchSource, QPath}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{hygiene, sym}; declare_clippy_lint! { diff --git a/clippy_lints/src/types/mod.rs b/clippy_lints/src/types/mod.rs index 67cc89133189..70972bcab400 100644 --- a/clippy_lints/src/types/mod.rs +++ b/clippy_lints/src/types/mod.rs @@ -16,7 +16,7 @@ use rustc_hir::{ TraitItemKind, TyKind, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/undocumented_unsafe_blocks.rs b/clippy_lints/src/undocumented_unsafe_blocks.rs index e42c6c63ede0..ca32e9ef84cc 100644 --- a/clippy_lints/src/undocumented_unsafe_blocks.rs +++ b/clippy_lints/src/undocumented_unsafe_blocks.rs @@ -8,7 +8,7 @@ use rustc_lexer::TokenKind; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::TyCtxt; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::{BytePos, Span}; use std::borrow::Cow; diff --git a/clippy_lints/src/undropped_manually_drops.rs b/clippy_lints/src/undropped_manually_drops.rs index 7557e14d11f5..cf5486f5738e 100644 --- a/clippy_lints/src/undropped_manually_drops.rs +++ b/clippy_lints/src/undropped_manually_drops.rs @@ -3,7 +3,7 @@ use clippy_utils::ty::is_type_lang_item; use clippy_utils::{match_function_call, paths}; use rustc_hir::{lang_items, Expr}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/unicode.rs b/clippy_lints/src/unicode.rs index afd7be89a4e2..b9cdd85527f3 100644 --- a/clippy_lints/src/unicode.rs +++ b/clippy_lints/src/unicode.rs @@ -5,7 +5,7 @@ use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, HirId}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use unicode_normalization::UnicodeNormalization; diff --git a/clippy_lints/src/uninit_vec.rs b/clippy_lints/src/uninit_vec.rs index 6d909c34690d..205ab9f137c8 100644 --- a/clippy_lints/src/uninit_vec.rs +++ b/clippy_lints/src/uninit_vec.rs @@ -6,7 +6,7 @@ use rustc_hir::{Block, Expr, ExprKind, HirId, PatKind, PathSegment, Stmt, StmtKi use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::lint::in_external_macro; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; // TODO: add `ReadBuf` (RFC 2930) in "How to fix" once it is available in std diff --git a/clippy_lints/src/unit_hash.rs b/clippy_lints/src/unit_hash.rs index 88ca0cb20a12..6a437e13d821 100644 --- a/clippy_lints/src/unit_hash.rs +++ b/clippy_lints/src/unit_hash.rs @@ -3,7 +3,7 @@ use clippy_utils::source::snippet; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/unit_return_expecting_ord.rs b/clippy_lints/src/unit_return_expecting_ord.rs index eee1229e1ef0..63f82654b701 100644 --- a/clippy_lints/src/unit_return_expecting_ord.rs +++ b/clippy_lints/src/unit_return_expecting_ord.rs @@ -6,7 +6,7 @@ use rustc_hir::{Expr, ExprKind, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; use rustc_middle::ty::{GenericPredicates, PredicateKind, ProjectionPredicate, TraitPredicate}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{BytePos, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/unit_types/mod.rs b/clippy_lints/src/unit_types/mod.rs index d9f5b53b413a..de0e29bc0ce3 100644 --- a/clippy_lints/src/unit_types/mod.rs +++ b/clippy_lints/src/unit_types/mod.rs @@ -5,7 +5,7 @@ mod utils; use rustc_hir::{Expr, Stmt}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/unnamed_address.rs b/clippy_lints/src/unnamed_address.rs index 0bcafde658a4..76755b2cba8a 100644 --- a/clippy_lints/src/unnamed_address.rs +++ b/clippy_lints/src/unnamed_address.rs @@ -4,7 +4,7 @@ use if_chain::if_chain; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/unnecessary_self_imports.rs b/clippy_lints/src/unnecessary_self_imports.rs index 839a4bdab09d..05d58dfbda95 100644 --- a/clippy_lints/src/unnecessary_self_imports.rs +++ b/clippy_lints/src/unnecessary_self_imports.rs @@ -3,7 +3,7 @@ use if_chain::if_chain; use rustc_ast::{Item, ItemKind, UseTreeKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::kw; declare_clippy_lint! { diff --git a/clippy_lints/src/unnecessary_sort_by.rs b/clippy_lints/src/unnecessary_sort_by.rs index e6c260ed96a9..6548c5f298ad 100644 --- a/clippy_lints/src/unnecessary_sort_by.rs +++ b/clippy_lints/src/unnecessary_sort_by.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, Mutability, Param, Pat, PatKind, Path, PathSegment, QPath}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, subst::GenericArgKind}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; use rustc_span::symbol::Ident; use std::iter; diff --git a/clippy_lints/src/unnecessary_wraps.rs b/clippy_lints/src/unnecessary_wraps.rs index 1728533f18b8..f46b09e5e12f 100644 --- a/clippy_lints/src/unnecessary_wraps.rs +++ b/clippy_lints/src/unnecessary_wraps.rs @@ -8,7 +8,7 @@ use rustc_hir::LangItem::{OptionSome, ResultOk}; use rustc_hir::{Body, ExprKind, FnDecl, HirId, Impl, ItemKind, Node}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::sym; use rustc_span::Span; diff --git a/clippy_lints/src/unnested_or_patterns.rs b/clippy_lints/src/unnested_or_patterns.rs index 1d4fe9cfd3cf..bb5fa25efaa1 100644 --- a/clippy_lints/src/unnested_or_patterns.rs +++ b/clippy_lints/src/unnested_or_patterns.rs @@ -10,7 +10,7 @@ use rustc_ast_pretty::pprust; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::DUMMY_SP; use std::cell::Cell; diff --git a/clippy_lints/src/unsafe_removed_from_name.rs b/clippy_lints/src/unsafe_removed_from_name.rs index 64f7a055cd9b..865fcc050b07 100644 --- a/clippy_lints/src/unsafe_removed_from_name.rs +++ b/clippy_lints/src/unsafe_removed_from_name.rs @@ -1,7 +1,7 @@ use clippy_utils::diagnostics::span_lint; use rustc_ast::ast::{Item, ItemKind, UseTree, UseTreeKind}; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::symbol::Ident; diff --git a/clippy_lints/src/unused_async.rs b/clippy_lints/src/unused_async.rs index 2b89398ecd6a..559c95ec9310 100644 --- a/clippy_lints/src/unused_async.rs +++ b/clippy_lints/src/unused_async.rs @@ -3,7 +3,7 @@ use rustc_hir::intravisit::{walk_expr, walk_fn, FnKind, Visitor}; use rustc_hir::{Body, Expr, ExprKind, FnDecl, FnHeader, HirId, IsAsync, YieldSource}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/unused_io_amount.rs b/clippy_lints/src/unused_io_amount.rs index 323cf83ffcff..13a9e3c69c6e 100644 --- a/clippy_lints/src/unused_io_amount.rs +++ b/clippy_lints/src/unused_io_amount.rs @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::{span_lint, span_lint_and_help}; use clippy_utils::{is_try, match_trait_method, paths}; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/unused_self.rs b/clippy_lints/src/unused_self.rs index fd9d5b52e501..0e942896791c 100644 --- a/clippy_lints/src/unused_self.rs +++ b/clippy_lints/src/unused_self.rs @@ -3,7 +3,7 @@ use clippy_utils::visitors::is_local_used; use if_chain::if_chain; use rustc_hir::{Impl, ImplItem, ImplItemKind, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/unused_unit.rs b/clippy_lints/src/unused_unit.rs index bfd17a687499..b5e5b834fb34 100644 --- a/clippy_lints/src/unused_unit.rs +++ b/clippy_lints/src/unused_unit.rs @@ -5,7 +5,7 @@ use rustc_ast::ast; use rustc_ast::visit::FnKind; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::BytePos; diff --git a/clippy_lints/src/unwrap.rs b/clippy_lints/src/unwrap.rs index 9b9e25326f96..0589f9310713 100644 --- a/clippy_lints/src/unwrap.rs +++ b/clippy_lints/src/unwrap.rs @@ -10,7 +10,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; use rustc_middle::lint::in_external_macro; use rustc_middle::ty::Ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Span; use rustc_span::sym; diff --git a/clippy_lints/src/unwrap_in_result.rs b/clippy_lints/src/unwrap_in_result.rs index 2c13f1049b59..c9578caf8659 100644 --- a/clippy_lints/src/unwrap_in_result.rs +++ b/clippy_lints/src/unwrap_in_result.rs @@ -7,7 +7,7 @@ use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::{Expr, ImplItemKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::{sym, Span}; declare_clippy_lint! { diff --git a/clippy_lints/src/upper_case_acronyms.rs b/clippy_lints/src/upper_case_acronyms.rs index 7286d0a7bf99..4706eb39aa06 100644 --- a/clippy_lints/src/upper_case_acronyms.rs +++ b/clippy_lints/src/upper_case_acronyms.rs @@ -4,7 +4,7 @@ use rustc_errors::Applicability; use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::Ident; declare_clippy_lint! { diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index be20282b3b88..65035f33943e 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -13,7 +13,7 @@ use rustc_hir::{ }; use rustc_lint::{LateContext, LateLintPass}; use rustc_semver::RustcVersion; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Span; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/useless_conversion.rs b/clippy_lints/src/useless_conversion.rs index abd8a3623703..f608cc272b47 100644 --- a/clippy_lints/src/useless_conversion.rs +++ b/clippy_lints/src/useless_conversion.rs @@ -8,7 +8,7 @@ use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, HirId, MatchSource}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::sym; declare_clippy_lint! { diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index d23c85c033b2..dd756c02d6d9 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -8,7 +8,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; use rustc_hir::{ArrayLen, ExprKind, FnRetTy, HirId, Lit, PatKind, QPath, StmtKind, TyKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::symbol::{Ident, Symbol}; use std::fmt::{Display, Formatter, Write as _}; diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index 869114831370..65519d00e587 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -4,8 +4,8 @@ use clippy_utils::get_attr; use rustc_ast::ast::{Attribute, InlineAsmTemplatePiece}; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass, LintContext}; +use rustc_session::declare_lint_pass; use rustc_session::Session; -use rustc_session::{declare_lint_pass, declare_tool_lint}; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index 11c90647ccc0..be5ef5f96640 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -27,7 +27,7 @@ use rustc_middle::hir::nested_filter; use rustc_middle::mir::interpret::ConstValue; use rustc_middle::ty; use rustc_semver::RustcVersion; -use rustc_session::{declare_lint_pass, declare_tool_lint, impl_lint_pass}; +use rustc_session::{declare_lint_pass, impl_lint_pass}; use rustc_span::source_map::Spanned; use rustc_span::symbol::Symbol; use rustc_span::{sym, BytePos, Span}; diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index 56633490eaa1..4a3598d91a6a 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -20,7 +20,7 @@ use rustc_hir::{ }; use rustc_lint::{CheckLintNameResult, LateContext, LateLintPass, LintContext, LintId}; use rustc_middle::hir::nested_filter; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::Ident; use rustc_span::{sym, Loc, Span, Symbol}; use serde::{ser::SerializeStruct, Serialize, Serializer}; diff --git a/clippy_lints/src/vec.rs b/clippy_lints/src/vec.rs index 79e7410c3a83..e2f1f3f89df3 100644 --- a/clippy_lints/src/vec.rs +++ b/clippy_lints/src/vec.rs @@ -9,7 +9,7 @@ use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, Ty}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::source_map::Span; #[allow(clippy::module_name_repetitions)] diff --git a/clippy_lints/src/vec_init_then_push.rs b/clippy_lints/src/vec_init_then_push.rs index fbf2b3e081b8..b58e53b77e08 100644 --- a/clippy_lints/src/vec_init_then_push.rs +++ b/clippy_lints/src/vec_init_then_push.rs @@ -7,7 +7,7 @@ use rustc_errors::Applicability; use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, HirId, Local, PatKind, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::lint::in_external_macro; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/vec_resize_to_zero.rs b/clippy_lints/src/vec_resize_to_zero.rs index 4d86abd0fa12..e5b7fbaae1f6 100644 --- a/clippy_lints/src/vec_resize_to_zero.rs +++ b/clippy_lints/src/vec_resize_to_zero.rs @@ -6,7 +6,7 @@ use rustc_errors::Applicability; use rustc_hir as hir; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::source_map::Spanned; declare_clippy_lint! { diff --git a/clippy_lints/src/verbose_file_reads.rs b/clippy_lints/src/verbose_file_reads.rs index 8e2ddd225fdb..1fafbd1dcc93 100644 --- a/clippy_lints/src/verbose_file_reads.rs +++ b/clippy_lints/src/verbose_file_reads.rs @@ -4,7 +4,7 @@ use clippy_utils::ty::match_type; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind, QPath}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/wildcard_imports.rs b/clippy_lints/src/wildcard_imports.rs index 832da66a5369..f37ca227e8f0 100644 --- a/clippy_lints/src/wildcard_imports.rs +++ b/clippy_lints/src/wildcard_imports.rs @@ -8,7 +8,7 @@ use rustc_hir::{ Item, ItemKind, PathSegment, UseKind, }; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::kw; use rustc_span::{sym, BytePos}; diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index b0044695ea8a..b7c108da8f16 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -11,7 +11,7 @@ use rustc_errors::Applicability; use rustc_lexer::unescape::{self, EscapeError}; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_parse::parser; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::impl_lint_pass; use rustc_span::symbol::{kw, Symbol}; use rustc_span::{sym, BytePos, Span, DUMMY_SP}; diff --git a/clippy_lints/src/zero_div_zero.rs b/clippy_lints/src/zero_div_zero.rs index 641681185a2f..22b1e453941c 100644 --- a/clippy_lints/src/zero_div_zero.rs +++ b/clippy_lints/src/zero_div_zero.rs @@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_help; use if_chain::if_chain; use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does diff --git a/clippy_lints/src/zero_sized_map_values.rs b/clippy_lints/src/zero_sized_map_values.rs index 70b0560e6760..837e43cf4eea 100644 --- a/clippy_lints/src/zero_sized_map_values.rs +++ b/clippy_lints/src/zero_sized_map_values.rs @@ -5,7 +5,7 @@ use rustc_hir::{self as hir, HirId, ItemKind, Node}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::layout::LayoutOf as _; use rustc_middle::ty::{Adt, Ty, TypeFoldable}; -use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_lint_pass; use rustc_span::sym; use rustc_typeck::hir_ty_to_ty; From 62ad62ba79e8341548bc19baff6d8901c150f97a Mon Sep 17 00:00:00 2001 From: xFrednet Date: Thu, 17 Feb 2022 23:12:38 +0100 Subject: [PATCH 8/9] Make `is_nightly_run` const --- clippy_lints/src/lib.rs | 1 - clippy_utils/src/nightly.rs | 34 ++++++++++------------------------ 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 842528c5f6f8..f78e24f768b8 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -438,7 +438,6 @@ pub fn read_conf(sess: &Session) -> Conf { /// Used in `./src/driver.rs`. #[allow(clippy::too_many_lines)] pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) { - clippy_utils::nightly::eval_is_nightly_run(sess); register_removed_non_tool_lints(store); include!("lib.deprecated.rs"); diff --git a/clippy_utils/src/nightly.rs b/clippy_utils/src/nightly.rs index b5a4dbcc8b69..f72410a7d334 100644 --- a/clippy_utils/src/nightly.rs +++ b/clippy_utils/src/nightly.rs @@ -1,28 +1,14 @@ //! This module is intended to hold most implementations related to Clippy's //! nightly lints. -use std::lazy::SyncOnceCell; - -use rustc_session::Session; - -static IS_NIGHTLY_RUN: SyncOnceCell = SyncOnceCell::new(); - -/// This function is used to determine if nightly lints should be enabled or disabled -/// in this Clippy run. -/// -/// It's only allowed to call this once. This is done by [`clippy_lints::lib`] -pub fn eval_is_nightly_run(sess: &Session) { - // This allows users to disable nightly lints on nightly - let disable_nightly = std::env::var("CLIPPY_NIGHTLY").map(|s| s == "0").unwrap_or(false); - // This allows users to enable nightly lints on stable - let enable_nightly = std::env::var("CLIPPY_NIGHTLY").map(|s| s == "1").unwrap_or(false); - - let is_nightly_run = enable_nightly || (sess.is_nightly_build() && !disable_nightly); - - IS_NIGHTLY_RUN - .set(is_nightly_run) - .expect("`ENABLE_NIGHTLY_LINTS` should only be set once."); -} +/// This determines if Clippy is being compiled for nightly or stable. Bootstrap which is +/// used to compile Clippy in the rust repo will set the `CFG_DISABLE_UNSTABLE_FEATURES` +/// environment value if Clippy is being compiled for nightly (Or another edge case see +/// [`rustc_feature::UnstableFeatures`]). In the rust-clippy repo, Clippy is being compiled +/// with cargo, therefore we can just check if a cargo environment value is set to determine +/// if this is a nightly run or not +const IS_NIGHTLY: bool = + std::option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() || std::option_env!("CARGO_MANIFEST_DIR").is_some(); /// This function checks if the current run is a nightly run with Clippy's nightly lints. This is /// destinct from rustc's as a nightly build can disable Clippy's nightly features. @@ -30,6 +16,6 @@ pub fn eval_is_nightly_run(sess: &Session) { /// See [`Session::is_nightly_build(&self)`] if you want to check if the current build is a nightly /// build. #[inline] -pub fn is_nightly_run() -> bool { - *IS_NIGHTLY_RUN.get().unwrap_or(&false) +pub const fn is_nightly_run() -> bool { + IS_NIGHTLY } From d5e735884e50d7891581e20380f5ce781bbc887c Mon Sep 17 00:00:00 2001 From: xFrednet Date: Thu, 17 Feb 2022 23:22:15 +0100 Subject: [PATCH 9/9] Set lint level based on target version --- clippy_dev/src/update_lints.rs | 2 ++ clippy_lints/src/lib.rs | 54 ++++++++++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs index 4f538dfee8ab..f716ff5fbc42 100644 --- a/clippy_dev/src/update_lints.rs +++ b/clippy_dev/src/update_lints.rs @@ -320,6 +320,8 @@ fn gen_deprecated<'a>(lints: impl Iterator) -> String { output } +/// This will be used to create a lint that warns when a nightly lint is +#[allow(dead_code)] fn gen_nightly_lint_list<'a>( internal_lints: impl Iterator, usable_lints: impl Iterator, diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index f78e24f768b8..972c800bb14b 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -53,6 +53,27 @@ use rustc_data_structures::fx::FxHashSet; use rustc_lint::LintId; use rustc_session::Session; +#[macro_export] +macro_rules! clippy_init_lint { + ( + $(#[$meta:meta])* $NAME:ident, $Level:expr, $desc:expr, + ) => ( + $(#[$meta])* + #[allow(dead_code)] + pub static $NAME: &rustc_lint::Lint = &rustc_lint::Lint { + name: &concat!("clippy::", stringify!($NAME)), + default_level: $Level, + desc: $desc, + edition_lint_opts: None, + report_in_external_macro: true, + future_incompatible: None, + is_plugin: true, + feature_gate: None, + crate_level_only: false, + }; + ); +} + /// Macro used to declare a Clippy lint. /// /// Every lint declaration consists of 4 parts: @@ -100,13 +121,34 @@ macro_rules! declare_clippy_lint_macro { ({ $($category:tt: $level:tt,)* }, $d:tt) => { macro_rules! declare_clippy_lint { $( - ($d(#[$d meta:meta])* pub $d name:tt, $category, $d description:tt) => { - rustc_session::declare_tool_lint! { - $d(#[$d meta])* - pub clippy::$d name, - $level, + ( + $d(#[doc = $d doc:literal])* + $d(#[clippy::version = "nightly"])+ + pub $d name:ident, $category, $d description:tt + ) => { + crate::clippy_init_lint! { + $d(#[doc = $d doc])* + #[clippy::version = "nightly"] + $d name, + if clippy_utils::nightly::is_nightly_run() { + rustc_lint::Level::$level + } else { + rustc_lint::Level::Allow + }, + $d description, + } + }; + ( + $d(#[doc = $d doc:literal])* + $d(#[clippy::version = $d version:literal])? + pub $d name:ident, $category, $d description:tt + ) => { + crate::clippy_init_lint! { + $d(#[doc = $d doc])* + $d(#[clippy::version = $d version])? + $d name, + rustc_lint::Level::$level, $d description, - report_in_external_macro: true } }; )*