From 38810df3dba1bce872d87db7cb37d09eb55992cc Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Thu, 5 Jun 2025 20:55:42 +0530 Subject: [PATCH 1/7] Feature: Clippy lint issue number #259 --- CHANGELOG.md | 1 + clippy_config/src/conf.rs | 3 + clippy_lints/src/declared_lints.rs | 1 + clippy_lints/src/items_before_use.rs | 151 ++++++++++++++++++ clippy_lints/src/lib.rs | 2 + .../lint_groups_priority/pass/Cargo.stderr | 63 ++++++++ .../absolute_paths.allow_crates.stderr | 12 +- .../absolute_paths.allow_long.stderr | 2 +- .../absolute_paths.default.stderr | 24 +-- .../absolute_paths.no_short.stderr | 30 ++-- .../ui-toml/absolute_paths/absolute_paths.rs | 1 + .../ordering_mixed.rs | 2 +- .../excessive_nesting/excessive_nesting.rs | 1 + .../excessive_nesting.stderr | 74 ++++----- tests/ui-toml/strict_order_of_use/clippy.toml | 1 + .../strict_order_of_use/items_before_use.rs | 28 ++++ .../items_before_use.stderr | 36 +++++ .../toml_unknown_key/conf_unknown_key.stderr | 3 + tests/ui/absurd-extreme-comparisons.rs | 3 +- tests/ui/absurd-extreme-comparisons.stderr | 36 ++--- tests/ui/borrow_box.fixed | 3 +- tests/ui/borrow_box.rs | 3 +- tests/ui/borrow_box.stderr | 20 +-- tests/ui/box_default.fixed | 6 +- tests/ui/box_default.rs | 6 +- tests/ui/box_default.stderr | 20 +-- tests/ui/crashes/ice-4968.rs | 2 +- tests/ui/derive_partial_eq_without_eq.fixed | 2 +- tests/ui/derive_partial_eq_without_eq.rs | 2 +- tests/ui/doc_unsafe.rs | 2 +- tests/ui/enum_glob_use.fixed | 2 +- tests/ui/enum_glob_use.rs | 2 +- tests/ui/filter_map_identity.fixed | 7 +- tests/ui/filter_map_identity.rs | 7 +- tests/ui/filter_map_identity.stderr | 44 ++--- tests/ui/impl.rs | 2 +- tests/ui/infinite_loop.rs | 2 + tests/ui/infinite_loop.stderr | 22 +-- tests/ui/into_iter_on_ref.fixed | 2 +- tests/ui/into_iter_on_ref.rs | 2 +- tests/ui/items_before_use.rs | 28 ++++ tests/ui/items_before_use.stderr | 20 +++ tests/ui/iter_on_empty_collections.fixed | 2 +- tests/ui/iter_on_empty_collections.rs | 2 +- tests/ui/iter_on_single_items.fixed | 2 +- tests/ui/iter_on_single_items.rs | 2 +- tests/ui/legacy_numeric_constants.fixed | 2 +- tests/ui/legacy_numeric_constants.rs | 2 +- tests/ui/manual_unwrap_or.fixed | 3 +- tests/ui/manual_unwrap_or.rs | 3 +- tests/ui/manual_unwrap_or.stderr | 36 ++--- .../ui/missing_const_for_fn/cant_be_const.rs | 1 + tests/ui/module_name_repetitions.rs | 2 +- .../non_std_lazy_static_other_once_cell.rs | 1 + tests/ui/redundant_pub_crate.fixed | 2 +- tests/ui/redundant_pub_crate.rs | 2 +- .../ui/single_component_path_imports_macro.rs | 2 +- tests/ui/single_match.fixed | 3 +- tests/ui/single_match.rs | 3 +- tests/ui/single_match.stderr | 62 +++---- tests/ui/suspicious_doc_comments_unfixable.rs | 2 +- tests/ui/unnecessary_cast.fixed | 1 + tests/ui/unnecessary_cast.rs | 1 + tests/ui/unnecessary_cast.stderr | 88 +++++----- tests/ui/unnecessary_unsafety_doc.rs | 2 +- tests/ui/unused_io_amount.rs | 2 +- tests/ui/unused_trait_names.fixed | 2 +- tests/ui/unused_trait_names.rs | 2 +- tests/ui/useless_attribute.fixed | 2 +- tests/ui/useless_attribute.rs | 2 +- 70 files changed, 643 insertions(+), 273 deletions(-) create mode 100644 clippy_lints/src/items_before_use.rs create mode 100644 tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr create mode 100644 tests/ui-toml/strict_order_of_use/clippy.toml create mode 100644 tests/ui-toml/strict_order_of_use/items_before_use.rs create mode 100644 tests/ui-toml/strict_order_of_use/items_before_use.stderr create mode 100644 tests/ui/items_before_use.rs create mode 100644 tests/ui/items_before_use.stderr diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cfe89ad3787..b84f24acade4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5895,6 +5895,7 @@ Released 2018-09-13 [`is_digit_ascii_radix`]: https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements [`items_after_test_module`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module +[`items_before_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_before_use [`iter_cloned_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [`iter_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [`iter_filter_is_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_filter_is_ok diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index 87158cec42b2..a195ba19fecb 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -856,6 +856,9 @@ define_Conf! { /// Whether to also emit warnings for unsafe blocks with metavariable expansions in **private** macros. #[lints(macro_metavars_in_unsafe)] warn_unsafe_macro_metavars_in_private_macros: bool = false, + /// Makes the lint strict, use statements must precede mod and extern crate statements too. (Stylistic Choice) + #[lints(items_before_use)] + strict_order_of_use: bool = false, } /// Search for the configuration file. diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index 1e3907d9ede0..2a7269ea8e35 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -233,6 +233,7 @@ pub static LINTS: &[&crate::LintInfo] = &[ crate::item_name_repetitions::STRUCT_FIELD_NAMES_INFO, crate::items_after_statements::ITEMS_AFTER_STATEMENTS_INFO, crate::items_after_test_module::ITEMS_AFTER_TEST_MODULE_INFO, + crate::items_before_use::ITEMS_BEFORE_USE_INFO, crate::iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR_INFO, crate::iter_over_hash_type::ITER_OVER_HASH_TYPE_INFO, crate::iter_without_into_iter::INTO_ITER_WITHOUT_ITER_INFO, diff --git a/clippy_lints/src/items_before_use.rs b/clippy_lints/src/items_before_use.rs new file mode 100644 index 000000000000..d233e1ded7e6 --- /dev/null +++ b/clippy_lints/src/items_before_use.rs @@ -0,0 +1,151 @@ +use clippy_config::Conf; +use clippy_utils::diagnostics::span_lint_and_note; +use clippy_utils::sym; +use rustc_hir::*; +use rustc_lint::{LateContext, LateLintPass}; +use rustc_session::impl_lint_pass; + +declare_clippy_lint! { + /// ### What it does + /// Checks that `use` statements come before all other items (functions, structs, constants, etc.) + /// at the module level, exceptions beinng `mod` and `extern crate` statements before `use` (confgiurable). + /// Ignores all use statements in cfg blocks as it's a common pattern. + /// + /// ### Why is this bad? + /// Having `use` statements scattered throughout a module makes it harder to see all imports + /// at a glance. Keeping imports grouped near the top (with `mod` and `extern crate`) + /// improves code organization and readability. + /// + /// ### Example + /// ```no_run + /// mod my_module; + /// extern crate some_crate; + /// + /// fn foo() {} + /// use std::collections::HashMap; + /// + /// const VALUE: i32 = 32; + /// use std::vec::Vec; + /// ``` + /// Use instead: + /// ```no_run + /// mod my_module; + /// extern crate some_crate; + /// use std::collections::HashMap; + /// use std::vec::Vec; + /// + /// fn foo() {} + /// const VALUE: i32 = 32; + /// ``` + #[clippy::version = "1.89.0"] + pub ITEMS_BEFORE_USE, + style, + "checks if module level `use` statements precede all other items" +} + +// check function to ignore cfg blocks (allowed in both stylistic and pedantic levels) +fn is_cfg(cx: &LateContext<'_>, item: &Item<'_>) -> bool { + let mut def = item.owner_id.def_id; + + loop { + let attrs = cx.tcx.hir_attrs(item.hir_id()); + if attrs.iter().any(|attr| { + attr.has_any_name(&[ + sym::cfg, + sym::cfg_attr, + sym::cfg_eval, + sym::cfg_hide, + sym::cfg_panic, + sym::cfg_trace, + sym::cfg_doctest, + sym::cfg_version, + sym::cfg_sanitize, + sym::cfg_fmt_debug, + sym::cfg_ub_checks, + sym::cfg_accessible, + sym::cfg_attr_multi, + sym::cfg_attr_trace, + sym::cfg_target_abi, + sym::cfg_sanitizer_cfi, + sym::cfg_target_vendor, + sym::cfg_target_compact, + sym::cfg_target_feature, + sym::cfg_contract_checks, + sym::cfg_overflow_checks, + sym::cfg_boolean_literals, + sym::cfg_relocation_model, + sym::cfg_target_has_atomic, + sym::cfg_emscripten_wasm_eh, + sym::cfg_target_thread_local, + sym::cfg_target_has_reliable_f16_f128, + sym::cfg_target_has_atomic_equal_alignment, + sym::doc_cfg, + sym::doc_cfg_hide, + sym::doc_auto_cfg, + sym::link_cfg, + ]) + }) { + return true; + } + match cx.tcx.opt_parent(def.to_def_id()) { + Some(parent) => def = parent.expect_local(), + None => break false, + } + } +} + +pub struct ItemsBeforeUse { + pub strict_order_of_use: bool, +} + +impl ItemsBeforeUse { + pub fn new(conf: &'static Conf) -> Self { + Self { + strict_order_of_use: conf.strict_order_of_use, + } + } +} + +impl_lint_pass!(ItemsBeforeUse => [ITEMS_BEFORE_USE]); + +impl<'tcx> LateLintPass<'tcx> for ItemsBeforeUse { + fn check_mod(&mut self, cx: &LateContext<'tcx>, module: &'tcx Mod<'tcx>, _hir_id: HirId) { + let mut saw_non_use = false; + let mut saw_mod_or_extern = false; + for item_ids in module.item_ids { + let item = cx.tcx.hir_item(*item_ids); + + if is_cfg(cx, item) { + continue; + } + + match item.kind { + ItemKind::Use(..) => { + // strict mode (pedantic) will lint for mod and extern crare too + if (saw_mod_or_extern || saw_non_use) && self.strict_order_of_use { + span_lint_and_note( + cx, + ITEMS_BEFORE_USE, + item.span, + "strict_order_of_use enabled: use statements should precede all other items including mod and extern crate statements", + None, + "Move this statement to the top of the module", + ); + } else if saw_non_use { + // stylistic (on by default) will only lint for non-mod/extern items + span_lint_and_note( + cx, + ITEMS_BEFORE_USE, + item.span, + "module level use statements should precede all other items", + None, + "consider moving this statement to the top of the module", + ); + } + }, + ItemKind::Mod(..) | ItemKind::ExternCrate(..) => saw_mod_or_extern = true, + _ => saw_non_use = true, + } + } + } +} diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index d8bd9dc8d2a6..8a51b817be74 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -184,6 +184,7 @@ mod invalid_upcast_comparisons; mod item_name_repetitions; mod items_after_statements; mod items_after_test_module; +mod items_before_use; mod iter_not_returning_iterator; mod iter_over_hash_type; mod iter_without_into_iter; @@ -951,5 +952,6 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) { store.register_late_pass(|_| Box::new(cloned_ref_to_slice_refs::ClonedRefToSliceRefs::new(conf))); store.register_late_pass(|_| Box::new(infallible_try_from::InfallibleTryFrom)); store.register_late_pass(|_| Box::new(coerce_container_to_any::CoerceContainerToAny)); + store.register_late_pass(move |_| Box::new(items_before_use::ItemsBeforeUse::new(conf))); // add lints here, do not remove this comment, it's used in `new_lint` } diff --git a/tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr b/tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr new file mode 100644 index 000000000000..9bca6fc55197 --- /dev/null +++ b/tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr @@ -0,0 +1,63 @@ +error: internal compiler error: encountered incremental compilation error with shallow_lint_levels_on(pass[45c2]) + | + = help: This is a known issue with the compiler. Run `cargo clean -p pass` or `cargo clean` to allow your project to compile + = note: Please follow the instructions below to create a bug report with the provided information + = note: See for more information + + +thread 'rustc' panicked at /rustc/414482f6a0d4e7290f614300581a0b55442552a3/compiler/rustc_query_system/src/query/plumbing.rs:739:9: +Found unstable fingerprints for shallow_lint_levels_on(pass[45c2]): ShallowLintLevelMap { expectations: [], specs: {0: {LintId { lint: Lint { name: "clippy::ASSIGNING_CLONES", default_level: Allow, desc: "assigning the result of cloning may be inefficient", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IGNORE_WITHOUT_REASON", default_level: Allow, desc: "ignored tests without messages", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INLINE_ALWAYS", default_level: Allow, desc: "use of `#[inline(always)]`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SHOULD_PANIC_WITHOUT_EXPECT", default_level: Allow, desc: "ensures that all `should_panic` attributes specify its expected panic message", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::BOOL_TO_INT_WITH_IF", default_level: Allow, desc: "using if to convert bool to int", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::BORROW_AS_PTR", default_level: Allow, desc: "borrowing just to cast to a raw pointer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_LOSSLESS", default_level: Allow, desc: "casts using `as` that are known to be lossless, e.g., `x as u64` where `x: u8`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_POSSIBLE_TRUNCATION", default_level: Allow, desc: "casts that may cause truncation of the value, e.g., `x as u8` where `x: u32`, or `x as i32` where `x: f32`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_POSSIBLE_WRAP", default_level: Allow, desc: "casts that may cause wrapping around the value, e.g., `x as i32` where `x: u32` and `x > i32::MAX`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_PRECISION_LOSS", default_level: Allow, desc: "casts that cause loss of precision, e.g., `x as f32` where `x: u64`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_PTR_ALIGNMENT", default_level: Allow, desc: "cast from a pointer to a more strictly aligned pointer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_SIGN_LOSS", default_level: Allow, desc: "casts from signed types to unsigned types, e.g., `x as u32` where `x: i32`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::PTR_AS_PTR", default_level: Allow, desc: "casting using `as` between raw pointers that doesn't change their constness, where `pointer::cast` could take the place of `as`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::PTR_CAST_CONSTNESS", default_level: Allow, desc: "casting using `as` on raw pointers to change constness when specialized methods apply", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_AS_PTR", default_level: Allow, desc: "using `as` to cast a reference to pointer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CHECKED_CONVERSIONS", default_level: Allow, desc: "`try_from` could replace manual bounds checking when casting", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::COMPARISON_CHAIN", default_level: Allow, desc: "`if`s that can be rewritten with `match` and `cmp`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SAME_FUNCTIONS_IN_IF_CONDITION", default_level: Allow, desc: "consecutive `if`s with the same function call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::COPY_ITERATOR", default_level: Allow, desc: "implementing `Iterator` on a `Copy` type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DEFAULT_TRAIT_ACCESS", default_level: Allow, desc: "checks for literal calls to `Default::default()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPLICIT_DEREF_METHODS", default_level: Allow, desc: "Explicit use of deref or deref_mut method while not in a method chain.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_BINDING_TO_REFERENCE", default_level: Allow, desc: "`ref` binding to a reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPL_IMPL_CLONE_ON_COPY", default_level: Allow, desc: "implementing `Clone` explicitly on `Copy` types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNSAFE_DERIVE_DESERIALIZE", default_level: Allow, desc: "deriving `serde::Deserialize` on a type that has methods using `unsafe`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS", default_level: Allow, desc: "double-space used for doc comment linebreak instead of `\\`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DOC_LINK_WITH_QUOTES", default_level: Allow, desc: "possible typo for an intra-doc link", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DOC_MARKDOWN", default_level: Allow, desc: "presence of `_`, `::` or camel-case outside backticks in documentation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_ERRORS_DOC", default_level: Allow, desc: "`pub fn` returns `Result` without `# Errors` in doc comment", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_PANICS_DOC", default_level: Allow, desc: "`pub fn` may panic without `# Panics` in doc comment", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EMPTY_ENUM", default_level: Allow, desc: "enum with no variants", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_CLOSURE_FOR_METHOD_CALLS", default_level: Allow, desc: "redundant closures for method calls", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FN_PARAMS_EXCESSIVE_BOOLS", default_level: Allow, desc: "using too many bools in function parameters", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STRUCT_EXCESSIVE_BOOLS", default_level: Allow, desc: "using too many bools in a struct", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_DEBUG_FORMATTING", default_level: Allow, desc: "`Debug` formatting applied to an `OsStr` or `Path` when `.display()` is available", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FORMAT_PUSH_STRING", default_level: Allow, desc: "`format!(..)` appended to existing `String`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MUST_USE_CANDIDATE", default_level: Allow, desc: "function or method that could take a `#[must_use]` attribute", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_OPTION", default_level: Allow, desc: "function signature uses `&Option` instead of `Option<&T>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::TOO_MANY_LINES", default_level: Allow, desc: "functions with too many lines", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IF_NOT_ELSE", default_level: Allow, desc: "`if` branches that could be swapped so no negation operation is necessary on the condition", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IGNORED_UNIT_PATTERNS", default_level: Allow, desc: "suggest replacing `_` by `()` in patterns where appropriate", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_HASHER", default_level: Allow, desc: "missing generalization over different hashers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INCONSISTENT_STRUCT_CONSTRUCTOR", default_level: Allow, desc: "the order of the field init is inconsistent with the order in the struct definition", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INDEX_REFUTABLE_SLICE", default_level: Allow, desc: "avoid indexing on slices which could be destructed", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MAYBE_INFINITE_ITER", default_level: Allow, desc: "possible infinite iteration", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_INSTANT_ELAPSED", default_level: Allow, desc: "subtraction between `Instant::now()` and previous `Instant`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNCHECKED_DURATION_SUBTRACTION", default_level: Allow, desc: "finds unchecked subtraction of a 'Duration' from an 'Instant'", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INVALID_UPCAST_COMPARISONS", default_level: Allow, desc: "a comparison involving an upcast which is always true or false", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STRUCT_FIELD_NAMES", default_level: Allow, desc: "structs where all fields share a prefix/postfix or contain the name of the struct", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITEMS_AFTER_STATEMENTS", default_level: Allow, desc: "blocks where an item comes after a statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NOT_RETURNING_ITERATOR", default_level: Allow, desc: "methods named `iter` or `iter_mut` that do not return an `Iterator`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INTO_ITER_WITHOUT_ITER", default_level: Allow, desc: "implementing `IntoIterator for (&|&mut) Type` without an inherent `iter(_mut)` method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_WITHOUT_INTO_ITER", default_level: Allow, desc: "implementing `iter(_mut)` without an associated `IntoIterator for (&|&mut) Type` impl", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_FUTURES", default_level: Allow, desc: "large future may lead to unexpected stack overflows", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_STACK_ARRAYS", default_level: Allow, desc: "allocating large arrays on stack may cause stack overflow", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ELIDABLE_LIFETIME_NAMES", default_level: Allow, desc: "lifetime name that can be replaced with the anonymous lifetime", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_DIGIT_GROUPS", default_level: Allow, desc: "grouping digits into groups that are too large", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNREADABLE_LITERAL", default_level: Allow, desc: "long literal without underscores", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPLICIT_INTO_ITER_LOOP", default_level: Allow, desc: "for-looping over `_.into_iter()` when `_` would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPLICIT_ITER_LOOP", default_level: Allow, desc: "for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MACRO_USE_IMPORTS", default_level: Allow, desc: "#[macro_use] is no longer needed", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_ASSERT", default_level: Allow, desc: "`panic!` and only a `panic!` in `if`-then statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_POWER_OF_TWO", default_level: Allow, desc: "manually reimplementing `is_power_of_two`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_LET_ELSE", default_level: Allow, desc: "manual implementation of a let...else statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_STRING_NEW", default_level: Allow, desc: "empty String is being created manually", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_BOOL", default_level: Allow, desc: "a `match` on a boolean expression instead of an `if..else` block", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_SAME_ARMS", default_level: Allow, desc: "`match` with identical arm bodies", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_WILDCARD_FOR_SINGLE_VARIANTS", default_level: Allow, desc: "a wildcard enum match for a single variant", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_WILD_ERR_ARM", default_level: Allow, desc: "a `match` with `Err(_)` arm and take drastic actions", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_MATCH_ELSE", default_level: Allow, desc: "a `match` statement with two arms where the second arm's pattern is a placeholder instead of a specific match pattern", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS", default_level: Allow, desc: "Checks for calls to ends_with with case-sensitive file extensions", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CLONED_INSTEAD_OF_COPIED", default_level: Allow, desc: "used `cloned` where `copied` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FILTER_MAP_NEXT", default_level: Allow, desc: "using combination of `filter_map` and `next` which can usually be written as a single method call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FLAT_MAP_OPTION", default_level: Allow, desc: "used `flat_map` where `filter_map` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FORMAT_COLLECT", default_level: Allow, desc: "`format!`ing every element in a collection, then collecting the strings into a new `String`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FROM_ITER_INSTEAD_OF_COLLECT", default_level: Allow, desc: "use `.collect()` instead of `::from_iter()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_CLONE", default_level: Allow, desc: "implicitly cloning a value by invoking a function on its dereferenced type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INEFFICIENT_TO_STRING", default_level: Allow, desc: "using `to_string` on `&&T` where `T: ToString`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_FILTER_IS_OK", default_level: Allow, desc: "filtering an iterator over `Result`s for `Ok` can be achieved with `flatten`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_FILTER_IS_SOME", default_level: Allow, desc: "filtering an iterator over `Option`s for `Some` can be achieved with `flatten`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_VARIANT_AND", default_level: Allow, desc: "using `.map(f).unwrap_or_default()`, which is more succinctly expressed as `is_some_and(f)` or `is_ok_and(f)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MAP_UNWRAP_OR", default_level: Allow, desc: "using `.map(f).unwrap_or(a)` or `.map(f).unwrap_or_else(func)`, which are more succinctly expressed as `map_or(a, f)` or `map_or_else(a, f)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NAIVE_BYTECOUNT", default_level: Allow, desc: "use of naive `.filter(|&x| x == y).count()` to count byte values", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::OPTION_AS_REF_CLONED", default_level: Allow, desc: "cloning an `Option` via `as_ref().cloned()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STABLE_SORT_PRIMITIVE", default_level: Allow, desc: "use of sort() when sort_unstable() is equivalent", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STR_SPLIT_AT_NEWLINE", default_level: Allow, desc: "splitting a trimmed string at hard-coded newlines", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_JOIN", default_level: Allow, desc: "using `.collect::>().join(\"\")` on an iterator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::USED_UNDERSCORE_BINDING", default_level: Allow, desc: "using a binding which is prefixed with an underscore", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::USED_UNDERSCORE_ITEMS", default_level: Allow, desc: "using a item which is prefixed with an underscore", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISMATCHING_TYPE_PARAM_ORDER", default_level: Allow, desc: "type parameter positioned inconsistently between type def and impl block", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_FIELDS_IN_DEBUG", default_level: Allow, desc: "missing fields in manual `Debug` implementation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MUT_MUT", default_level: Allow, desc: "usage of double-mut refs, e.g., `&mut &mut ...`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_CONTINUE", default_level: Allow, desc: "`continue` statements that can be replaced by a rearrangement of code", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_FOR_EACH", default_level: Allow, desc: "using `for_each` where a `for` loop would be simpler", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_PASS_BY_VALUE", default_level: Allow, desc: "functions taking arguments by value, but not consuming them in its body", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NO_EFFECT_UNDERSCORE_BINDING", default_level: Allow, desc: "binding to `_` prefixed variable with no side-effect", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NO_MANGLE_WITH_RUST_ABI", default_level: Allow, desc: "convert Rust ABI functions to C ABI", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANY_SINGLE_CHAR_NAMES", default_level: Allow, desc: "too many single character bindings", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SIMILAR_NAMES", default_level: Allow, desc: "similarly named items and bindings", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Allow, lint_id: None, src: CommandLine("clippy::similar_names", Allow) }, LintId { lint: Lint { name: "clippy::NON_STD_LAZY_STATICS", default_level: Allow, desc: "lazy static that could be replaced by `std::sync::LazyLock`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FLOAT_CMP", default_level: Allow, desc: "using `==` or `!=` on float values instead of comparing difference with an allowed error", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_MIDPOINT", default_level: Allow, desc: "manual implementation of `midpoint` which can overflow", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_BITWISE_BOOL", default_level: Allow, desc: "Boolean expressions that use bitwise rather than lazy operators", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::VERBOSE_BIT_MASK", default_level: Allow, desc: "expressions where a bit mask is less readable than the corresponding method call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_TYPES_PASSED_BY_VALUE", default_level: Allow, desc: "functions taking large arguments by value", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::TRIVIALLY_COPY_PASS_BY_REF", default_level: Allow, desc: "functions taking small copyable arguments by reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::PUB_UNDERSCORE_FIELDS", default_level: Allow, desc: "struct field prefixed with underscore and marked public", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::RANGE_MINUS_ONE", default_level: Allow, desc: "`x..=(y-1)` reads better as `x..y`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::RANGE_PLUS_ONE", default_level: Allow, desc: "`x..(y+1)` reads better as `x..=y`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RAW_STRING_HASHES", default_level: Allow, desc: "suggests reducing the number of hashes around a raw string literal", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_ELSE", default_level: Allow, desc: "`else` branch that can be removed without changing semantics", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_OPTION_REF", default_level: Allow, desc: "use `Option<&T>` instead of `&Option<&T>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::RETURN_SELF_NOT_MUST_USE", default_level: Allow, desc: "missing `#[must_use]` annotation on a method returning `Self`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SEMICOLON_IF_NOTHING_RETURNED", default_level: Allow, desc: "add a semicolon if nothing is returned", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_CHAR_PATTERN", default_level: Allow, desc: "using a single-character str where a char could be used, e.g., `_.split(\"x\")`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STRING_ADD_ASSIGN", default_level: Allow, desc: "using `x = x + ..` where x is a `String` instead of `push_str()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::TRANSMUTE_PTR_TO_PTR", default_level: Allow, desc: "transmutes from a pointer to a pointer / a reference to a reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LINKEDLIST", default_level: Allow, desc: "usage of LinkedList, usually a vector is faster, or a more specialized data structure like a `VecDeque`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::OPTION_OPTION", default_level: Allow, desc: "usage of `Option>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNICODE_NOT_NFC", default_level: Allow, desc: "using a Unicode literal not in NFC normal form (see [Unicode tr15](http://www.unicode.org/reports/tr15/) for further information)", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_BOX_RETURNS", default_level: Allow, desc: "Needlessly returning a Box", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_LITERAL_BOUND", default_level: Allow, desc: "detects &str that could be &'static str in function return types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_SEMICOLON", default_level: Allow, desc: "unnecessary semicolon after expression returning `()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_WRAPS", default_level: Allow, desc: "functions that only return `Ok` or `Some`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNESTED_OR_PATTERNS", default_level: Allow, desc: "unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_ASYNC", default_level: Allow, desc: "finds async functions with no await statements", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_SELF", default_level: Allow, desc: "methods that contain a `self` argument but don't use it", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ENUM_GLOB_USE", default_level: Allow, desc: "use items that import all variants of an enum", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::WILDCARD_IMPORTS", default_level: Allow, desc: "lint `use _::*` statements", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ZERO_SIZED_MAP_VALUES", default_level: Allow, desc: "usage of map with zero-sized value type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "WARNINGS", default_level: Warn, desc: "mass-change the level for lints which produce warnings", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Deny, lint_id: None, src: CommandLine("warnings", Deny) }, LintId { lint: Lint { name: "UNSAFE_CODE", default_level: Allow, desc: "usage of `unsafe` code and other potentially unsound constructs", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: true } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("unsafe_code", Warn) }, LintId { lint: Lint { name: "BARE_TRAIT_OBJECTS", default_level: Warn, desc: "suggest using `dyn Trait` for trait objects", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: Some(FutureIncompatibleInfo { reference: "", reason: EditionError(Edition2021), explain_reason: true }), is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "UNUSED_EXTERN_CRATES", default_level: Allow, desc: "extern crates that are never used", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "ELLIPSIS_INCLUSIVE_RANGE_PATTERNS", default_level: Warn, desc: "`...` range patterns are deprecated", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: Some(FutureIncompatibleInfo { reference: "", reason: EditionError(Edition2021), explain_reason: true }), is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "ELIDED_LIFETIMES_IN_PATHS", default_level: Allow, desc: "hidden lifetime parameters in types are deprecated", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "EXPLICIT_OUTLIVES_REQUIREMENTS", default_level: Allow, desc: "outlives requirements can be inferred", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "clippy::ASSERTIONS_ON_CONSTANTS", default_level: Warn, desc: "`assert!(true)` / `assert!(false)` will be optimized out by the compiler, and should probably be replaced by a `panic!()` or `unreachable!()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MIXED_ATTRIBUTES_STYLE", default_level: Warn, desc: "item has both inner and outer attributes", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NON_MINIMAL_CFG", default_level: Warn, desc: "ensure that all `cfg(any())` and `cfg(all())` have more than one condition", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BLOCKS_IN_CONDITIONS", default_level: Warn, desc: "useless or complex blocks that can be eliminated in conditions", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BOOL_ASSERT_COMPARISON", default_level: Warn, desc: "Using a boolean as comparison value in an assert_* macro when there is no need", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BOX_DEFAULT", default_level: Warn, desc: "Using Box::new(T::default()) instead of Box::default()", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BYTE_CHAR_SLICES", default_level: Warn, desc: "hard to read byte char slice", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FN_TO_NUMERIC_CAST", default_level: Warn, desc: "casting a function pointer to a numeric type other than `usize`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FN_TO_NUMERIC_CAST_WITH_TRUNCATION", default_level: Warn, desc: "casting a function pointer to a numeric type not wide enough to store the address", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_DANGLING_PTR", default_level: Warn, desc: "casting small constant literals to pointers to create dangling pointers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ZERO_PTR", default_level: Warn, desc: "using `0 as *{const, mut} T`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COLLAPSIBLE_ELSE_IF", default_level: Warn, desc: "nested `else`-`if` expressions that can be collapsed (e.g., `else { if x { ... } }`)", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COLLAPSIBLE_IF", default_level: Warn, desc: "nested `if`s that can be collapsed (e.g., `if x { if y { ... } }`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IF_SAME_THEN_ELSE", default_level: Warn, desc: "`if` with the same `then` and `else` blocks", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FIELD_REASSIGN_WITH_DEFAULT", default_level: Warn, desc: "binding initialized with Default should have its fields set in the initializer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DEFAULT_INSTEAD_OF_ITER_EMPTY", default_level: Warn, desc: "check `std::iter::Empty::default()` and replace with `std::iter::empty()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_BORROW", default_level: Warn, desc: "taking a reference that is going to be automatically dereferenced", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_MACROS", default_level: Warn, desc: "use of a disallowed macro", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_METHODS", default_level: Warn, desc: "use of a disallowed method call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_NAMES", default_level: Warn, desc: "usage of a disallowed/placeholder name", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_TYPES", default_level: Warn, desc: "use of disallowed types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DOC_LAZY_CONTINUATION", default_level: Warn, desc: "require every line of a paragraph to be indented and marked", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DOC_OVERINDENTED_LIST_ITEMS", default_level: Warn, desc: "ensure list items are not overindented", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_SAFETY_DOC", default_level: Warn, desc: "`pub unsafe fn` without `# Safety` docs", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_DOCTEST_MAIN", default_level: Warn, desc: "presence of `fn main() {` in code examples", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_CLOSURE", default_level: Warn, desc: "redundant closures, i.e., `|a| foo(a)` (which can be written as just `foo`)", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::EXCESSIVE_PRECISION", default_level: Warn, desc: "excessive precision for float literal", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNINLINED_FORMAT_ARGS", default_level: Warn, desc: "using non-inlined variables in `format!` calls", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FROM_OVER_INTO", default_level: Warn, desc: "Warns on implementations of `Into<..>` to use `From<..>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FROM_STR_RADIX_10", default_level: Warn, desc: "from_str_radix with radix 10", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DOUBLE_MUST_USE", default_level: Warn, desc: "`#[must_use]` attribute on a `#[must_use]`-returning function / method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MUST_USE_UNIT", default_level: Warn, desc: "`#[must_use]` attribute on a unit-returning function / method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::RESULT_UNIT_ERR", default_level: Warn, desc: "public function returning `Result` with an `Err` type of `()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_SATURATING_ADD", default_level: Warn, desc: "Perform saturating addition instead of implicitly checking max bound of data type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_SATURATING_SUB", default_level: Warn, desc: "Perform saturating subtraction instead of implicitly checking lower bound of data type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INHERENT_TO_STRING", default_level: Warn, desc: "type implements inherent method `to_string()`, but should instead implement the `Display` trait", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INIT_NUMBERED_FIELDS", default_level: Warn, desc: "numbered fields in tuple struct initializer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ENUM_VARIANT_NAMES", default_level: Warn, desc: "enums where all variants share a prefix/postfix", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MODULE_INCEPTION", default_level: Warn, desc: "modules that have the same name as their parent module", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITEMS_AFTER_TEST_MODULE", default_level: Warn, desc: "An item was found after the testing module `tests`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITEMS_BEFORE_USE", default_level: Warn, desc: "checks if module level `use` statements precede all other items", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LEGACY_NUMERIC_CONSTANTS", default_level: Warn, desc: "checks for usage of legacy std numeric constants and methods", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COMPARISON_TO_EMPTY", default_level: Warn, desc: "checking `x == \"\"` or `x == []` (or similar) when `.is_empty()` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LEN_WITHOUT_IS_EMPTY", default_level: Warn, desc: "traits or impls with a public `len` method but no corresponding `is_empty` method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LEN_ZERO", default_level: Warn, desc: "checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INCONSISTENT_DIGIT_GROUPING", default_level: Warn, desc: "integer literals with digits grouped inconsistently", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNUSUAL_BYTE_GROUPINGS", default_level: Warn, desc: "binary or hex literals that aren't grouped by four", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FOR_KV_MAP", default_level: Warn, desc: "looping on a map using `iter` when `keys` or `values` would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_SLICE_FILL", default_level: Warn, desc: "manually filling a slice with a value", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_WHILE_LET_SOME", default_level: Warn, desc: "checking for emptiness of a `Vec` in the loop condition and popping an element in the body", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RANGE_LOOP", default_level: Warn, desc: "for-looping over a range of indices where an iterator over items would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SAME_ITEM_PUSH", default_level: Warn, desc: "the same item is pushed inside of a for loop", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_ENUMERATE_INDEX", default_level: Warn, desc: "using `.enumerate()` and immediately dropping the index", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WHILE_LET_ON_ITERATOR", default_level: Warn, desc: "using a `while let` loop instead of a for loop on an iterator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MAIN_RECURSION", default_level: Warn, desc: "recursion using the entrypoint", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_ASYNC_FN", default_level: Warn, desc: "manual implementations of `async` functions can be simplified using the dedicated syntax", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_BITS", default_level: Warn, desc: "manual implementation of `size_of::() * 8` can be simplified with `T::BITS`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_FINITE", default_level: Warn, desc: "use dedicated method to check if a float is finite", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_INFINITE", default_level: Warn, desc: "use dedicated method to check if a float is infinite", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_ASCII_CHECK", default_level: Warn, desc: "use dedicated method to check ascii range", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_NON_EXHAUSTIVE", default_level: Warn, desc: "manual implementations of the non-exhaustive pattern can be simplified using #[non_exhaustive]", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_ROTATE", default_level: Warn, desc: "using bit shifts to rotate integers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_RESULT_OK", default_level: Warn, desc: "usage of `ok()` in `let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COLLAPSIBLE_MATCH", default_level: Warn, desc: "Nested `match` or `if let` expressions where the patterns may be \"collapsed\" together.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INFALLIBLE_DESTRUCTURING_MATCH", default_level: Warn, desc: "a `match` statement with a single infallible arm instead of a `let`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_MAP", default_level: Warn, desc: "reimplementation of `map`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_LIKE_MATCHES_MACRO", default_level: Warn, desc: "a match that could be written with the matches! macro", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_OVERLAPPING_ARM", default_level: Warn, desc: "a `match` with overlapping arms", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_REF_PATS", default_level: Warn, desc: "a `match` or `if let` with all arms prefixed with `&` instead of deref-ing the match expression", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_PATTERN_MATCHING", default_level: Warn, desc: "use the proper utility function avoiding an `if let`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_MATCH", default_level: Warn, desc: "a `match` statement with a single nontrivial arm (i.e., where the other arm is `_ => {}`) instead of `if let`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MEM_REPLACE_OPTION_WITH_NONE", default_level: Warn, desc: "replacing an `Option` with `None` instead of `take()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MEM_REPLACE_OPTION_WITH_SOME", default_level: Warn, desc: "replacing an `Option` with `Some` instead of `replace()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MEM_REPLACE_WITH_DEFAULT", default_level: Warn, desc: "replacing a value of type `T` with `T::default()` instead of using `std::mem::take`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BYTES_NTH", default_level: Warn, desc: "replace `.bytes().nth()` with `.as_bytes().get()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::CHARS_LAST_CMP", default_level: Warn, desc: "using `.chars().last()` or `.chars().next_back()` to check if a string ends with a char", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::CHARS_NEXT_CMP", default_level: Warn, desc: "using `.chars().next()` to check if a string starts with a char", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ERR_EXPECT", default_level: Warn, desc: "using `.err().expect(\"\")` when `.expect_err(\"\")` can be used", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FILTER_MAP_BOOL_THEN", default_level: Warn, desc: "checks for usage of `bool::then` in `Iterator::filter_map`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::GET_FIRST", default_level: Warn, desc: "Using `x.get(0)` when `x.first()` or `x.front()` is simpler", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INTO_ITER_ON_REF", default_level: Warn, desc: "using `.into_iter()` on a reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IO_OTHER_ERROR", default_level: Warn, desc: "calling `std::io::Error::new(std::io::ErrorKind::Other, _)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IS_DIGIT_ASCII_RADIX", default_level: Warn, desc: "use of `char::is_digit(..)` with literal radix of 10 or 16", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_CLONED_COLLECT", default_level: Warn, desc: "using `.cloned().collect()` on slice to create a `Vec`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NEXT_SLICE", default_level: Warn, desc: "using `.iter().next()` on a sliced array, which can be shortened to just `.get()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NTH", default_level: Warn, desc: "using `.iter().nth()` on a standard library type with O(1) element access", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NTH_ZERO", default_level: Warn, desc: "replace `iter.nth(0)` with `iter.next()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_SKIP_NEXT", default_level: Warn, desc: "using `.skip(x).next()` on an iterator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_NEXT_BACK", default_level: Warn, desc: "manual reverse iteration of `DoubleEndedIterator`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_OK_OR", default_level: Warn, desc: "finds patterns that can be encoded more concisely with `Option::ok_or`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_REPEAT_N", default_level: Warn, desc: "detect `repeat().take()` that can be replaced with `repeat_n()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_SATURATING_ARITHMETIC", default_level: Warn, desc: "`.checked_add/sub(x).unwrap_or(MAX/MIN)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MAP_CLONE", default_level: Warn, desc: "using `iterator.map(|x| x.clone())`, or dereferencing closures for `Copy` types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MAP_COLLECT_RESULT_UNIT", default_level: Warn, desc: "using `.map(_).collect::()`, which can be replaced with `try_for_each`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MUT_MUTEX_LOCK", default_level: Warn, desc: "`&mut Mutex::lock` does unnecessary locking", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEW_RET_NO_SELF", default_level: Warn, desc: "not returning type containing `Self` in a `new` method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OBFUSCATED_IF_ELSE", default_level: Warn, desc: "use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OK_EXPECT", default_level: Warn, desc: "using `ok().expect()`, which gives worse error messages than calling `expect` directly on the Result", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OPTION_MAP_OR_NONE", default_level: Warn, desc: "using `Option.map_or(None, f)`, which is more succinctly expressed as `and_then(f)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::RESULT_MAP_OR_INTO_OPTION", default_level: Warn, desc: "using `Result.map_or(None, Some)`, which is more succinctly expressed as `ok()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SHOULD_IMPLEMENT_TRAIT", default_level: Warn, desc: "defining a method that should be implementing a std trait", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_CHAR_ADD_STR", default_level: Warn, desc: "`push_str()` or `insert_str()` used with a single-character string literal as parameter", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::STRING_EXTEND_CHARS", default_level: Warn, desc: "using `x.extend(s.chars())` where s is a `&str` or `String`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_FALLIBLE_CONVERSIONS", default_level: Warn, desc: "calling the `try_from` and `try_into` trait methods when `From`/`Into` is implemented", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_FOLD", default_level: Warn, desc: "using `fold` when a more succinct alternative exists", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_LAZY_EVALUATIONS", default_level: Warn, desc: "using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_MAP_OR", default_level: Warn, desc: "reduce unnecessary calls to `.map_or(bool, …)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNWRAP_OR_DEFAULT", default_level: Warn, desc: "using `.unwrap_or`, etc. with an argument that constructs a default value", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRONG_SELF_CONVENTION", default_level: Warn, desc: "defining a method named with an established prefix (like \"into_\") that takes `self` with the wrong convention", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TOPLEVEL_REF_ARG", default_level: Warn, desc: "an entire binding declared as `ref`, in a function argument or a `let` statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BUILTIN_TYPE_SHADOW", default_level: Warn, desc: "shadowing a builtin type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DUPLICATE_UNDERSCORE_ARGUMENT", default_level: Warn, desc: "function arguments having names which only differ by an underscore", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MIXED_CASE_HEX_LITERALS", default_level: Warn, desc: "hex literals whose letter digits are not consistently upper- or lowercased", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_PATTERN", default_level: Warn, desc: "using `name @ _` in a pattern", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_ENFORCED_IMPORT_RENAMES", default_level: Warn, desc: "enforce import renames", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_MUT_PASSED", default_level: Warn, desc: "an argument passed as a mutable reference although the callee only demands an immutable reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_BORROWS_FOR_GENERIC_ARGS", default_level: Warn, desc: "taking a reference that is going to be automatically dereferenced", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_ELSE", default_level: Warn, desc: "empty else branch", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_LATE_INIT", default_level: Warn, desc: "late initializations that can be replaced by a `let` statement with an initializer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_PARENS_ON_RANGE_LITERALS", default_level: Warn, desc: "needless parenthesis on range literals can be removed", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEG_MULTIPLY", default_level: Warn, desc: "multiplying integers by `-1`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEW_WITHOUT_DEFAULT", default_level: Warn, desc: "`pub fn new() -> Self` method without `Default` implementation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BORROW_INTERIOR_MUTABLE_CONST", default_level: Warn, desc: "referencing `const` with interior mutability", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DECLARE_INTERIOR_MUTABLE_CONST", default_level: Warn, desc: "declaring `const` with interior mutability", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::JUST_UNDERSCORES_AND_DIGITS", default_level: Warn, desc: "unclear name", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ASSIGN_OP_PATTERN", default_level: Warn, desc: "assigning the result of an operation on a variable to that same variable", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OP_REF", default_level: Warn, desc: "taking a reference to satisfy the type constraints on `==`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PARTIALEQ_TO_NONE", default_level: Warn, desc: "Binary comparison to `Option::None` relies on `T: PartialEq`, which is unneeded", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::CMP_NULL", default_level: Warn, desc: "comparing a pointer to a null pointer, suggesting to use `.is_null()` instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PTR_ARG", default_level: Warn, desc: "fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PTR_EQ", default_level: Warn, desc: "use `std::ptr::eq` when comparing raw pointers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::QUESTION_MARK", default_level: Warn, desc: "checks for expressions that could be replaced by the `?` operator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_RANGE_CONTAINS", default_level: Warn, desc: "manually reimplementing {`Range`, `RangeInclusive`}`::contains`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_FIELD_NAMES", default_level: Warn, desc: "checks for fields in struct literals where shorthands could be used", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_STATIC_LIFETIMES", default_level: Warn, desc: "Using explicit `'static` lifetime for constants or statics when elision rules would allow omitting them.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LET_AND_RETURN", default_level: Warn, desc: "creating a let-binding and then immediately returning it like `let x = expr; x` at the end of a block", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RETURN", default_level: Warn, desc: "using a return statement like `return expr;` where an expression would suffice", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RETURN_WITH_QUESTION_MARK", default_level: Warn, desc: "using a return statement like `return Err(expr)?;` where removing it would suffice", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SELF_NAMED_CONSTRUCTORS", default_level: Warn, desc: "method should not have the same name as the type it is implemented for", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_COMPONENT_PATH_IMPORTS", default_level: Warn, desc: "imports with single component path are redundant", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_PATTERN_CHAR_COMPARISON", default_level: Warn, desc: "manual char comparison in string patterns", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TRIM_SPLIT_WHITESPACE", default_level: Warn, desc: "using `str::trim()` or alike before `str::split_whitespace`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TABS_IN_DOC_COMMENTS", default_level: Warn, desc: "using tabs in doc comments is not recommended", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TO_DIGIT_IS_SOME", default_level: Warn, desc: "`char.is_digit()` is clearer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TO_STRING_TRAIT_IMPL", default_level: Warn, desc: "check for direct implementations of `ToString`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OWNED_COW", default_level: Warn, desc: "needlessly owned Cow type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LET_UNIT_VALUE", default_level: Warn, desc: "creating a `let` binding to a value of unit type, which usually can't be used afterwards", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_OWNED_EMPTY_STRINGS", default_level: Warn, desc: "detects cases of references to owned empty strings being passed as an argument to a function expecting `&str`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNEEDED_STRUCT_PATTERN", default_level: Warn, desc: "using struct pattern to match against unit variant", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNSAFE_REMOVED_FROM_NAME", default_level: Warn, desc: "`unsafe` removed from API names on import", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_UNIT", default_level: Warn, desc: "needless unit expression", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UPPER_CASE_ACRONYMS", default_level: Warn, desc: "capitalized acronyms are against the naming convention", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_PUB_SELF", default_level: Warn, desc: "checks for usage of `pub(self)` and `pub(in self)`.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PRINTLN_EMPTY_STRING", default_level: Warn, desc: "using `println!(\"\")` with an empty string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PRINT_LITERAL", default_level: Warn, desc: "printing a literal with a format string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PRINT_WITH_NEWLINE", default_level: Warn, desc: "using `print!()` with a format string that ends in a single newline", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRITELN_EMPTY_STRING", default_level: Warn, desc: "using `writeln!(buf, \"\")` with an empty string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRITE_LITERAL", default_level: Warn, desc: "writing a literal with a format string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRITE_WITH_NEWLINE", default_level: Warn, desc: "using `write!()` with a format string that ends in a single newline", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DBG_MACRO", default_level: Allow, desc: "`dbg!` macro is intended as a debugging tool", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::dbg_macro", Warn) }}} } +stack backtrace: + 0: 0x7f0174558c93 - ::fmt::h2f02338d4ae6d8b0 + 1: 0x7f0174c05987 - core::fmt::write::h5e77c22335cabc7f + 2: 0x7f0175cbf611 - std::io::Write::write_fmt::hccf7b69d0b3d44cc + 3: 0x7f0174558af2 - std::sys::backtrace::BacktraceLock::print::hb22254026b13323e + 4: 0x7f017455c6ea - std::panicking::default_hook::{{closure}}::h15ac4e3ee7801be5 + 5: 0x7f017455c26f - std::panicking::default_hook::h15db2a3343942a16 + 6: 0x7f017358ba03 - std[7cad246a9e76d988]::panicking::update_hook::>::{closure#0} + 7: 0x7f017455cf63 - std::panicking::rust_panic_with_hook::h67f3fa85499b6cf9 + 8: 0x7f017455cc5a - std::panicking::begin_panic_handler::{{closure}}::h40a30e994b26720e + 9: 0x7f0174559169 - std::sys::backtrace::__rust_end_short_backtrace::hb5bcb2f6ea295c8b + 10: 0x7f017455c91d - __rustc[bf3627c2b8b7eae9]::rust_begin_unwind + 11: 0x7f0170e874e0 - core::panicking::panic_fmt::h20722ae9d0312a90 + 12: 0x7f0173ba6579 - rustc_query_system[341f49cf1150f7a3]::query::plumbing::incremental_verify_ich_failed:: + 13: 0x7f01750892d1 - rustc_query_system[341f49cf1150f7a3]::query::plumbing::try_execute_query::, rustc_query_system[341f49cf1150f7a3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[c116a7b28af8393]::plumbing::QueryCtxt, true> + 14: 0x7f01750873c3 - rustc_query_impl[c116a7b28af8393]::query_impl::shallow_lint_levels_on::get_query_incr::__rust_end_short_backtrace + 15: 0x7f0175082fb7 - rustc_lint[1b5bb4c8a5faf0b4]::levels::lints_that_dont_need_to_run + 16: 0x7f0175a02a62 - rustc_query_impl[c116a7b28af8393]::plumbing::__rust_begin_short_backtrace::> + 17: 0x7f0175b1064c - rustc_query_system[341f49cf1150f7a3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[c116a7b28af8393]::plumbing::QueryCtxt, true> + 18: 0x7f0176019af1 - rustc_query_impl[c116a7b28af8393]::query_impl::lints_that_dont_need_to_run::get_query_incr::__rust_end_short_backtrace + 19: 0x7f0175bad365 - rustc_lint[1b5bb4c8a5faf0b4]::late::check_crate::{closure#0} + 20: 0x7f0175bad889 - rustc_lint[1b5bb4c8a5faf0b4]::late::check_crate + 21: 0x7f0175babb9f - rustc_interface[2a1066e4df123d40]::passes::analysis + 22: 0x7f0175bab975 - rustc_query_impl[c116a7b28af8393]::plumbing::__rust_begin_short_backtrace::> + 23: 0x7f0175ba6584 - rustc_query_system[341f49cf1150f7a3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[c116a7b28af8393]::plumbing::QueryCtxt, true> + 24: 0x7f0175ba5ea8 - rustc_query_impl[c116a7b28af8393]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace + 25: 0x7f0175e149c7 - rustc_interface[2a1066e4df123d40]::passes::create_and_enter_global_ctxt::, rustc_driver_impl[817478e824aa827]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0} + 26: 0x7f0175d01ea6 - rustc_interface[2a1066e4df123d40]::interface::run_compiler::<(), rustc_driver_impl[817478e824aa827]::run_compiler::{closure#0}>::{closure#1} + 27: 0x7f0175cb62be - std[7cad246a9e76d988]::sys::backtrace::__rust_begin_short_backtrace::::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> + 28: 0x7f0175cb672b - <::spawn_unchecked_::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[ee896a018689144d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 29: 0x7f0175cb7b2b - std::sys::pal::unix::thread::Thread::new::thread_start::h211a36f354245501 + 30: 0x7f016faa57eb - + 31: 0x7f016fb2918c - + 32: 0x0 - + +error: the compiler unexpectedly panicked. this is a bug. + +note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml + +note: please make sure that you have updated to the latest nightly + +note: rustc 1.89.0-nightly (414482f6a 2025-05-13) running on x86_64-unknown-linux-gnu + +note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED] -Z binary-dep-depinfo + +note: some of the compiler flags provided by cargo are hidden + +query stack during panic: +#0 [shallow_lint_levels_on] looking up lint levels for `` +#1 [lints_that_dont_need_to_run] Computing all lints that are explicitly enabled or with a default level greater than Allow +... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack +note: Clippy version: clippy 0.1.89 (d44e35d595 2025-05-19) + +error: could not compile `pass` (lib) due to 1 previous error diff --git a/tests/ui-toml/absolute_paths/absolute_paths.allow_crates.stderr b/tests/ui-toml/absolute_paths/absolute_paths.allow_crates.stderr index d24b0cd61629..fbfc69f4c307 100644 --- a/tests/ui-toml/absolute_paths/absolute_paths.allow_crates.stderr +++ b/tests/ui-toml/absolute_paths/absolute_paths.allow_crates.stderr @@ -1,5 +1,5 @@ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:14:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:15:13 | LL | let _ = std::path::is_separator(' '); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,31 +11,31 @@ LL | #![deny(clippy::absolute_paths)] | ^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:20:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:21:13 | LL | let _ = ::std::path::MAIN_SEPARATOR; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:25:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:26:13 | LL | let _ = std::collections::hash_map::HashMap::::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:28:31 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:29:31 | LL | let _: &std::path::Path = std::path::Path::new(""); | ^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:28:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:29:13 | LL | let _: &std::path::Path = std::path::Path::new(""); | ^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:43:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:44:13 | LL | let _ = std::option::Option::None::; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui-toml/absolute_paths/absolute_paths.allow_long.stderr b/tests/ui-toml/absolute_paths/absolute_paths.allow_long.stderr index 0cc6566af3a9..dd492f129488 100644 --- a/tests/ui-toml/absolute_paths/absolute_paths.allow_long.stderr +++ b/tests/ui-toml/absolute_paths/absolute_paths.allow_long.stderr @@ -1,5 +1,5 @@ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:25:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:26:13 | LL | let _ = std::collections::hash_map::HashMap::::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui-toml/absolute_paths/absolute_paths.default.stderr b/tests/ui-toml/absolute_paths/absolute_paths.default.stderr index 53aa9030e0dd..1ee9ada35a05 100644 --- a/tests/ui-toml/absolute_paths/absolute_paths.default.stderr +++ b/tests/ui-toml/absolute_paths/absolute_paths.default.stderr @@ -1,5 +1,5 @@ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:14:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:15:13 | LL | let _ = std::path::is_separator(' '); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,67 +11,67 @@ LL | #![deny(clippy::absolute_paths)] | ^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:20:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:21:13 | LL | let _ = ::std::path::MAIN_SEPARATOR; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:25:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:26:13 | LL | let _ = std::collections::hash_map::HashMap::::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:28:31 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:29:31 | LL | let _: &std::path::Path = std::path::Path::new(""); | ^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:28:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:29:13 | LL | let _: &std::path::Path = std::path::Path::new(""); | ^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:37:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:38:13 | LL | let _ = ::core::clone::Clone::clone(&0i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:40:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:41:13 | LL | let _ = ::clone(&0i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:43:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:44:13 | LL | let _ = std::option::Option::None::; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:65:17 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:66:17 | LL | impl core::fmt::Display for X | ^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:70:18 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:71:18 | LL | where T: core::clone::Clone | ^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:65:32 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:66:32 | LL | impl core::fmt::Display for X | ^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:116:5 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:117:5 | LL | crate::m1::S | ^^^^^^^^^^^^ diff --git a/tests/ui-toml/absolute_paths/absolute_paths.no_short.stderr b/tests/ui-toml/absolute_paths/absolute_paths.no_short.stderr index 70d71f6c4ea1..7cd95a973dcb 100644 --- a/tests/ui-toml/absolute_paths/absolute_paths.no_short.stderr +++ b/tests/ui-toml/absolute_paths/absolute_paths.no_short.stderr @@ -1,5 +1,5 @@ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:14:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:15:13 | LL | let _ = std::path::is_separator(' '); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,85 +11,85 @@ LL | #![deny(clippy::absolute_paths)] | ^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:20:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:21:13 | LL | let _ = ::std::path::MAIN_SEPARATOR; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:25:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:26:13 | LL | let _ = std::collections::hash_map::HashMap::::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:28:31 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:29:31 | LL | let _: &std::path::Path = std::path::Path::new(""); | ^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:28:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:29:13 | LL | let _: &std::path::Path = std::path::Path::new(""); | ^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:37:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:38:13 | LL | let _ = ::core::clone::Clone::clone(&0i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:40:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:41:13 | LL | let _ = ::clone(&0i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:43:13 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:44:13 | LL | let _ = std::option::Option::None::; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:65:17 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:66:17 | LL | impl core::fmt::Display for X | ^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:70:18 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:71:18 | LL | where T: core::clone::Clone | ^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:65:32 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:66:32 | LL | impl core::fmt::Display for X | ^^^^^^^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:113:14 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:114:14 | LL | pub const _: crate::S = { | ^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:114:9 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:115:9 | LL | let crate::S = m1::S; | ^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:116:5 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:117:5 | LL | crate::m1::S | ^^^^^^^^^^^^ error: consider bringing this path into scope with the `use` keyword - --> tests/ui-toml/absolute_paths/absolute_paths.rs:122:14 + --> tests/ui-toml/absolute_paths/absolute_paths.rs:123:14 | LL | let _ = ::clone(&m1::S); | ^^^^^^^^ diff --git a/tests/ui-toml/absolute_paths/absolute_paths.rs b/tests/ui-toml/absolute_paths/absolute_paths.rs index c024f2f513ce..f2556002409f 100644 --- a/tests/ui-toml/absolute_paths/absolute_paths.rs +++ b/tests/ui-toml/absolute_paths/absolute_paths.rs @@ -5,6 +5,7 @@ //@[allow_long] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/absolute_paths/allow_long //@[no_short] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/absolute_paths/no_short #![deny(clippy::absolute_paths)] +#![allow(clippy::items_before_use)] extern crate proc_macros; use proc_macros::{external, inline_macros, with_span}; diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs index 1cfed9790c12..95ca384c5430 100644 --- a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs +++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs @@ -4,7 +4,7 @@ //@[default_exp] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/default_exp //@[ord_within] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/ord_within -#![allow(dead_code)] +#![allow(dead_code, clippy::items_before_use)] #![warn(clippy::arbitrary_source_item_ordering)] /// This module gets linted before clippy gives up. diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.rs b/tests/ui-toml/excessive_nesting/excessive_nesting.rs index 205cd8ba4ee8..f89597227cce 100644 --- a/tests/ui-toml/excessive_nesting/excessive_nesting.rs +++ b/tests/ui-toml/excessive_nesting/excessive_nesting.rs @@ -13,6 +13,7 @@ clippy::collapsible_if, clippy::blocks_in_conditions, clippy::single_match, + clippy::items_before_use )] #[macro_use] diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.stderr b/tests/ui-toml/excessive_nesting/excessive_nesting.stderr index bc2c4b8612ec..0f33a690f9cf 100644 --- a/tests/ui-toml/excessive_nesting/excessive_nesting.stderr +++ b/tests/ui-toml/excessive_nesting/excessive_nesting.stderr @@ -1,5 +1,5 @@ error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:25:25 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:26:25 | LL | let w = { 3 }; | ^^^^^ @@ -9,7 +9,7 @@ LL | let w = { 3 }; = help: to override `-D warnings` add `#[allow(clippy::excessive_nesting)]` error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:72:17 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:73:17 | LL | / impl C { LL | | @@ -20,7 +20,7 @@ LL | | } = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:87:25 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:88:25 | LL | let x = { 1 }; // not a warning, but cc is | ^^^^^ @@ -28,7 +28,7 @@ LL | let x = { 1 }; // not a warning, but cc is = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:105:17 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:106:17 | LL | / pub mod e { LL | | @@ -39,7 +39,7 @@ LL | | } // not here = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:119:18 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:120:18 | LL | a_but_not({{{{{{{{0}}}}}}}}); | ^^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | a_but_not({{{{{{{{0}}}}}}}}); = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:121:12 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:122:12 | LL | a.a({{{{{{{{{0}}}}}}}}}); | ^^^^^^^^^^^^^ @@ -55,7 +55,7 @@ LL | a.a({{{{{{{{{0}}}}}}}}}); = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:123:12 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:124:12 | LL | (0, {{{{{{{1}}}}}}}); | ^^^^^^^^^ @@ -63,7 +63,7 @@ LL | (0, {{{{{{{1}}}}}}}); = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:129:25 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:130:25 | LL | if true { | _________________________^ @@ -76,7 +76,7 @@ LL | | } = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:142:29 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:143:29 | LL | let z = (|| { | _____________________________^ @@ -89,7 +89,7 @@ LL | | })(); = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:162:13 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:163:13 | LL | y += {{{{{5}}}}}; | ^^^^^ @@ -97,7 +97,7 @@ LL | y += {{{{{5}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:164:20 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:165:20 | LL | let z = y + {{{{{{{{{5}}}}}}}}}; | ^^^^^^^^^^^^^ @@ -105,7 +105,7 @@ LL | let z = y + {{{{{{{{{5}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:166:12 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:167:12 | LL | [0, {{{{{{{{{{0}}}}}}}}}}]; | ^^^^^^^^^^^^^^^ @@ -113,7 +113,7 @@ LL | [0, {{{{{{{{{{0}}}}}}}}}}]; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:168:25 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:169:25 | LL | let mut xx = [0; {{{{{{{{100}}}}}}}}]; | ^^^^^^^^^^^^^ @@ -121,7 +121,7 @@ LL | let mut xx = [0; {{{{{{{{100}}}}}}}}]; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:170:11 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:171:11 | LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -129,7 +129,7 @@ LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}]; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:172:13 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:173:13 | LL | &mut {{{{{{{{{{y}}}}}}}}}}; | ^^^^^^^^^^^^^^^ @@ -137,7 +137,7 @@ LL | &mut {{{{{{{{{{y}}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:175:17 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:176:17 | LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} | ^^^^ @@ -145,7 +145,7 @@ LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:175:28 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:176:28 | LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} | ^^^^^^^^^^ @@ -153,7 +153,7 @@ LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:179:28 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:180:28 | LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} | ^^^^^^^^^^^^^ @@ -161,7 +161,7 @@ LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:179:48 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:180:48 | LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} | ^^^^^^^^ @@ -169,7 +169,7 @@ LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:183:14 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:184:14 | LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} | ^^^^^^^^^^^^^^ @@ -177,7 +177,7 @@ LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:183:35 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:184:35 | LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} | ^^^^^^^^^^^^ @@ -185,7 +185,7 @@ LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:187:23 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:188:23 | LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -193,7 +193,7 @@ LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} }; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:190:8 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:191:8 | LL | {{{{1;}}}}..{{{{{{3}}}}}}; | ^^^^ @@ -201,7 +201,7 @@ LL | {{{{1;}}}}..{{{{{{3}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:190:20 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:191:20 | LL | {{{{1;}}}}..{{{{{{3}}}}}}; | ^^^^^^^ @@ -209,7 +209,7 @@ LL | {{{{1;}}}}..{{{{{{3}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:193:8 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:194:8 | LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; | ^^^^ @@ -217,7 +217,7 @@ LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:193:21 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:194:21 | LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -225,7 +225,7 @@ LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:196:10 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:197:10 | LL | ..{{{{{{{5}}}}}}}; | ^^^^^^^^^ @@ -233,7 +233,7 @@ LL | ..{{{{{{{5}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:198:11 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:199:11 | LL | ..={{{{{3}}}}}; | ^^^^^ @@ -241,7 +241,7 @@ LL | ..={{{{{3}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:200:8 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:201:8 | LL | {{{{{1;}}}}}..; | ^^^^^^ @@ -249,7 +249,7 @@ LL | {{{{{1;}}}}}..; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:203:20 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:204:20 | LL | loop { break {{{{1}}}} }; | ^^^^^ @@ -257,7 +257,7 @@ LL | loop { break {{{{1}}}} }; = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:205:13 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:206:13 | LL | loop {{{{{{}}}}}} | ^^^^^^ @@ -265,7 +265,7 @@ LL | loop {{{{{{}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:208:14 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:209:14 | LL | match {{{{{{true}}}}}} { | ^^^^^^^^^^ @@ -273,7 +273,7 @@ LL | match {{{{{{true}}}}}} { = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:210:20 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:211:20 | LL | true => {{{{}}}}, | ^^ @@ -281,7 +281,7 @@ LL | true => {{{{}}}}, = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:212:21 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:213:21 | LL | false => {{{{}}}}, | ^^ @@ -289,7 +289,7 @@ LL | false => {{{{}}}}, = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:219:17 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:220:17 | LL | / { LL | | @@ -300,7 +300,7 @@ LL | | } = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:229:28 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:230:28 | LL | async fn c() -> u32 {{{{{{{0}}}}}}} | ^^^^^^^^^ @@ -308,7 +308,7 @@ LL | async fn c() -> u32 {{{{{{{0}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:236:8 + --> tests/ui-toml/excessive_nesting/excessive_nesting.rs:237:8 | LL | {{{{b().await}}}}; | ^^^^^^^^^^^ diff --git a/tests/ui-toml/strict_order_of_use/clippy.toml b/tests/ui-toml/strict_order_of_use/clippy.toml new file mode 100644 index 000000000000..75731955bb35 --- /dev/null +++ b/tests/ui-toml/strict_order_of_use/clippy.toml @@ -0,0 +1 @@ +strict-order-of-use = true diff --git a/tests/ui-toml/strict_order_of_use/items_before_use.rs b/tests/ui-toml/strict_order_of_use/items_before_use.rs new file mode 100644 index 000000000000..a255e4e3eeeb --- /dev/null +++ b/tests/ui-toml/strict_order_of_use/items_before_use.rs @@ -0,0 +1,28 @@ +#![warn(clippy::items_before_use)] + +mod demo { + use std::fmt; // OK: at the top + + extern crate core; + use std::io; //~ items_before_use + + mod submodule {} + use std::fs; //~ items_before_use + + fn f() {} + use std::str; //~ items_before_use + + #[cfg(test)] + mod test_mod { + use std::collections::HashMap; // ignored (inside cfg block) + fn test_fn() {} + } + + #[cfg(feature = "magic")] + use std::vec::Vec; // ignored (inside cfg block) + + struct Data; + use std::borrow::Cow; //~ items_before_use +} + +fn main() {} diff --git a/tests/ui-toml/strict_order_of_use/items_before_use.stderr b/tests/ui-toml/strict_order_of_use/items_before_use.stderr new file mode 100644 index 000000000000..4039d75ab13d --- /dev/null +++ b/tests/ui-toml/strict_order_of_use/items_before_use.stderr @@ -0,0 +1,36 @@ +error: strict_order_of_use enabled: use statements should precede all other items including mod and extern crate statements + --> tests/ui-toml/strict_order_of_use/items_before_use.rs:7:5 + | +LL | use std::io; + | ^^^^^^^^^^^^ + | + = note: Move this statement to the top of the module + = note: `-D clippy::items-before-use` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::items_before_use)]` + +error: strict_order_of_use enabled: use statements should precede all other items including mod and extern crate statements + --> tests/ui-toml/strict_order_of_use/items_before_use.rs:10:5 + | +LL | use std::fs; + | ^^^^^^^^^^^^ + | + = note: Move this statement to the top of the module + +error: strict_order_of_use enabled: use statements should precede all other items including mod and extern crate statements + --> tests/ui-toml/strict_order_of_use/items_before_use.rs:13:5 + | +LL | use std::str; + | ^^^^^^^^^^^^^ + | + = note: Move this statement to the top of the module + +error: strict_order_of_use enabled: use statements should precede all other items including mod and extern crate statements + --> tests/ui-toml/strict_order_of_use/items_before_use.rs:25:5 + | +LL | use std::borrow::Cow; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: Move this statement to the top of the module + +error: aborting due to 4 previous errors + diff --git a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr index 6ee77ebd8ece..9b51022c7870 100644 --- a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr +++ b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr @@ -71,6 +71,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect source-item-ordering stack-size-threshold standard-macro-braces + strict-order-of-use struct-field-name-threshold suppress-restriction-lint-in-const third-party @@ -165,6 +166,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect source-item-ordering stack-size-threshold standard-macro-braces + strict-order-of-use struct-field-name-threshold suppress-restriction-lint-in-const third-party @@ -259,6 +261,7 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni source-item-ordering stack-size-threshold standard-macro-braces + strict-order-of-use struct-field-name-threshold suppress-restriction-lint-in-const third-party diff --git a/tests/ui/absurd-extreme-comparisons.rs b/tests/ui/absurd-extreme-comparisons.rs index 793961d30f0d..264b6739bef4 100644 --- a/tests/ui/absurd-extreme-comparisons.rs +++ b/tests/ui/absurd-extreme-comparisons.rs @@ -4,7 +4,8 @@ clippy::eq_op, clippy::no_effect, clippy::unnecessary_operation, - clippy::needless_pass_by_value + clippy::needless_pass_by_value, + clippy::items_before_use )] #[rustfmt::skip] diff --git a/tests/ui/absurd-extreme-comparisons.stderr b/tests/ui/absurd-extreme-comparisons.stderr index 6df50c15e8cd..a7acf76c94bd 100644 --- a/tests/ui/absurd-extreme-comparisons.stderr +++ b/tests/ui/absurd-extreme-comparisons.stderr @@ -1,5 +1,5 @@ error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:14:5 + --> tests/ui/absurd-extreme-comparisons.rs:15:5 | LL | u <= 0; | ^^^^^^ @@ -9,7 +9,7 @@ LL | u <= 0; = help: to override `-D warnings` add `#[allow(clippy::absurd_extreme_comparisons)]` error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:17:5 + --> tests/ui/absurd-extreme-comparisons.rs:18:5 | LL | u <= Z; | ^^^^^^ @@ -17,7 +17,7 @@ LL | u <= Z; = help: because `Z` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == Z` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:20:5 + --> tests/ui/absurd-extreme-comparisons.rs:21:5 | LL | u < Z; | ^^^^^ @@ -25,7 +25,7 @@ LL | u < Z; = help: because `Z` is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:23:5 + --> tests/ui/absurd-extreme-comparisons.rs:24:5 | LL | Z >= u; | ^^^^^^ @@ -33,7 +33,7 @@ LL | Z >= u; = help: because `Z` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `Z == u` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:26:5 + --> tests/ui/absurd-extreme-comparisons.rs:27:5 | LL | Z > u; | ^^^^^ @@ -41,7 +41,7 @@ LL | Z > u; = help: because `Z` is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:29:5 + --> tests/ui/absurd-extreme-comparisons.rs:30:5 | LL | u > u32::MAX; | ^^^^^^^^^^^^ @@ -49,7 +49,7 @@ LL | u > u32::MAX; = help: because `u32::MAX` is the maximum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:32:5 + --> tests/ui/absurd-extreme-comparisons.rs:33:5 | LL | u >= u32::MAX; | ^^^^^^^^^^^^^ @@ -57,7 +57,7 @@ LL | u >= u32::MAX; = help: because `u32::MAX` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u == u32::MAX` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:35:5 + --> tests/ui/absurd-extreme-comparisons.rs:36:5 | LL | u32::MAX < u; | ^^^^^^^^^^^^ @@ -65,7 +65,7 @@ LL | u32::MAX < u; = help: because `u32::MAX` is the maximum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:38:5 + --> tests/ui/absurd-extreme-comparisons.rs:39:5 | LL | u32::MAX <= u; | ^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ LL | u32::MAX <= u; = help: because `u32::MAX` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u32::MAX == u` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:41:5 + --> tests/ui/absurd-extreme-comparisons.rs:42:5 | LL | 1-1 > u; | ^^^^^^^ @@ -81,7 +81,7 @@ LL | 1-1 > u; = help: because `1-1` is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:44:5 + --> tests/ui/absurd-extreme-comparisons.rs:45:5 | LL | u >= !0; | ^^^^^^^ @@ -89,7 +89,7 @@ LL | u >= !0; = help: because `!0` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u == !0` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:47:5 + --> tests/ui/absurd-extreme-comparisons.rs:48:5 | LL | u <= 12 - 2*6; | ^^^^^^^^^^^^^ @@ -97,7 +97,7 @@ LL | u <= 12 - 2*6; = help: because `12 - 2*6` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == 12 - 2*6` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:51:5 + --> tests/ui/absurd-extreme-comparisons.rs:52:5 | LL | i < -127 - 1; | ^^^^^^^^^^^^ @@ -105,7 +105,7 @@ LL | i < -127 - 1; = help: because `-127 - 1` is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:54:5 + --> tests/ui/absurd-extreme-comparisons.rs:55:5 | LL | i8::MAX >= i; | ^^^^^^^^^^^^ @@ -113,7 +113,7 @@ LL | i8::MAX >= i; = help: because `i8::MAX` is the maximum value for this type, this comparison is always true error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:57:5 + --> tests/ui/absurd-extreme-comparisons.rs:58:5 | LL | 3-7 < i32::MIN; | ^^^^^^^^^^^^^^ @@ -121,7 +121,7 @@ LL | 3-7 < i32::MIN; = help: because `i32::MIN` is the minimum value for this type, this comparison is always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:61:5 + --> tests/ui/absurd-extreme-comparisons.rs:62:5 | LL | b >= true; | ^^^^^^^^^ @@ -129,7 +129,7 @@ LL | b >= true; = help: because `true` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `b == true` instead error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false - --> tests/ui/absurd-extreme-comparisons.rs:64:5 + --> tests/ui/absurd-extreme-comparisons.rs:65:5 | LL | false > b; | ^^^^^^^^^ @@ -137,7 +137,7 @@ LL | false > b; = help: because `false` is the minimum value for this type, this comparison is always false error: <-comparison of unit values detected. This will always be false - --> tests/ui/absurd-extreme-comparisons.rs:69:5 + --> tests/ui/absurd-extreme-comparisons.rs:70:5 | LL | () < {}; | ^^^^^^^ diff --git a/tests/ui/borrow_box.fixed b/tests/ui/borrow_box.fixed index e6e7f74af7cf..ce9873e8f34e 100644 --- a/tests/ui/borrow_box.fixed +++ b/tests/ui/borrow_box.fixed @@ -4,7 +4,8 @@ clippy::uninlined_format_args, clippy::disallowed_names, clippy::needless_pass_by_ref_mut, - clippy::needless_lifetimes + clippy::needless_lifetimes, + clippy::items_before_use )] use std::fmt::Display; diff --git a/tests/ui/borrow_box.rs b/tests/ui/borrow_box.rs index 43cf809306b3..cef64aefa513 100644 --- a/tests/ui/borrow_box.rs +++ b/tests/ui/borrow_box.rs @@ -4,7 +4,8 @@ clippy::uninlined_format_args, clippy::disallowed_names, clippy::needless_pass_by_ref_mut, - clippy::needless_lifetimes + clippy::needless_lifetimes, + clippy::items_before_use )] use std::fmt::Display; diff --git a/tests/ui/borrow_box.stderr b/tests/ui/borrow_box.stderr index dbe3757dd435..0c2c7c0586f7 100644 --- a/tests/ui/borrow_box.stderr +++ b/tests/ui/borrow_box.stderr @@ -1,5 +1,5 @@ error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:25:14 + --> tests/ui/borrow_box.rs:26:14 | LL | let foo: &Box; | ^^^^^^^^^^ help: try: `&bool` @@ -11,55 +11,55 @@ LL | #![deny(clippy::borrowed_box)] | ^^^^^^^^^^^^^^^^^^^^ error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:30:10 + --> tests/ui/borrow_box.rs:31:10 | LL | foo: &'a Box, | ^^^^^^^^^^^^^ help: try: `&'a bool` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:35:17 + --> tests/ui/borrow_box.rs:36:17 | LL | fn test4(a: &Box); | ^^^^^^^^^^ help: try: `&bool` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:96:25 + --> tests/ui/borrow_box.rs:97:25 | LL | pub fn test14(_display: &Box) {} | ^^^^^^^^^^^^^^^^^ help: try: `&dyn Display` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:99:25 + --> tests/ui/borrow_box.rs:100:25 | LL | pub fn test15(_display: &Box) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:102:29 + --> tests/ui/borrow_box.rs:103:29 | LL | pub fn test16<'a>(_display: &'a Box) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a (dyn Display + 'a)` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:105:25 + --> tests/ui/borrow_box.rs:106:25 | LL | pub fn test17(_display: &Box) {} | ^^^^^^^^^^^^^^^^^^ help: try: `&impl Display` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:108:25 + --> tests/ui/borrow_box.rs:109:25 | LL | pub fn test18(_display: &Box) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(impl Display + Send)` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:111:29 + --> tests/ui/borrow_box.rs:112:29 | LL | pub fn test19<'a>(_display: &'a Box) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a (impl Display + 'a)` error: you seem to be trying to use `&Box`. Consider using just `&T` - --> tests/ui/borrow_box.rs:117:25 + --> tests/ui/borrow_box.rs:118:25 | LL | pub fn test20(_display: &Box<(dyn Display + Send)>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)` diff --git a/tests/ui/box_default.fixed b/tests/ui/box_default.fixed index 80000f5de4fd..ec5c3b74b299 100644 --- a/tests/ui/box_default.fixed +++ b/tests/ui/box_default.fixed @@ -1,5 +1,9 @@ #![warn(clippy::box_default)] -#![allow(clippy::boxed_local, clippy::default_constructed_unit_structs)] +#![allow( + clippy::boxed_local, + clippy::default_constructed_unit_structs, + clippy::items_before_use +)] #[derive(Default)] struct ImplementsDefault; diff --git a/tests/ui/box_default.rs b/tests/ui/box_default.rs index 4681016d7cd3..d1a6f47cd011 100644 --- a/tests/ui/box_default.rs +++ b/tests/ui/box_default.rs @@ -1,5 +1,9 @@ #![warn(clippy::box_default)] -#![allow(clippy::boxed_local, clippy::default_constructed_unit_structs)] +#![allow( + clippy::boxed_local, + clippy::default_constructed_unit_structs, + clippy::items_before_use +)] #[derive(Default)] struct ImplementsDefault; diff --git a/tests/ui/box_default.stderr b/tests/ui/box_default.stderr index f63d97665b34..e2e8c4097e57 100644 --- a/tests/ui/box_default.stderr +++ b/tests/ui/box_default.stderr @@ -1,5 +1,5 @@ error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:34:32 + --> tests/ui/box_default.rs:38:32 | LL | let string1: Box = Box::new(Default::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` @@ -8,55 +8,55 @@ LL | let string1: Box = Box::new(Default::default()); = help: to override `-D warnings` add `#[allow(clippy::box_default)]` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:36:32 + --> tests/ui/box_default.rs:40:32 | LL | let string2: Box = Box::new(String::new()); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:38:41 + --> tests/ui/box_default.rs:42:41 | LL | let impl1: Box = Box::new(Default::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:40:29 + --> tests/ui/box_default.rs:44:29 | LL | let vec: Box> = Box::new(Vec::new()); | ^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:42:25 + --> tests/ui/box_default.rs:46:25 | LL | let byte: Box = Box::new(u8::default()); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:44:45 + --> tests/ui/box_default.rs:48:45 | LL | let vec2: Box> = Box::new(vec![]); | ^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:46:32 + --> tests/ui/box_default.rs:50:32 | LL | let vec3: Box> = Box::new(Vec::from([])); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:49:25 + --> tests/ui/box_default.rs:53:25 | LL | let plain_default = Box::new(Default::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:67:16 + --> tests/ui/box_default.rs:71:16 | LL | call_ty_fn(Box::new(u8::default())); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` error: `Box::new(_)` of default value - --> tests/ui/box_default.rs:95:17 + --> tests/ui/box_default.rs:99:17 | LL | Self::x(Box::new(T::default())); | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()` diff --git a/tests/ui/crashes/ice-4968.rs b/tests/ui/crashes/ice-4968.rs index 542cb63516da..112e8fb6e1b8 100644 --- a/tests/ui/crashes/ice-4968.rs +++ b/tests/ui/crashes/ice-4968.rs @@ -2,7 +2,7 @@ // Test for https://github.com/rust-lang/rust-clippy/issues/4968 #![warn(clippy::unsound_collection_transmute)] -#![allow(clippy::transmute_undefined_repr)] +#![allow(clippy::transmute_undefined_repr, clippy::items_before_use)] trait Trait { type Assoc; diff --git a/tests/ui/derive_partial_eq_without_eq.fixed b/tests/ui/derive_partial_eq_without_eq.fixed index 00f51d6acb94..449f8f9dc617 100644 --- a/tests/ui/derive_partial_eq_without_eq.fixed +++ b/tests/ui/derive_partial_eq_without_eq.fixed @@ -1,4 +1,4 @@ -#![allow(unused)] +#![allow(unused, clippy::items_before_use)] #![warn(clippy::derive_partial_eq_without_eq)] // Don't warn on structs that aren't PartialEq diff --git a/tests/ui/derive_partial_eq_without_eq.rs b/tests/ui/derive_partial_eq_without_eq.rs index 073330468d31..b8e49c762736 100644 --- a/tests/ui/derive_partial_eq_without_eq.rs +++ b/tests/ui/derive_partial_eq_without_eq.rs @@ -1,4 +1,4 @@ -#![allow(unused)] +#![allow(unused, clippy::items_before_use)] #![warn(clippy::derive_partial_eq_without_eq)] // Don't warn on structs that aren't PartialEq diff --git a/tests/ui/doc_unsafe.rs b/tests/ui/doc_unsafe.rs index 7146fd7941ab..461a03442c23 100644 --- a/tests/ui/doc_unsafe.rs +++ b/tests/ui/doc_unsafe.rs @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs -#![allow(clippy::let_unit_value, clippy::needless_pass_by_ref_mut)] +#![allow(clippy::let_unit_value, clippy::needless_pass_by_ref_mut, clippy::items_before_use)] extern crate proc_macros; use proc_macros::external; diff --git a/tests/ui/enum_glob_use.fixed b/tests/ui/enum_glob_use.fixed index 881493f3d5ff..6aa602e8a1d6 100644 --- a/tests/ui/enum_glob_use.fixed +++ b/tests/ui/enum_glob_use.fixed @@ -1,5 +1,5 @@ #![warn(clippy::enum_glob_use)] -#![allow(unused)] +#![allow(unused, clippy::items_before_use)] #![warn(unused_imports)] use std::cmp::Ordering::Less; diff --git a/tests/ui/enum_glob_use.rs b/tests/ui/enum_glob_use.rs index a510462ecb2f..b8f8e56f0d66 100644 --- a/tests/ui/enum_glob_use.rs +++ b/tests/ui/enum_glob_use.rs @@ -1,5 +1,5 @@ #![warn(clippy::enum_glob_use)] -#![allow(unused)] +#![allow(unused, clippy::items_before_use)] #![warn(unused_imports)] use std::cmp::Ordering::*; diff --git a/tests/ui/filter_map_identity.fixed b/tests/ui/filter_map_identity.fixed index c9e2c5f5049f..9cb370176085 100644 --- a/tests/ui/filter_map_identity.fixed +++ b/tests/ui/filter_map_identity.fixed @@ -1,4 +1,9 @@ -#![allow(unused_imports, clippy::needless_return, clippy::useless_vec)] +#![allow( + unused_imports, + clippy::needless_return, + clippy::useless_vec, + clippy::items_before_use +)] #![warn(clippy::filter_map_identity)] #![feature(stmt_expr_attributes)] diff --git a/tests/ui/filter_map_identity.rs b/tests/ui/filter_map_identity.rs index 4c8d48f5221f..d17a4a48193c 100644 --- a/tests/ui/filter_map_identity.rs +++ b/tests/ui/filter_map_identity.rs @@ -1,4 +1,9 @@ -#![allow(unused_imports, clippy::needless_return, clippy::useless_vec)] +#![allow( + unused_imports, + clippy::needless_return, + clippy::useless_vec, + clippy::items_before_use +)] #![warn(clippy::filter_map_identity)] #![feature(stmt_expr_attributes)] diff --git a/tests/ui/filter_map_identity.stderr b/tests/ui/filter_map_identity.stderr index 26b6e0bc7b34..287dedb0f2c4 100644 --- a/tests/ui/filter_map_identity.stderr +++ b/tests/ui/filter_map_identity.stderr @@ -1,5 +1,5 @@ error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:28:45 + --> tests/ui/filter_map_identity.rs:33:45 | LL | copy_vec_non_inferred().into_iter().filter_map(|x| x); | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` @@ -8,127 +8,127 @@ LL | copy_vec_non_inferred().into_iter().filter_map(|x| x); = help: to override `-D warnings` add `#[allow(clippy::filter_map_identity)]` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:31:45 + --> tests/ui/filter_map_identity.rs:36:45 | LL | copy_vec_non_inferred().into_iter().filter_map(std::convert::identity); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:34:45 + --> tests/ui/filter_map_identity.rs:39:45 | LL | copy_vec_non_inferred().into_iter().filter_map(identity); | ^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:37:45 + --> tests/ui/filter_map_identity.rs:42:45 | LL | copy_vec_non_inferred().into_iter().filter_map(|x| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:40:45 + --> tests/ui/filter_map_identity.rs:45:45 | LL | copy_vec_non_inferred().into_iter().filter_map(|x| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:43:36 + --> tests/ui/filter_map_identity.rs:48:36 | LL | non_copy_vec().into_iter().filter_map(|x| x); | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:46:36 + --> tests/ui/filter_map_identity.rs:51:36 | LL | non_copy_vec().into_iter().filter_map(|x| x); | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:49:36 + --> tests/ui/filter_map_identity.rs:54:36 | LL | non_copy_vec().into_iter().filter_map(std::convert::identity); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:52:36 + --> tests/ui/filter_map_identity.rs:57:36 | LL | non_copy_vec().into_iter().filter_map(identity); | ^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:55:36 + --> tests/ui/filter_map_identity.rs:60:36 | LL | non_copy_vec().into_iter().filter_map(|x| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:58:36 + --> tests/ui/filter_map_identity.rs:63:36 | LL | non_copy_vec().into_iter().filter_map(|x| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:61:39 + --> tests/ui/filter_map_identity.rs:66:39 | LL | copy_vec::().into_iter().filter_map(|x: Option<_>| x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:64:39 + --> tests/ui/filter_map_identity.rs:69:39 | LL | copy_vec::().into_iter().filter_map(|x: Option<_>| x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:67:39 + --> tests/ui/filter_map_identity.rs:72:39 | LL | copy_vec::().into_iter().filter_map(|x: Option<_>| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:70:39 + --> tests/ui/filter_map_identity.rs:75:39 | LL | copy_vec::().into_iter().filter_map(|x: Option<_>| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:74:39 + --> tests/ui/filter_map_identity.rs:79:39 | LL | copy_vec::().into_iter().filter_map(|x: Option| x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:77:39 + --> tests/ui/filter_map_identity.rs:82:39 | LL | copy_vec::().into_iter().filter_map(|x: Option| x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:80:39 + --> tests/ui/filter_map_identity.rs:85:39 | LL | copy_vec::().into_iter().filter_map(|x: Option| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:83:39 + --> tests/ui/filter_map_identity.rs:88:39 | LL | copy_vec::().into_iter().filter_map(|x: Option| return x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:87:43 + --> tests/ui/filter_map_identity.rs:92:43 | LL | copy_vec::().into_iter().filter_map(|x: Option| -> Option {{ x }}); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:91:43 + --> tests/ui/filter_map_identity.rs:96:43 | LL | copy_vec::().into_iter().filter_map(|x: Option| -> Option {{ return x }}); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` error: use of `filter_map` with an identity function - --> tests/ui/filter_map_identity.rs:96:37 + --> tests/ui/filter_map_identity.rs:101:37 | LL | opaque::().into_iter().filter_map(|x| x); | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` diff --git a/tests/ui/impl.rs b/tests/ui/impl.rs index 1b9e4a5cdee1..96cf1e13aea7 100644 --- a/tests/ui/impl.rs +++ b/tests/ui/impl.rs @@ -1,4 +1,4 @@ -#![allow(dead_code, clippy::extra_unused_lifetimes)] +#![allow(dead_code, clippy::extra_unused_lifetimes, clippy::items_before_use)] #![warn(clippy::multiple_inherent_impl)] struct MyStruct; diff --git a/tests/ui/infinite_loop.rs b/tests/ui/infinite_loop.rs index 8ff7f3b0c18d..c9b457412a06 100644 --- a/tests/ui/infinite_loop.rs +++ b/tests/ui/infinite_loop.rs @@ -1,3 +1,5 @@ +#![allow(clippy::items_before_use)] + fn fn_val(i: i32) -> i32 { unimplemented!() } diff --git a/tests/ui/infinite_loop.stderr b/tests/ui/infinite_loop.stderr index 04da9776c302..7ba1374d64f4 100644 --- a/tests/ui/infinite_loop.stderr +++ b/tests/ui/infinite_loop.stderr @@ -1,5 +1,5 @@ error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:20:11 + --> tests/ui/infinite_loop.rs:22:11 | LL | while y < 10 { | ^^^^^^ @@ -8,7 +8,7 @@ LL | while y < 10 { = note: `#[deny(clippy::while_immutable_condition)]` on by default error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:27:11 + --> tests/ui/infinite_loop.rs:29:11 | LL | while y < 10 && x < 3 { | ^^^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL | while y < 10 && x < 3 { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:36:11 + --> tests/ui/infinite_loop.rs:38:11 | LL | while !cond { | ^^^^^ @@ -24,7 +24,7 @@ LL | while !cond { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:82:11 + --> tests/ui/infinite_loop.rs:84:11 | LL | while i < 3 { | ^^^^^ @@ -32,7 +32,7 @@ LL | while i < 3 { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:89:11 + --> tests/ui/infinite_loop.rs:91:11 | LL | while i < 3 && j > 0 { | ^^^^^^^^^^^^^^ @@ -40,7 +40,7 @@ LL | while i < 3 && j > 0 { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:95:11 + --> tests/ui/infinite_loop.rs:97:11 | LL | while i < 3 { | ^^^^^ @@ -48,7 +48,7 @@ LL | while i < 3 { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:112:11 + --> tests/ui/infinite_loop.rs:114:11 | LL | while i < 3 { | ^^^^^ @@ -56,7 +56,7 @@ LL | while i < 3 { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:119:11 + --> tests/ui/infinite_loop.rs:121:11 | LL | while i < 3 { | ^^^^^ @@ -64,7 +64,7 @@ LL | while i < 3 { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:187:15 + --> tests/ui/infinite_loop.rs:189:15 | LL | while self.count < n { | ^^^^^^^^^^^^^^ @@ -72,7 +72,7 @@ LL | while self.count < n { = note: this may lead to an infinite or to a never running loop error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:197:11 + --> tests/ui/infinite_loop.rs:199:11 | LL | while y < 10 { | ^^^^^^ @@ -82,7 +82,7 @@ LL | while y < 10 { = help: rewrite it as `if cond { loop { } }` error: variables in the condition are not mutated in the loop body - --> tests/ui/infinite_loop.rs:206:11 + --> tests/ui/infinite_loop.rs:208:11 | LL | while y < 10 { | ^^^^^^ diff --git a/tests/ui/into_iter_on_ref.fixed b/tests/ui/into_iter_on_ref.fixed index 7626569fd422..a60362ace14d 100644 --- a/tests/ui/into_iter_on_ref.fixed +++ b/tests/ui/into_iter_on_ref.fixed @@ -1,4 +1,4 @@ -#![allow(clippy::useless_vec, clippy::needless_borrow)] +#![allow(clippy::useless_vec, clippy::needless_borrow, clippy::items_before_use)] #![warn(clippy::into_iter_on_ref)] struct X; diff --git a/tests/ui/into_iter_on_ref.rs b/tests/ui/into_iter_on_ref.rs index 286a62c69ce5..5036304d49e3 100644 --- a/tests/ui/into_iter_on_ref.rs +++ b/tests/ui/into_iter_on_ref.rs @@ -1,4 +1,4 @@ -#![allow(clippy::useless_vec, clippy::needless_borrow)] +#![allow(clippy::useless_vec, clippy::needless_borrow, clippy::items_before_use)] #![warn(clippy::into_iter_on_ref)] struct X; diff --git a/tests/ui/items_before_use.rs b/tests/ui/items_before_use.rs new file mode 100644 index 000000000000..a9bb2833c79b --- /dev/null +++ b/tests/ui/items_before_use.rs @@ -0,0 +1,28 @@ +#![warn(clippy::items_before_use)] + +mod demo { + use std::fmt; // OK: at the top + + extern crate core; + use std::io; // OK: after extern crate (only linted for strict) + + mod submodule {} + use std::fs; // OK: after mod (only linted for strict) + + fn f() {} + use std::str; //~ items_before_use + + #[cfg(test)] + mod test_mod { + use std::collections::HashMap; // ignored (inside cfg block) + fn test_fn() {} + } + + #[cfg(feature = "magic")] + use std::vec::Vec; // ignored + + struct Data; + use std::borrow::Cow; //~ items_before_use +} + +fn main() {} diff --git a/tests/ui/items_before_use.stderr b/tests/ui/items_before_use.stderr new file mode 100644 index 000000000000..cfe1f36f117d --- /dev/null +++ b/tests/ui/items_before_use.stderr @@ -0,0 +1,20 @@ +error: module level use statements should precede all other items + --> tests/ui/items_before_use.rs:13:5 + | +LL | use std::str; + | ^^^^^^^^^^^^^ + | + = note: consider moving this statement to the top of the module + = note: `-D clippy::items-before-use` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::items_before_use)]` + +error: module level use statements should precede all other items + --> tests/ui/items_before_use.rs:25:5 + | +LL | use std::borrow::Cow; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: consider moving this statement to the top of the module + +error: aborting due to 2 previous errors + diff --git a/tests/ui/iter_on_empty_collections.fixed b/tests/ui/iter_on_empty_collections.fixed index 0c2100034e18..8909be336460 100644 --- a/tests/ui/iter_on_empty_collections.fixed +++ b/tests/ui/iter_on_empty_collections.fixed @@ -1,5 +1,5 @@ #![warn(clippy::iter_on_empty_collections)] -#![allow(clippy::iter_next_slice, clippy::redundant_clone)] +#![allow(clippy::iter_next_slice, clippy::redundant_clone, clippy::items_before_use)] fn array() { assert_eq!(std::iter::empty().next(), Option::::None); diff --git a/tests/ui/iter_on_empty_collections.rs b/tests/ui/iter_on_empty_collections.rs index 0fb7a32d3691..410a358f2332 100644 --- a/tests/ui/iter_on_empty_collections.rs +++ b/tests/ui/iter_on_empty_collections.rs @@ -1,5 +1,5 @@ #![warn(clippy::iter_on_empty_collections)] -#![allow(clippy::iter_next_slice, clippy::redundant_clone)] +#![allow(clippy::iter_next_slice, clippy::redundant_clone, clippy::items_before_use)] fn array() { assert_eq!([].into_iter().next(), Option::::None); diff --git a/tests/ui/iter_on_single_items.fixed b/tests/ui/iter_on_single_items.fixed index b43fad6449c1..ccda6a00e150 100644 --- a/tests/ui/iter_on_single_items.fixed +++ b/tests/ui/iter_on_single_items.fixed @@ -1,5 +1,5 @@ #![warn(clippy::iter_on_single_items)] -#![allow(clippy::iter_next_slice, clippy::redundant_clone)] +#![allow(clippy::iter_next_slice, clippy::redundant_clone, clippy::items_before_use)] fn array() { assert_eq!(std::iter::once(123).next(), Some(123)); diff --git a/tests/ui/iter_on_single_items.rs b/tests/ui/iter_on_single_items.rs index 625c96d3ef1f..dcbe925c0412 100644 --- a/tests/ui/iter_on_single_items.rs +++ b/tests/ui/iter_on_single_items.rs @@ -1,5 +1,5 @@ #![warn(clippy::iter_on_single_items)] -#![allow(clippy::iter_next_slice, clippy::redundant_clone)] +#![allow(clippy::iter_next_slice, clippy::redundant_clone, clippy::items_before_use)] fn array() { assert_eq!([123].into_iter().next(), Some(123)); diff --git a/tests/ui/legacy_numeric_constants.fixed b/tests/ui/legacy_numeric_constants.fixed index 30bb549a9d65..6cabff1da204 100644 --- a/tests/ui/legacy_numeric_constants.fixed +++ b/tests/ui/legacy_numeric_constants.fixed @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs //@require-annotations-for-level: WARN -#![allow(clippy::no_effect, deprecated, unused)] +#![allow(clippy::no_effect, deprecated, unused, clippy::items_before_use)] #![allow(clippy::legacy_numeric_constants)] // For imports. #[macro_use] diff --git a/tests/ui/legacy_numeric_constants.rs b/tests/ui/legacy_numeric_constants.rs index d3878199055f..d02949e62628 100644 --- a/tests/ui/legacy_numeric_constants.rs +++ b/tests/ui/legacy_numeric_constants.rs @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs //@require-annotations-for-level: WARN -#![allow(clippy::no_effect, deprecated, unused)] +#![allow(clippy::no_effect, deprecated, unused, clippy::items_before_use)] #![allow(clippy::legacy_numeric_constants)] // For imports. #[macro_use] diff --git a/tests/ui/manual_unwrap_or.fixed b/tests/ui/manual_unwrap_or.fixed index e12287a70939..b21cb7bbacb6 100644 --- a/tests/ui/manual_unwrap_or.fixed +++ b/tests/ui/manual_unwrap_or.fixed @@ -3,7 +3,8 @@ unused_variables, clippy::unnecessary_wraps, clippy::unnecessary_literal_unwrap, - clippy::manual_unwrap_or_default + clippy::manual_unwrap_or_default, + clippy::items_before_use )] fn option_unwrap_or() { diff --git a/tests/ui/manual_unwrap_or.rs b/tests/ui/manual_unwrap_or.rs index 53cffcab5b56..2ff7ad48d8a5 100644 --- a/tests/ui/manual_unwrap_or.rs +++ b/tests/ui/manual_unwrap_or.rs @@ -3,7 +3,8 @@ unused_variables, clippy::unnecessary_wraps, clippy::unnecessary_literal_unwrap, - clippy::manual_unwrap_or_default + clippy::manual_unwrap_or_default, + clippy::items_before_use )] fn option_unwrap_or() { diff --git a/tests/ui/manual_unwrap_or.stderr b/tests/ui/manual_unwrap_or.stderr index 320e895fb823..853c9652d6aa 100644 --- a/tests/ui/manual_unwrap_or.stderr +++ b/tests/ui/manual_unwrap_or.stderr @@ -1,5 +1,5 @@ error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:11:5 + --> tests/ui/manual_unwrap_or.rs:12:5 | LL | / match Some(1) { LL | | @@ -12,7 +12,7 @@ LL | | }; = help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or)]` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:18:5 + --> tests/ui/manual_unwrap_or.rs:19:5 | LL | / match Some(1) { LL | | @@ -22,7 +22,7 @@ LL | | }; | |_____^ help: replace with: `Some(1).unwrap_or(42)` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:25:5 + --> tests/ui/manual_unwrap_or.rs:26:5 | LL | / match Some(1) { LL | | @@ -32,7 +32,7 @@ LL | | }; | |_____^ help: replace with: `Some(1).unwrap_or(1 + 42)` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:33:5 + --> tests/ui/manual_unwrap_or.rs:34:5 | LL | / match Some(1) { LL | | @@ -50,7 +50,7 @@ LL ~ + 42 + 42 + 42); | error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:44:5 + --> tests/ui/manual_unwrap_or.rs:45:5 | LL | / match Some("Bob") { LL | | @@ -60,7 +60,7 @@ LL | | }; | |_____^ help: replace with: `Some("Bob").unwrap_or("Alice")` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:92:5 + --> tests/ui/manual_unwrap_or.rs:93:5 | LL | / if let Some(x) = Some(1) { LL | | @@ -71,7 +71,7 @@ LL | | }; | |_____^ help: replace with: `Some(1).unwrap_or(42)` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:126:5 + --> tests/ui/manual_unwrap_or.rs:127:5 | LL | / match Ok::(1) { LL | | @@ -81,7 +81,7 @@ LL | | }; | |_____^ help: replace with: `Ok::(1).unwrap_or(42)` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:134:5 + --> tests/ui/manual_unwrap_or.rs:135:5 | LL | / match a { LL | | @@ -91,7 +91,7 @@ LL | | }; | |_____^ help: replace with: `a.unwrap_or(42)` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:141:5 + --> tests/ui/manual_unwrap_or.rs:142:5 | LL | / match Ok(1) as Result { LL | | @@ -101,7 +101,7 @@ LL | | }; | |_____^ help: replace with: `(Ok(1) as Result).unwrap_or(42)` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:155:5 + --> tests/ui/manual_unwrap_or.rs:156:5 | LL | / match s.method() { LL | | @@ -111,7 +111,7 @@ LL | | }; | |_____^ help: replace with: `s.method().unwrap_or(42)` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:162:5 + --> tests/ui/manual_unwrap_or.rs:163:5 | LL | / match Ok::(1) { LL | | @@ -121,7 +121,7 @@ LL | | }; | |_____^ help: replace with: `Ok::(1).unwrap_or(42)` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:169:5 + --> tests/ui/manual_unwrap_or.rs:170:5 | LL | / match Ok::(1) { LL | | @@ -131,7 +131,7 @@ LL | | }; | |_____^ help: replace with: `Ok::(1).unwrap_or(1 + 42)` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:177:5 + --> tests/ui/manual_unwrap_or.rs:178:5 | LL | / match Ok::(1) { LL | | @@ -149,7 +149,7 @@ LL ~ + 42 + 42 + 42); | error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:188:5 + --> tests/ui/manual_unwrap_or.rs:189:5 | LL | / match Ok::<&str, &str>("Bob") { LL | | @@ -159,7 +159,7 @@ LL | | }; | |_____^ help: replace with: `Ok::<&str, &str>("Bob").unwrap_or("Alice")` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:219:5 + --> tests/ui/manual_unwrap_or.rs:220:5 | LL | / match Ok::<&str, &str>("Alice") { LL | | @@ -169,7 +169,7 @@ LL | | }; | |_____^ help: replace with: `Ok::<&str, &str>("Alice").unwrap_or("Bob")` error: this pattern reimplements `Result::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:225:5 + --> tests/ui/manual_unwrap_or.rs:226:5 | LL | / if let Ok(x) = Ok::(1) { LL | | @@ -180,7 +180,7 @@ LL | | }; | |_____^ help: replace with: `Ok::(1).unwrap_or(42)` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:280:17 + --> tests/ui/manual_unwrap_or.rs:281:17 | LL | let _ = match some_macro!() { | _________________^ @@ -191,7 +191,7 @@ LL | | }; | |_________^ help: replace with: `some_macro!().unwrap_or(0)` error: this pattern reimplements `Option::unwrap_or` - --> tests/ui/manual_unwrap_or.rs:324:5 + --> tests/ui/manual_unwrap_or.rs:325:5 | LL | / if let Some(x) = Some(42) { LL | | diff --git a/tests/ui/missing_const_for_fn/cant_be_const.rs b/tests/ui/missing_const_for_fn/cant_be_const.rs index 40e7a5d745cc..9e4878359057 100644 --- a/tests/ui/missing_const_for_fn/cant_be_const.rs +++ b/tests/ui/missing_const_for_fn/cant_be_const.rs @@ -6,6 +6,7 @@ //@aux-build:helper.rs //@aux-build:../auxiliary/proc_macros.rs +#![allow(clippy::items_before_use)] #![warn(clippy::missing_const_for_fn)] #![feature(type_alias_impl_trait)] diff --git a/tests/ui/module_name_repetitions.rs b/tests/ui/module_name_repetitions.rs index 2fde98d7927c..6db1f4146dd9 100644 --- a/tests/ui/module_name_repetitions.rs +++ b/tests/ui/module_name_repetitions.rs @@ -1,7 +1,7 @@ //@compile-flags: --test #![warn(clippy::module_name_repetitions)] -#![allow(dead_code)] +#![allow(dead_code, clippy::items_before_use)] pub mod foo { pub fn foo() {} diff --git a/tests/ui/non_std_lazy_static/non_std_lazy_static_other_once_cell.rs b/tests/ui/non_std_lazy_static/non_std_lazy_static_other_once_cell.rs index f6d4f7250915..ca8675b7efa9 100644 --- a/tests/ui/non_std_lazy_static/non_std_lazy_static_other_once_cell.rs +++ b/tests/ui/non_std_lazy_static/non_std_lazy_static_other_once_cell.rs @@ -1,6 +1,7 @@ //@ check-pass //@aux-build:once_cell.rs +#![allow(clippy::items_before_use)] #![warn(clippy::non_std_lazy_statics)] // Should not error, since we used a type besides `sync::Lazy` diff --git a/tests/ui/redundant_pub_crate.fixed b/tests/ui/redundant_pub_crate.fixed index 8a30fedede4a..cad65956bcb7 100644 --- a/tests/ui/redundant_pub_crate.fixed +++ b/tests/ui/redundant_pub_crate.fixed @@ -1,5 +1,5 @@ //@aux-build:proc_macros.rs -#![allow(dead_code)] +#![allow(dead_code, clippy::items_before_use)] #![warn(clippy::redundant_pub_crate)] mod m1 { diff --git a/tests/ui/redundant_pub_crate.rs b/tests/ui/redundant_pub_crate.rs index 45ba13a63b2e..7cc544d03924 100644 --- a/tests/ui/redundant_pub_crate.rs +++ b/tests/ui/redundant_pub_crate.rs @@ -1,5 +1,5 @@ //@aux-build:proc_macros.rs -#![allow(dead_code)] +#![allow(dead_code, clippy::items_before_use)] #![warn(clippy::redundant_pub_crate)] mod m1 { diff --git a/tests/ui/single_component_path_imports_macro.rs b/tests/ui/single_component_path_imports_macro.rs index f655ea482d1c..63c8d6b63fc8 100644 --- a/tests/ui/single_component_path_imports_macro.rs +++ b/tests/ui/single_component_path_imports_macro.rs @@ -1,7 +1,7 @@ //@ check-pass #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] +#![allow(unused_imports, clippy::items_before_use)] // #7106: use statements exporting a macro within a crate should not trigger lint // #7923: normal `use` statements of macros should also not trigger the lint diff --git a/tests/ui/single_match.fixed b/tests/ui/single_match.fixed index db5107600ee6..2c5ef4b310e4 100644 --- a/tests/ui/single_match.fixed +++ b/tests/ui/single_match.fixed @@ -6,7 +6,8 @@ clippy::needless_if, clippy::redundant_guards, clippy::redundant_pattern_matching, - clippy::manual_unwrap_or_default + clippy::manual_unwrap_or_default, + clippy::items_before_use )] fn dummy() {} diff --git a/tests/ui/single_match.rs b/tests/ui/single_match.rs index a367b94c4ca6..b23a37b78534 100644 --- a/tests/ui/single_match.rs +++ b/tests/ui/single_match.rs @@ -6,7 +6,8 @@ clippy::needless_if, clippy::redundant_guards, clippy::redundant_pattern_matching, - clippy::manual_unwrap_or_default + clippy::manual_unwrap_or_default, + clippy::items_before_use )] fn dummy() {} diff --git a/tests/ui/single_match.stderr b/tests/ui/single_match.stderr index 1a4edc45c928..8636e2d97019 100644 --- a/tests/ui/single_match.stderr +++ b/tests/ui/single_match.stderr @@ -1,5 +1,5 @@ error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:16:5 + --> tests/ui/single_match.rs:17:5 | LL | / match x { LL | | Some(y) => { @@ -19,7 +19,7 @@ LL ~ }; | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:25:5 + --> tests/ui/single_match.rs:26:5 | LL | / match x { ... | @@ -30,7 +30,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:36:5 + --> tests/ui/single_match.rs:37:5 | LL | / match z { LL | | (2..=3, 7..=9) => dummy(), @@ -39,7 +39,7 @@ LL | | }; | |_____^ help: try: `if let (2..=3, 7..=9) = z { dummy() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:66:5 + --> tests/ui/single_match.rs:67:5 | LL | / match x { LL | | Some(y) => dummy(), @@ -48,7 +48,7 @@ LL | | }; | |_____^ help: try: `if let Some(y) = x { dummy() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:72:5 + --> tests/ui/single_match.rs:73:5 | LL | / match y { LL | | Ok(y) => dummy(), @@ -57,7 +57,7 @@ LL | | }; | |_____^ help: try: `if let Ok(y) = y { dummy() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:80:5 + --> tests/ui/single_match.rs:81:5 | LL | / match c { LL | | Cow::Borrowed(..) => dummy(), @@ -66,7 +66,7 @@ LL | | }; | |_____^ help: try: `if let Cow::Borrowed(..) = c { dummy() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:102:5 + --> tests/ui/single_match.rs:103:5 | LL | / match x { LL | | "test" => println!(), @@ -75,7 +75,7 @@ LL | | } | |_____^ help: try: `if x == "test" { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:116:5 + --> tests/ui/single_match.rs:117:5 | LL | / match x { LL | | Foo::A => println!(), @@ -84,7 +84,7 @@ LL | | } | |_____^ help: try: `if x == Foo::A { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:123:5 + --> tests/ui/single_match.rs:124:5 | LL | / match x { LL | | FOO_C => println!(), @@ -93,7 +93,7 @@ LL | | } | |_____^ help: try: `if x == FOO_C { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:129:5 + --> tests/ui/single_match.rs:130:5 | LL | / match &&x { LL | | Foo::A => println!(), @@ -102,7 +102,7 @@ LL | | } | |_____^ help: try: `if x == Foo::A { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:136:5 + --> tests/ui/single_match.rs:137:5 | LL | / match &x { LL | | Foo::A => println!(), @@ -111,7 +111,7 @@ LL | | } | |_____^ help: try: `if x == &Foo::A { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:154:5 + --> tests/ui/single_match.rs:155:5 | LL | / match x { LL | | Bar::A => println!(), @@ -120,7 +120,7 @@ LL | | } | |_____^ help: try: `if let Bar::A = x { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:163:5 + --> tests/ui/single_match.rs:164:5 | LL | / match x { LL | | None => println!(), @@ -129,7 +129,7 @@ LL | | }; | |_____^ help: try: `if let None = x { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:186:5 + --> tests/ui/single_match.rs:187:5 | LL | / match x { LL | | (Some(_), _) => {}, @@ -138,7 +138,7 @@ LL | | } | |_____^ help: try: `if let (Some(_), _) = x {}` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:193:5 + --> tests/ui/single_match.rs:194:5 | LL | / match x { LL | | (Some(E::V), _) => todo!(), @@ -147,7 +147,7 @@ LL | | } | |_____^ help: try: `if let (Some(E::V), _) = x { todo!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:200:5 + --> tests/ui/single_match.rs:201:5 | LL | / match (Some(42), Some(E::V), Some(42)) { LL | | (.., Some(E::V), _) => {}, @@ -156,7 +156,7 @@ LL | | } | |_____^ help: try: `if let (.., Some(E::V), _) = (Some(42), Some(E::V), Some(42)) {}` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:273:5 + --> tests/ui/single_match.rs:274:5 | LL | / match bar { LL | | Some(v) => unsafe { @@ -176,7 +176,7 @@ LL + } } | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:282:5 + --> tests/ui/single_match.rs:283:5 | LL | / match bar { LL | | #[rustfmt::skip] @@ -198,7 +198,7 @@ LL + } | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:363:5 + --> tests/ui/single_match.rs:364:5 | LL | / match Ok::<_, u32>(Some(A)) { LL | | Ok(Some(A)) => println!(), @@ -207,7 +207,7 @@ LL | | } | |_____^ help: try: `if let Ok(Some(A)) = Ok::<_, u32>(Some(A)) { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:379:5 + --> tests/ui/single_match.rs:380:5 | LL | / match &Some(A) { LL | | Some(A | B) => println!(), @@ -216,7 +216,7 @@ LL | | } | |_____^ help: try: `if let Some(A | B) = &Some(A) { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:387:5 + --> tests/ui/single_match.rs:388:5 | LL | / match &s[0..3] { LL | | b"foo" => println!(), @@ -225,7 +225,7 @@ LL | | } | |_____^ help: try: `if &s[0..3] == b"foo" { println!() }` error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:401:5 + --> tests/ui/single_match.rs:402:5 | LL | / match DATA { LL | | DATA => println!(), @@ -234,7 +234,7 @@ LL | | } | |_____^ help: try: `println!();` error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:407:5 + --> tests/ui/single_match.rs:408:5 | LL | / match CONST_I32 { LL | | CONST_I32 => println!(), @@ -243,7 +243,7 @@ LL | | } | |_____^ help: try: `println!();` error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:414:5 + --> tests/ui/single_match.rs:415:5 | LL | / match i { LL | | i => { @@ -263,7 +263,7 @@ LL + } | error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:423:5 + --> tests/ui/single_match.rs:424:5 | LL | / match i { LL | | i => {}, @@ -272,7 +272,7 @@ LL | | } | |_____^ help: `match` expression can be removed error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:429:5 + --> tests/ui/single_match.rs:430:5 | LL | / match i { LL | | i => (), @@ -281,7 +281,7 @@ LL | | } | |_____^ help: `match` expression can be removed error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:435:5 + --> tests/ui/single_match.rs:436:5 | LL | / match CONST_I32 { LL | | CONST_I32 => println!(), @@ -290,7 +290,7 @@ LL | | } | |_____^ help: try: `println!();` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:443:5 + --> tests/ui/single_match.rs:444:5 | LL | / match x.pop() { LL | | // bla @@ -302,7 +302,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:452:5 + --> tests/ui/single_match.rs:453:5 | LL | / match x.pop() { LL | | // bla @@ -322,7 +322,7 @@ LL + } | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:478:5 + --> tests/ui/single_match.rs:479:5 | LL | / match mac!(some) { LL | | Some(u) => println!("{u}"), @@ -331,7 +331,7 @@ LL | | } | |_____^ help: try: `if let Some(u) = mac!(some) { println!("{u}") }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:486:5 + --> tests/ui/single_match.rs:487:5 | LL | / match mac!(str) { LL | | "foo" => println!("eq"), diff --git a/tests/ui/suspicious_doc_comments_unfixable.rs b/tests/ui/suspicious_doc_comments_unfixable.rs index 17c7cc15b170..7b3d779bc97b 100644 --- a/tests/ui/suspicious_doc_comments_unfixable.rs +++ b/tests/ui/suspicious_doc_comments_unfixable.rs @@ -1,4 +1,4 @@ -#![allow(unused, clippy::empty_line_after_doc_comments)] +#![allow(unused, clippy::empty_line_after_doc_comments, clippy::items_before_use)] #![warn(clippy::suspicious_doc_comments)] //@no-rustfix ///! a diff --git a/tests/ui/unnecessary_cast.fixed b/tests/ui/unnecessary_cast.fixed index 91ff4b9ee771..e8f58125eef1 100644 --- a/tests/ui/unnecessary_cast.fixed +++ b/tests/ui/unnecessary_cast.fixed @@ -6,6 +6,7 @@ clippy::no_effect, clippy::nonstandard_macro_braces, clippy::unnecessary_operation, + clippy::items_before_use, nonstandard_style, unused )] diff --git a/tests/ui/unnecessary_cast.rs b/tests/ui/unnecessary_cast.rs index 5444a914db16..5ed5b02dac82 100644 --- a/tests/ui/unnecessary_cast.rs +++ b/tests/ui/unnecessary_cast.rs @@ -6,6 +6,7 @@ clippy::no_effect, clippy::nonstandard_macro_braces, clippy::unnecessary_operation, + clippy::items_before_use, nonstandard_style, unused )] diff --git a/tests/ui/unnecessary_cast.stderr b/tests/ui/unnecessary_cast.stderr index 3e3c5eb81c10..1e58ce320301 100644 --- a/tests/ui/unnecessary_cast.stderr +++ b/tests/ui/unnecessary_cast.stderr @@ -1,5 +1,5 @@ error: casting raw pointers to the same type and constness is unnecessary (`*const T` -> `*const T`) - --> tests/ui/unnecessary_cast.rs:19:5 + --> tests/ui/unnecessary_cast.rs:20:5 | LL | ptr as *const T | ^^^^^^^^^^^^^^^ help: try: `ptr` @@ -8,259 +8,259 @@ LL | ptr as *const T = help: to override `-D warnings` add `#[allow(clippy::unnecessary_cast)]` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:55:5 + --> tests/ui/unnecessary_cast.rs:56:5 | LL | 1i32 as i32; | ^^^^^^^^^^^ help: try: `1_i32` error: casting float literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:57:5 + --> tests/ui/unnecessary_cast.rs:58:5 | LL | 1f32 as f32; | ^^^^^^^^^^^ help: try: `1_f32` error: casting to the same type is unnecessary (`bool` -> `bool`) - --> tests/ui/unnecessary_cast.rs:59:5 + --> tests/ui/unnecessary_cast.rs:60:5 | LL | false as bool; | ^^^^^^^^^^^^^ help: try: `false` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:63:5 + --> tests/ui/unnecessary_cast.rs:64:5 | LL | -1_i32 as i32; | ^^^^^^^^^^^^^ help: try: `-1_i32` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:65:5 + --> tests/ui/unnecessary_cast.rs:66:5 | LL | - 1_i32 as i32; | ^^^^^^^^^^^^^^ help: try: `- 1_i32` error: casting float literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:67:5 + --> tests/ui/unnecessary_cast.rs:68:5 | LL | -1f32 as f32; | ^^^^^^^^^^^^ help: try: `-1_f32` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:69:5 + --> tests/ui/unnecessary_cast.rs:70:5 | LL | 1_i32 as i32; | ^^^^^^^^^^^^ help: try: `1_i32` error: casting float literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:71:5 + --> tests/ui/unnecessary_cast.rs:72:5 | LL | 1_f32 as f32; | ^^^^^^^^^^^^ help: try: `1_f32` error: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`) - --> tests/ui/unnecessary_cast.rs:74:22 + --> tests/ui/unnecessary_cast.rs:75:22 | LL | let _: *mut u8 = [1u8, 2].as_ptr() as *const u8 as *mut u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `[1u8, 2].as_ptr()` error: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`) - --> tests/ui/unnecessary_cast.rs:77:5 + --> tests/ui/unnecessary_cast.rs:78:5 | LL | [1u8, 2].as_ptr() as *const u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `[1u8, 2].as_ptr()` error: casting raw pointers to the same type and constness is unnecessary (`*mut u8` -> `*mut u8`) - --> tests/ui/unnecessary_cast.rs:80:5 + --> tests/ui/unnecessary_cast.rs:81:5 | LL | [1u8, 2].as_mut_ptr() as *mut u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `[1u8, 2].as_mut_ptr()` error: casting raw pointers to the same type and constness is unnecessary (`*const u32` -> `*const u32`) - --> tests/ui/unnecessary_cast.rs:92:5 + --> tests/ui/unnecessary_cast.rs:93:5 | LL | owo::([1u32].as_ptr()) as *const u32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `owo::([1u32].as_ptr())` error: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`) - --> tests/ui/unnecessary_cast.rs:94:5 + --> tests/ui/unnecessary_cast.rs:95:5 | LL | uwu::([1u32].as_ptr()) as *const u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `uwu::([1u32].as_ptr())` error: casting raw pointers to the same type and constness is unnecessary (`*const u32` -> `*const u32`) - --> tests/ui/unnecessary_cast.rs:97:5 + --> tests/ui/unnecessary_cast.rs:98:5 | LL | uwu::([1u32].as_ptr()) as *const u32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `uwu::([1u32].as_ptr())` error: casting to the same type is unnecessary (`u32` -> `u32`) - --> tests/ui/unnecessary_cast.rs:133:5 + --> tests/ui/unnecessary_cast.rs:134:5 | LL | aaa() as u32; | ^^^^^^^^^^^^ help: try: `aaa()` error: casting to the same type is unnecessary (`u32` -> `u32`) - --> tests/ui/unnecessary_cast.rs:136:5 + --> tests/ui/unnecessary_cast.rs:137:5 | LL | aaa() as u32; | ^^^^^^^^^^^^ help: try: `aaa()` error: casting integer literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:173:9 + --> tests/ui/unnecessary_cast.rs:174:9 | LL | 100 as f32; | ^^^^^^^^^^ help: try: `100_f32` error: casting integer literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:175:9 + --> tests/ui/unnecessary_cast.rs:176:9 | LL | 100 as f64; | ^^^^^^^^^^ help: try: `100_f64` error: casting integer literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:177:9 + --> tests/ui/unnecessary_cast.rs:178:9 | LL | 100_i32 as f64; | ^^^^^^^^^^^^^^ help: try: `100_f64` error: casting integer literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:179:17 + --> tests/ui/unnecessary_cast.rs:180:17 | LL | let _ = -100 as f32; | ^^^^^^^^^^^ help: try: `-100_f32` error: casting integer literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:181:17 + --> tests/ui/unnecessary_cast.rs:182:17 | LL | let _ = -100 as f64; | ^^^^^^^^^^^ help: try: `-100_f64` error: casting integer literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:183:17 + --> tests/ui/unnecessary_cast.rs:184:17 | LL | let _ = -100_i32 as f64; | ^^^^^^^^^^^^^^^ help: try: `-100_f64` error: casting float literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:185:9 + --> tests/ui/unnecessary_cast.rs:186:9 | LL | 100. as f32; | ^^^^^^^^^^^ help: try: `100_f32` error: casting float literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:187:9 + --> tests/ui/unnecessary_cast.rs:188:9 | LL | 100. as f64; | ^^^^^^^^^^^ help: try: `100_f64` error: casting integer literal to `u32` is unnecessary - --> tests/ui/unnecessary_cast.rs:200:9 + --> tests/ui/unnecessary_cast.rs:201:9 | LL | 1 as u32; | ^^^^^^^^ help: try: `1_u32` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:202:9 + --> tests/ui/unnecessary_cast.rs:203:9 | LL | 0x10 as i32; | ^^^^^^^^^^^ help: try: `0x10_i32` error: casting integer literal to `usize` is unnecessary - --> tests/ui/unnecessary_cast.rs:204:9 + --> tests/ui/unnecessary_cast.rs:205:9 | LL | 0b10 as usize; | ^^^^^^^^^^^^^ help: try: `0b10_usize` error: casting integer literal to `u16` is unnecessary - --> tests/ui/unnecessary_cast.rs:206:9 + --> tests/ui/unnecessary_cast.rs:207:9 | LL | 0o73 as u16; | ^^^^^^^^^^^ help: try: `0o73_u16` error: casting integer literal to `u32` is unnecessary - --> tests/ui/unnecessary_cast.rs:208:9 + --> tests/ui/unnecessary_cast.rs:209:9 | LL | 1_000_000_000 as u32; | ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32` error: casting float literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:211:9 + --> tests/ui/unnecessary_cast.rs:212:9 | LL | 1.0 as f64; | ^^^^^^^^^^ help: try: `1.0_f64` error: casting float literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:213:9 + --> tests/ui/unnecessary_cast.rs:214:9 | LL | 0.5 as f32; | ^^^^^^^^^^ help: try: `0.5_f32` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:218:17 + --> tests/ui/unnecessary_cast.rs:219:17 | LL | let _ = -1 as i32; | ^^^^^^^^^ help: try: `-1_i32` error: casting float literal to `f32` is unnecessary - --> tests/ui/unnecessary_cast.rs:220:17 + --> tests/ui/unnecessary_cast.rs:221:17 | LL | let _ = -1.0 as f32; | ^^^^^^^^^^^ help: try: `-1.0_f32` error: casting to the same type is unnecessary (`i32` -> `i32`) - --> tests/ui/unnecessary_cast.rs:227:18 + --> tests/ui/unnecessary_cast.rs:228:18 | LL | let _ = &(x as i32); | ^^^^^^^^^^ help: try: `{ x }` error: casting integer literal to `i32` is unnecessary - --> tests/ui/unnecessary_cast.rs:234:22 + --> tests/ui/unnecessary_cast.rs:235:22 | LL | let _: i32 = -(1) as i32; | ^^^^^^^^^^^ help: try: `-1_i32` error: casting integer literal to `i64` is unnecessary - --> tests/ui/unnecessary_cast.rs:237:22 + --> tests/ui/unnecessary_cast.rs:238:22 | LL | let _: i64 = -(1) as i64; | ^^^^^^^^^^^ help: try: `-1_i64` error: casting float literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:245:22 + --> tests/ui/unnecessary_cast.rs:246:22 | LL | let _: f64 = (-8.0 as f64).exp(); | ^^^^^^^^^^^^^ help: try: `(-8.0_f64)` error: casting float literal to `f64` is unnecessary - --> tests/ui/unnecessary_cast.rs:248:23 + --> tests/ui/unnecessary_cast.rs:249:23 | LL | let _: f64 = -(8.0 as f64).exp(); // should suggest `-8.0_f64.exp()` here not to change code behavior | ^^^^^^^^^^^^ help: try: `8.0_f64` error: casting to the same type is unnecessary (`f32` -> `f32`) - --> tests/ui/unnecessary_cast.rs:258:20 + --> tests/ui/unnecessary_cast.rs:259:20 | LL | let _num = foo() as f32; | ^^^^^^^^^^^^ help: try: `foo()` error: casting to the same type is unnecessary (`usize` -> `usize`) - --> tests/ui/unnecessary_cast.rs:269:9 + --> tests/ui/unnecessary_cast.rs:270:9 | LL | (*x as usize).pow(2) | ^^^^^^^^^^^^^ help: try: `(*x)` error: casting to the same type is unnecessary (`usize` -> `usize`) - --> tests/ui/unnecessary_cast.rs:277:31 + --> tests/ui/unnecessary_cast.rs:278:31 | LL | assert_eq!(vec.len(), x as usize); | ^^^^^^^^^^ help: try: `x` error: casting to the same type is unnecessary (`i64` -> `i64`) - --> tests/ui/unnecessary_cast.rs:280:17 + --> tests/ui/unnecessary_cast.rs:281:17 | LL | let _ = (5i32 as i64 as i64).abs(); | ^^^^^^^^^^^^^^^^^^^^ help: try: `(5i32 as i64)` error: casting to the same type is unnecessary (`i64` -> `i64`) - --> tests/ui/unnecessary_cast.rs:283:17 + --> tests/ui/unnecessary_cast.rs:284:17 | LL | let _ = 5i32 as i64 as i64; | ^^^^^^^^^^^^^^^^^^ help: try: `5i32 as i64` diff --git a/tests/ui/unnecessary_unsafety_doc.rs b/tests/ui/unnecessary_unsafety_doc.rs index 7a847d2e3b50..8acec9247f91 100644 --- a/tests/ui/unnecessary_unsafety_doc.rs +++ b/tests/ui/unnecessary_unsafety_doc.rs @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs -#![allow(clippy::let_unit_value, clippy::needless_pass_by_ref_mut)] +#![allow(clippy::let_unit_value, clippy::needless_pass_by_ref_mut, clippy::items_before_use)] #![warn(clippy::unnecessary_safety_doc)] extern crate proc_macros; diff --git a/tests/ui/unused_io_amount.rs b/tests/ui/unused_io_amount.rs index 32a50375806a..628af77be9e9 100644 --- a/tests/ui/unused_io_amount.rs +++ b/tests/ui/unused_io_amount.rs @@ -1,4 +1,4 @@ -#![allow(dead_code, clippy::needless_pass_by_ref_mut)] +#![allow(dead_code, clippy::needless_pass_by_ref_mut, clippy::items_before_use)] #![allow(clippy::redundant_pattern_matching)] #![warn(clippy::unused_io_amount)] diff --git a/tests/ui/unused_trait_names.fixed b/tests/ui/unused_trait_names.fixed index 17e32ddfd9d9..fa4984c73c1c 100644 --- a/tests/ui/unused_trait_names.fixed +++ b/tests/ui/unused_trait_names.fixed @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs -#![allow(unused)] +#![allow(unused, clippy::items_before_use)] #![warn(clippy::unused_trait_names)] #![feature(decl_macro)] diff --git a/tests/ui/unused_trait_names.rs b/tests/ui/unused_trait_names.rs index 3cf8597e5351..3959003a8e24 100644 --- a/tests/ui/unused_trait_names.rs +++ b/tests/ui/unused_trait_names.rs @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs -#![allow(unused)] +#![allow(unused, clippy::items_before_use)] #![warn(clippy::unused_trait_names)] #![feature(decl_macro)] diff --git a/tests/ui/useless_attribute.fixed b/tests/ui/useless_attribute.fixed index a96c8f46f551..66aaf1cac6df 100644 --- a/tests/ui/useless_attribute.fixed +++ b/tests/ui/useless_attribute.fixed @@ -1,6 +1,6 @@ //@aux-build:proc_macro_derive.rs -#![allow(unused, clippy::duplicated_attributes)] +#![allow(unused, clippy::duplicated_attributes, clippy::items_before_use)] #![warn(clippy::useless_attribute)] #![warn(unreachable_pub)] #![feature(rustc_private)] diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs index b26410134bbb..71a1ac731229 100644 --- a/tests/ui/useless_attribute.rs +++ b/tests/ui/useless_attribute.rs @@ -1,6 +1,6 @@ //@aux-build:proc_macro_derive.rs -#![allow(unused, clippy::duplicated_attributes)] +#![allow(unused, clippy::duplicated_attributes, clippy::items_before_use)] #![warn(clippy::useless_attribute)] #![warn(unreachable_pub)] #![feature(rustc_private)] From 16d9fc0a1a10038f110336e74988ee80e00f1424 Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Thu, 5 Jun 2025 21:17:49 +0530 Subject: [PATCH 2/7] Tweaks: added allow for new files after upstream rebase --- .../lint_groups_priority/pass/Cargo.stderr | 63 ------------------- tests/ui/doc_suspicious_footnotes.fixed | 2 +- tests/ui/doc_suspicious_footnotes.rs | 2 +- 3 files changed, 2 insertions(+), 65 deletions(-) delete mode 100644 tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr diff --git a/tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr b/tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr deleted file mode 100644 index 9bca6fc55197..000000000000 --- a/tests/ui-cargo/lint_groups_priority/pass/Cargo.stderr +++ /dev/null @@ -1,63 +0,0 @@ -error: internal compiler error: encountered incremental compilation error with shallow_lint_levels_on(pass[45c2]) - | - = help: This is a known issue with the compiler. Run `cargo clean -p pass` or `cargo clean` to allow your project to compile - = note: Please follow the instructions below to create a bug report with the provided information - = note: See for more information - - -thread 'rustc' panicked at /rustc/414482f6a0d4e7290f614300581a0b55442552a3/compiler/rustc_query_system/src/query/plumbing.rs:739:9: -Found unstable fingerprints for shallow_lint_levels_on(pass[45c2]): ShallowLintLevelMap { expectations: [], specs: {0: {LintId { lint: Lint { name: "clippy::ASSIGNING_CLONES", default_level: Allow, desc: "assigning the result of cloning may be inefficient", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IGNORE_WITHOUT_REASON", default_level: Allow, desc: "ignored tests without messages", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INLINE_ALWAYS", default_level: Allow, desc: "use of `#[inline(always)]`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SHOULD_PANIC_WITHOUT_EXPECT", default_level: Allow, desc: "ensures that all `should_panic` attributes specify its expected panic message", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::BOOL_TO_INT_WITH_IF", default_level: Allow, desc: "using if to convert bool to int", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::BORROW_AS_PTR", default_level: Allow, desc: "borrowing just to cast to a raw pointer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_LOSSLESS", default_level: Allow, desc: "casts using `as` that are known to be lossless, e.g., `x as u64` where `x: u8`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_POSSIBLE_TRUNCATION", default_level: Allow, desc: "casts that may cause truncation of the value, e.g., `x as u8` where `x: u32`, or `x as i32` where `x: f32`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_POSSIBLE_WRAP", default_level: Allow, desc: "casts that may cause wrapping around the value, e.g., `x as i32` where `x: u32` and `x > i32::MAX`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_PRECISION_LOSS", default_level: Allow, desc: "casts that cause loss of precision, e.g., `x as f32` where `x: u64`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_PTR_ALIGNMENT", default_level: Allow, desc: "cast from a pointer to a more strictly aligned pointer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CAST_SIGN_LOSS", default_level: Allow, desc: "casts from signed types to unsigned types, e.g., `x as u32` where `x: i32`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::PTR_AS_PTR", default_level: Allow, desc: "casting using `as` between raw pointers that doesn't change their constness, where `pointer::cast` could take the place of `as`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::PTR_CAST_CONSTNESS", default_level: Allow, desc: "casting using `as` on raw pointers to change constness when specialized methods apply", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_AS_PTR", default_level: Allow, desc: "using `as` to cast a reference to pointer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CHECKED_CONVERSIONS", default_level: Allow, desc: "`try_from` could replace manual bounds checking when casting", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::COMPARISON_CHAIN", default_level: Allow, desc: "`if`s that can be rewritten with `match` and `cmp`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SAME_FUNCTIONS_IN_IF_CONDITION", default_level: Allow, desc: "consecutive `if`s with the same function call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::COPY_ITERATOR", default_level: Allow, desc: "implementing `Iterator` on a `Copy` type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DEFAULT_TRAIT_ACCESS", default_level: Allow, desc: "checks for literal calls to `Default::default()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPLICIT_DEREF_METHODS", default_level: Allow, desc: "Explicit use of deref or deref_mut method while not in a method chain.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_BINDING_TO_REFERENCE", default_level: Allow, desc: "`ref` binding to a reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPL_IMPL_CLONE_ON_COPY", default_level: Allow, desc: "implementing `Clone` explicitly on `Copy` types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNSAFE_DERIVE_DESERIALIZE", default_level: Allow, desc: "deriving `serde::Deserialize` on a type that has methods using `unsafe`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS", default_level: Allow, desc: "double-space used for doc comment linebreak instead of `\\`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DOC_LINK_WITH_QUOTES", default_level: Allow, desc: "possible typo for an intra-doc link", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::DOC_MARKDOWN", default_level: Allow, desc: "presence of `_`, `::` or camel-case outside backticks in documentation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_ERRORS_DOC", default_level: Allow, desc: "`pub fn` returns `Result` without `# Errors` in doc comment", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_PANICS_DOC", default_level: Allow, desc: "`pub fn` may panic without `# Panics` in doc comment", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EMPTY_ENUM", default_level: Allow, desc: "enum with no variants", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_CLOSURE_FOR_METHOD_CALLS", default_level: Allow, desc: "redundant closures for method calls", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FN_PARAMS_EXCESSIVE_BOOLS", default_level: Allow, desc: "using too many bools in function parameters", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STRUCT_EXCESSIVE_BOOLS", default_level: Allow, desc: "using too many bools in a struct", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_DEBUG_FORMATTING", default_level: Allow, desc: "`Debug` formatting applied to an `OsStr` or `Path` when `.display()` is available", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FORMAT_PUSH_STRING", default_level: Allow, desc: "`format!(..)` appended to existing `String`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MUST_USE_CANDIDATE", default_level: Allow, desc: "function or method that could take a `#[must_use]` attribute", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_OPTION", default_level: Allow, desc: "function signature uses `&Option` instead of `Option<&T>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::TOO_MANY_LINES", default_level: Allow, desc: "functions with too many lines", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IF_NOT_ELSE", default_level: Allow, desc: "`if` branches that could be swapped so no negation operation is necessary on the condition", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IGNORED_UNIT_PATTERNS", default_level: Allow, desc: "suggest replacing `_` by `()` in patterns where appropriate", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_HASHER", default_level: Allow, desc: "missing generalization over different hashers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INCONSISTENT_STRUCT_CONSTRUCTOR", default_level: Allow, desc: "the order of the field init is inconsistent with the order in the struct definition", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INDEX_REFUTABLE_SLICE", default_level: Allow, desc: "avoid indexing on slices which could be destructed", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MAYBE_INFINITE_ITER", default_level: Allow, desc: "possible infinite iteration", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_INSTANT_ELAPSED", default_level: Allow, desc: "subtraction between `Instant::now()` and previous `Instant`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNCHECKED_DURATION_SUBTRACTION", default_level: Allow, desc: "finds unchecked subtraction of a 'Duration' from an 'Instant'", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INVALID_UPCAST_COMPARISONS", default_level: Allow, desc: "a comparison involving an upcast which is always true or false", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STRUCT_FIELD_NAMES", default_level: Allow, desc: "structs where all fields share a prefix/postfix or contain the name of the struct", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITEMS_AFTER_STATEMENTS", default_level: Allow, desc: "blocks where an item comes after a statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NOT_RETURNING_ITERATOR", default_level: Allow, desc: "methods named `iter` or `iter_mut` that do not return an `Iterator`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INTO_ITER_WITHOUT_ITER", default_level: Allow, desc: "implementing `IntoIterator for (&|&mut) Type` without an inherent `iter(_mut)` method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_WITHOUT_INTO_ITER", default_level: Allow, desc: "implementing `iter(_mut)` without an associated `IntoIterator for (&|&mut) Type` impl", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_FUTURES", default_level: Allow, desc: "large future may lead to unexpected stack overflows", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_STACK_ARRAYS", default_level: Allow, desc: "allocating large arrays on stack may cause stack overflow", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ELIDABLE_LIFETIME_NAMES", default_level: Allow, desc: "lifetime name that can be replaced with the anonymous lifetime", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_DIGIT_GROUPS", default_level: Allow, desc: "grouping digits into groups that are too large", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNREADABLE_LITERAL", default_level: Allow, desc: "long literal without underscores", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPLICIT_INTO_ITER_LOOP", default_level: Allow, desc: "for-looping over `_.into_iter()` when `_` would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::EXPLICIT_ITER_LOOP", default_level: Allow, desc: "for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MACRO_USE_IMPORTS", default_level: Allow, desc: "#[macro_use] is no longer needed", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_ASSERT", default_level: Allow, desc: "`panic!` and only a `panic!` in `if`-then statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_POWER_OF_TWO", default_level: Allow, desc: "manually reimplementing `is_power_of_two`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_LET_ELSE", default_level: Allow, desc: "manual implementation of a let...else statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_STRING_NEW", default_level: Allow, desc: "empty String is being created manually", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_BOOL", default_level: Allow, desc: "a `match` on a boolean expression instead of an `if..else` block", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_SAME_ARMS", default_level: Allow, desc: "`match` with identical arm bodies", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_WILDCARD_FOR_SINGLE_VARIANTS", default_level: Allow, desc: "a wildcard enum match for a single variant", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_WILD_ERR_ARM", default_level: Allow, desc: "a `match` with `Err(_)` arm and take drastic actions", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_MATCH_ELSE", default_level: Allow, desc: "a `match` statement with two arms where the second arm's pattern is a placeholder instead of a specific match pattern", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS", default_level: Allow, desc: "Checks for calls to ends_with with case-sensitive file extensions", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::CLONED_INSTEAD_OF_COPIED", default_level: Allow, desc: "used `cloned` where `copied` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FILTER_MAP_NEXT", default_level: Allow, desc: "using combination of `filter_map` and `next` which can usually be written as a single method call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FLAT_MAP_OPTION", default_level: Allow, desc: "used `flat_map` where `filter_map` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FORMAT_COLLECT", default_level: Allow, desc: "`format!`ing every element in a collection, then collecting the strings into a new `String`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FROM_ITER_INSTEAD_OF_COLLECT", default_level: Allow, desc: "use `.collect()` instead of `::from_iter()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_CLONE", default_level: Allow, desc: "implicitly cloning a value by invoking a function on its dereferenced type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::INEFFICIENT_TO_STRING", default_level: Allow, desc: "using `to_string` on `&&T` where `T: ToString`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_FILTER_IS_OK", default_level: Allow, desc: "filtering an iterator over `Result`s for `Ok` can be achieved with `flatten`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ITER_FILTER_IS_SOME", default_level: Allow, desc: "filtering an iterator over `Option`s for `Some` can be achieved with `flatten`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_VARIANT_AND", default_level: Allow, desc: "using `.map(f).unwrap_or_default()`, which is more succinctly expressed as `is_some_and(f)` or `is_ok_and(f)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MAP_UNWRAP_OR", default_level: Allow, desc: "using `.map(f).unwrap_or(a)` or `.map(f).unwrap_or_else(func)`, which are more succinctly expressed as `map_or(a, f)` or `map_or_else(a, f)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NAIVE_BYTECOUNT", default_level: Allow, desc: "use of naive `.filter(|&x| x == y).count()` to count byte values", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::OPTION_AS_REF_CLONED", default_level: Allow, desc: "cloning an `Option` via `as_ref().cloned()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STABLE_SORT_PRIMITIVE", default_level: Allow, desc: "use of sort() when sort_unstable() is equivalent", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STR_SPLIT_AT_NEWLINE", default_level: Allow, desc: "splitting a trimmed string at hard-coded newlines", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_JOIN", default_level: Allow, desc: "using `.collect::>().join(\"\")` on an iterator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::USED_UNDERSCORE_BINDING", default_level: Allow, desc: "using a binding which is prefixed with an underscore", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::USED_UNDERSCORE_ITEMS", default_level: Allow, desc: "using a item which is prefixed with an underscore", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISMATCHING_TYPE_PARAM_ORDER", default_level: Allow, desc: "type parameter positioned inconsistently between type def and impl block", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_FIELDS_IN_DEBUG", default_level: Allow, desc: "missing fields in manual `Debug` implementation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MUT_MUT", default_level: Allow, desc: "usage of double-mut refs, e.g., `&mut &mut ...`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_CONTINUE", default_level: Allow, desc: "`continue` statements that can be replaced by a rearrangement of code", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_FOR_EACH", default_level: Allow, desc: "using `for_each` where a `for` loop would be simpler", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_PASS_BY_VALUE", default_level: Allow, desc: "functions taking arguments by value, but not consuming them in its body", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NO_EFFECT_UNDERSCORE_BINDING", default_level: Allow, desc: "binding to `_` prefixed variable with no side-effect", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NO_MANGLE_WITH_RUST_ABI", default_level: Allow, desc: "convert Rust ABI functions to C ABI", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANY_SINGLE_CHAR_NAMES", default_level: Allow, desc: "too many single character bindings", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SIMILAR_NAMES", default_level: Allow, desc: "similarly named items and bindings", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Allow, lint_id: None, src: CommandLine("clippy::similar_names", Allow) }, LintId { lint: Lint { name: "clippy::NON_STD_LAZY_STATICS", default_level: Allow, desc: "lazy static that could be replaced by `std::sync::LazyLock`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::FLOAT_CMP", default_level: Allow, desc: "using `==` or `!=` on float values instead of comparing difference with an allowed error", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_MIDPOINT", default_level: Allow, desc: "manual implementation of `midpoint` which can overflow", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_BITWISE_BOOL", default_level: Allow, desc: "Boolean expressions that use bitwise rather than lazy operators", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::VERBOSE_BIT_MASK", default_level: Allow, desc: "expressions where a bit mask is less readable than the corresponding method call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LARGE_TYPES_PASSED_BY_VALUE", default_level: Allow, desc: "functions taking large arguments by value", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::TRIVIALLY_COPY_PASS_BY_REF", default_level: Allow, desc: "functions taking small copyable arguments by reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::PUB_UNDERSCORE_FIELDS", default_level: Allow, desc: "struct field prefixed with underscore and marked public", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::RANGE_MINUS_ONE", default_level: Allow, desc: "`x..=(y-1)` reads better as `x..y`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::RANGE_PLUS_ONE", default_level: Allow, desc: "`x..(y+1)` reads better as `x..=y`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RAW_STRING_HASHES", default_level: Allow, desc: "suggests reducing the number of hashes around a raw string literal", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_ELSE", default_level: Allow, desc: "`else` branch that can be removed without changing semantics", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::REF_OPTION_REF", default_level: Allow, desc: "use `Option<&T>` instead of `&Option<&T>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::RETURN_SELF_NOT_MUST_USE", default_level: Allow, desc: "missing `#[must_use]` annotation on a method returning `Self`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SEMICOLON_IF_NOTHING_RETURNED", default_level: Allow, desc: "add a semicolon if nothing is returned", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_CHAR_PATTERN", default_level: Allow, desc: "using a single-character str where a char could be used, e.g., `_.split(\"x\")`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::STRING_ADD_ASSIGN", default_level: Allow, desc: "using `x = x + ..` where x is a `String` instead of `push_str()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::TRANSMUTE_PTR_TO_PTR", default_level: Allow, desc: "transmutes from a pointer to a pointer / a reference to a reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::LINKEDLIST", default_level: Allow, desc: "usage of LinkedList, usually a vector is faster, or a more specialized data structure like a `VecDeque`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::OPTION_OPTION", default_level: Allow, desc: "usage of `Option>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNICODE_NOT_NFC", default_level: Allow, desc: "using a Unicode literal not in NFC normal form (see [Unicode tr15](http://www.unicode.org/reports/tr15/) for further information)", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_BOX_RETURNS", default_level: Allow, desc: "Needlessly returning a Box", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_LITERAL_BOUND", default_level: Allow, desc: "detects &str that could be &'static str in function return types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_SEMICOLON", default_level: Allow, desc: "unnecessary semicolon after expression returning `()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_WRAPS", default_level: Allow, desc: "functions that only return `Ok` or `Some`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNNESTED_OR_PATTERNS", default_level: Allow, desc: "unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_ASYNC", default_level: Allow, desc: "finds async functions with no await statements", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_SELF", default_level: Allow, desc: "methods that contain a `self` argument but don't use it", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ENUM_GLOB_USE", default_level: Allow, desc: "use items that import all variants of an enum", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::WILDCARD_IMPORTS", default_level: Allow, desc: "lint `use _::*` statements", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "clippy::ZERO_SIZED_MAP_VALUES", default_level: Allow, desc: "usage of map with zero-sized value type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::pedantic", Warn) }, LintId { lint: Lint { name: "WARNINGS", default_level: Warn, desc: "mass-change the level for lints which produce warnings", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Deny, lint_id: None, src: CommandLine("warnings", Deny) }, LintId { lint: Lint { name: "UNSAFE_CODE", default_level: Allow, desc: "usage of `unsafe` code and other potentially unsound constructs", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: true } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("unsafe_code", Warn) }, LintId { lint: Lint { name: "BARE_TRAIT_OBJECTS", default_level: Warn, desc: "suggest using `dyn Trait` for trait objects", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: Some(FutureIncompatibleInfo { reference: "", reason: EditionError(Edition2021), explain_reason: true }), is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "UNUSED_EXTERN_CRATES", default_level: Allow, desc: "extern crates that are never used", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "ELLIPSIS_INCLUSIVE_RANGE_PATTERNS", default_level: Warn, desc: "`...` range patterns are deprecated", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: Some(FutureIncompatibleInfo { reference: "", reason: EditionError(Edition2021), explain_reason: true }), is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "ELIDED_LIFETIMES_IN_PATHS", default_level: Allow, desc: "hidden lifetime parameters in types are deprecated", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "EXPLICIT_OUTLIVES_REQUIREMENTS", default_level: Allow, desc: "outlives requirements can be inferred", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("rust_2018_idioms", Warn) }, LintId { lint: Lint { name: "clippy::ASSERTIONS_ON_CONSTANTS", default_level: Warn, desc: "`assert!(true)` / `assert!(false)` will be optimized out by the compiler, and should probably be replaced by a `panic!()` or `unreachable!()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MIXED_ATTRIBUTES_STYLE", default_level: Warn, desc: "item has both inner and outer attributes", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NON_MINIMAL_CFG", default_level: Warn, desc: "ensure that all `cfg(any())` and `cfg(all())` have more than one condition", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BLOCKS_IN_CONDITIONS", default_level: Warn, desc: "useless or complex blocks that can be eliminated in conditions", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BOOL_ASSERT_COMPARISON", default_level: Warn, desc: "Using a boolean as comparison value in an assert_* macro when there is no need", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BOX_DEFAULT", default_level: Warn, desc: "Using Box::new(T::default()) instead of Box::default()", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BYTE_CHAR_SLICES", default_level: Warn, desc: "hard to read byte char slice", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FN_TO_NUMERIC_CAST", default_level: Warn, desc: "casting a function pointer to a numeric type other than `usize`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FN_TO_NUMERIC_CAST_WITH_TRUNCATION", default_level: Warn, desc: "casting a function pointer to a numeric type not wide enough to store the address", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_DANGLING_PTR", default_level: Warn, desc: "casting small constant literals to pointers to create dangling pointers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ZERO_PTR", default_level: Warn, desc: "using `0 as *{const, mut} T`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COLLAPSIBLE_ELSE_IF", default_level: Warn, desc: "nested `else`-`if` expressions that can be collapsed (e.g., `else { if x { ... } }`)", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COLLAPSIBLE_IF", default_level: Warn, desc: "nested `if`s that can be collapsed (e.g., `if x { if y { ... } }`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IF_SAME_THEN_ELSE", default_level: Warn, desc: "`if` with the same `then` and `else` blocks", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FIELD_REASSIGN_WITH_DEFAULT", default_level: Warn, desc: "binding initialized with Default should have its fields set in the initializer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DEFAULT_INSTEAD_OF_ITER_EMPTY", default_level: Warn, desc: "check `std::iter::Empty::default()` and replace with `std::iter::empty()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_BORROW", default_level: Warn, desc: "taking a reference that is going to be automatically dereferenced", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_MACROS", default_level: Warn, desc: "use of a disallowed macro", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_METHODS", default_level: Warn, desc: "use of a disallowed method call", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_NAMES", default_level: Warn, desc: "usage of a disallowed/placeholder name", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DISALLOWED_TYPES", default_level: Warn, desc: "use of disallowed types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DOC_LAZY_CONTINUATION", default_level: Warn, desc: "require every line of a paragraph to be indented and marked", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DOC_OVERINDENTED_LIST_ITEMS", default_level: Warn, desc: "ensure list items are not overindented", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_SAFETY_DOC", default_level: Warn, desc: "`pub unsafe fn` without `# Safety` docs", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_DOCTEST_MAIN", default_level: Warn, desc: "presence of `fn main() {` in code examples", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_CLOSURE", default_level: Warn, desc: "redundant closures, i.e., `|a| foo(a)` (which can be written as just `foo`)", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::EXCESSIVE_PRECISION", default_level: Warn, desc: "excessive precision for float literal", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNINLINED_FORMAT_ARGS", default_level: Warn, desc: "using non-inlined variables in `format!` calls", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FROM_OVER_INTO", default_level: Warn, desc: "Warns on implementations of `Into<..>` to use `From<..>`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FROM_STR_RADIX_10", default_level: Warn, desc: "from_str_radix with radix 10", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DOUBLE_MUST_USE", default_level: Warn, desc: "`#[must_use]` attribute on a `#[must_use]`-returning function / method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MUST_USE_UNIT", default_level: Warn, desc: "`#[must_use]` attribute on a unit-returning function / method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::RESULT_UNIT_ERR", default_level: Warn, desc: "public function returning `Result` with an `Err` type of `()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_SATURATING_ADD", default_level: Warn, desc: "Perform saturating addition instead of implicitly checking max bound of data type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IMPLICIT_SATURATING_SUB", default_level: Warn, desc: "Perform saturating subtraction instead of implicitly checking lower bound of data type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INHERENT_TO_STRING", default_level: Warn, desc: "type implements inherent method `to_string()`, but should instead implement the `Display` trait", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INIT_NUMBERED_FIELDS", default_level: Warn, desc: "numbered fields in tuple struct initializer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ENUM_VARIANT_NAMES", default_level: Warn, desc: "enums where all variants share a prefix/postfix", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MODULE_INCEPTION", default_level: Warn, desc: "modules that have the same name as their parent module", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITEMS_AFTER_TEST_MODULE", default_level: Warn, desc: "An item was found after the testing module `tests`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITEMS_BEFORE_USE", default_level: Warn, desc: "checks if module level `use` statements precede all other items", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LEGACY_NUMERIC_CONSTANTS", default_level: Warn, desc: "checks for usage of legacy std numeric constants and methods", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COMPARISON_TO_EMPTY", default_level: Warn, desc: "checking `x == \"\"` or `x == []` (or similar) when `.is_empty()` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LEN_WITHOUT_IS_EMPTY", default_level: Warn, desc: "traits or impls with a public `len` method but no corresponding `is_empty` method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LEN_ZERO", default_level: Warn, desc: "checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` could be used instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INCONSISTENT_DIGIT_GROUPING", default_level: Warn, desc: "integer literals with digits grouped inconsistently", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNUSUAL_BYTE_GROUPINGS", default_level: Warn, desc: "binary or hex literals that aren't grouped by four", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FOR_KV_MAP", default_level: Warn, desc: "looping on a map using `iter` when `keys` or `values` would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_SLICE_FILL", default_level: Warn, desc: "manually filling a slice with a value", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_WHILE_LET_SOME", default_level: Warn, desc: "checking for emptiness of a `Vec` in the loop condition and popping an element in the body", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RANGE_LOOP", default_level: Warn, desc: "for-looping over a range of indices where an iterator over items would do", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SAME_ITEM_PUSH", default_level: Warn, desc: "the same item is pushed inside of a for loop", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_ENUMERATE_INDEX", default_level: Warn, desc: "using `.enumerate()` and immediately dropping the index", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WHILE_LET_ON_ITERATOR", default_level: Warn, desc: "using a `while let` loop instead of a for loop on an iterator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MAIN_RECURSION", default_level: Warn, desc: "recursion using the entrypoint", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_ASYNC_FN", default_level: Warn, desc: "manual implementations of `async` functions can be simplified using the dedicated syntax", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_BITS", default_level: Warn, desc: "manual implementation of `size_of::() * 8` can be simplified with `T::BITS`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_FINITE", default_level: Warn, desc: "use dedicated method to check if a float is finite", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_INFINITE", default_level: Warn, desc: "use dedicated method to check if a float is infinite", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_IS_ASCII_CHECK", default_level: Warn, desc: "use dedicated method to check ascii range", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_NON_EXHAUSTIVE", default_level: Warn, desc: "manual implementations of the non-exhaustive pattern can be simplified using #[non_exhaustive]", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_ROTATE", default_level: Warn, desc: "using bit shifts to rotate integers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_RESULT_OK", default_level: Warn, desc: "usage of `ok()` in `let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::COLLAPSIBLE_MATCH", default_level: Warn, desc: "Nested `match` or `if let` expressions where the patterns may be \"collapsed\" together.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INFALLIBLE_DESTRUCTURING_MATCH", default_level: Warn, desc: "a `match` statement with a single infallible arm instead of a `let`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_MAP", default_level: Warn, desc: "reimplementation of `map`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_LIKE_MATCHES_MACRO", default_level: Warn, desc: "a match that could be written with the matches! macro", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_OVERLAPPING_ARM", default_level: Warn, desc: "a `match` with overlapping arms", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MATCH_REF_PATS", default_level: Warn, desc: "a `match` or `if let` with all arms prefixed with `&` instead of deref-ing the match expression", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_PATTERN_MATCHING", default_level: Warn, desc: "use the proper utility function avoiding an `if let`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_MATCH", default_level: Warn, desc: "a `match` statement with a single nontrivial arm (i.e., where the other arm is `_ => {}`) instead of `if let`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MEM_REPLACE_OPTION_WITH_NONE", default_level: Warn, desc: "replacing an `Option` with `None` instead of `take()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MEM_REPLACE_OPTION_WITH_SOME", default_level: Warn, desc: "replacing an `Option` with `Some` instead of `replace()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MEM_REPLACE_WITH_DEFAULT", default_level: Warn, desc: "replacing a value of type `T` with `T::default()` instead of using `std::mem::take`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BYTES_NTH", default_level: Warn, desc: "replace `.bytes().nth()` with `.as_bytes().get()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::CHARS_LAST_CMP", default_level: Warn, desc: "using `.chars().last()` or `.chars().next_back()` to check if a string ends with a char", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::CHARS_NEXT_CMP", default_level: Warn, desc: "using `.chars().next()` to check if a string starts with a char", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ERR_EXPECT", default_level: Warn, desc: "using `.err().expect(\"\")` when `.expect_err(\"\")` can be used", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::FILTER_MAP_BOOL_THEN", default_level: Warn, desc: "checks for usage of `bool::then` in `Iterator::filter_map`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::GET_FIRST", default_level: Warn, desc: "Using `x.get(0)` when `x.first()` or `x.front()` is simpler", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::INTO_ITER_ON_REF", default_level: Warn, desc: "using `.into_iter()` on a reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IO_OTHER_ERROR", default_level: Warn, desc: "calling `std::io::Error::new(std::io::ErrorKind::Other, _)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::IS_DIGIT_ASCII_RADIX", default_level: Warn, desc: "use of `char::is_digit(..)` with literal radix of 10 or 16", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_CLONED_COLLECT", default_level: Warn, desc: "using `.cloned().collect()` on slice to create a `Vec`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NEXT_SLICE", default_level: Warn, desc: "using `.iter().next()` on a sliced array, which can be shortened to just `.get()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NTH", default_level: Warn, desc: "using `.iter().nth()` on a standard library type with O(1) element access", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_NTH_ZERO", default_level: Warn, desc: "replace `iter.nth(0)` with `iter.next()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ITER_SKIP_NEXT", default_level: Warn, desc: "using `.skip(x).next()` on an iterator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_NEXT_BACK", default_level: Warn, desc: "manual reverse iteration of `DoubleEndedIterator`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_OK_OR", default_level: Warn, desc: "finds patterns that can be encoded more concisely with `Option::ok_or`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_REPEAT_N", default_level: Warn, desc: "detect `repeat().take()` that can be replaced with `repeat_n()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_SATURATING_ARITHMETIC", default_level: Warn, desc: "`.checked_add/sub(x).unwrap_or(MAX/MIN)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MAP_CLONE", default_level: Warn, desc: "using `iterator.map(|x| x.clone())`, or dereferencing closures for `Copy` types", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MAP_COLLECT_RESULT_UNIT", default_level: Warn, desc: "using `.map(_).collect::()`, which can be replaced with `try_for_each`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MUT_MUTEX_LOCK", default_level: Warn, desc: "`&mut Mutex::lock` does unnecessary locking", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEW_RET_NO_SELF", default_level: Warn, desc: "not returning type containing `Self` in a `new` method", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OBFUSCATED_IF_ELSE", default_level: Warn, desc: "use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OK_EXPECT", default_level: Warn, desc: "using `ok().expect()`, which gives worse error messages than calling `expect` directly on the Result", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OPTION_MAP_OR_NONE", default_level: Warn, desc: "using `Option.map_or(None, f)`, which is more succinctly expressed as `and_then(f)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::RESULT_MAP_OR_INTO_OPTION", default_level: Warn, desc: "using `Result.map_or(None, Some)`, which is more succinctly expressed as `ok()`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SHOULD_IMPLEMENT_TRAIT", default_level: Warn, desc: "defining a method that should be implementing a std trait", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_CHAR_ADD_STR", default_level: Warn, desc: "`push_str()` or `insert_str()` used with a single-character string literal as parameter", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::STRING_EXTEND_CHARS", default_level: Warn, desc: "using `x.extend(s.chars())` where s is a `&str` or `String`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_FALLIBLE_CONVERSIONS", default_level: Warn, desc: "calling the `try_from` and `try_into` trait methods when `From`/`Into` is implemented", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_FOLD", default_level: Warn, desc: "using `fold` when a more succinct alternative exists", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_LAZY_EVALUATIONS", default_level: Warn, desc: "using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_MAP_OR", default_level: Warn, desc: "reduce unnecessary calls to `.map_or(bool, …)`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNWRAP_OR_DEFAULT", default_level: Warn, desc: "using `.unwrap_or`, etc. with an argument that constructs a default value", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRONG_SELF_CONVENTION", default_level: Warn, desc: "defining a method named with an established prefix (like \"into_\") that takes `self` with the wrong convention", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TOPLEVEL_REF_ARG", default_level: Warn, desc: "an entire binding declared as `ref`, in a function argument or a `let` statement", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BUILTIN_TYPE_SHADOW", default_level: Warn, desc: "shadowing a builtin type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DUPLICATE_UNDERSCORE_ARGUMENT", default_level: Warn, desc: "function arguments having names which only differ by an underscore", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MIXED_CASE_HEX_LITERALS", default_level: Warn, desc: "hex literals whose letter digits are not consistently upper- or lowercased", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_PATTERN", default_level: Warn, desc: "using `name @ _` in a pattern", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MISSING_ENFORCED_IMPORT_RENAMES", default_level: Warn, desc: "enforce import renames", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_MUT_PASSED", default_level: Warn, desc: "an argument passed as a mutable reference although the callee only demands an immutable reference", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_BORROWS_FOR_GENERIC_ARGS", default_level: Warn, desc: "taking a reference that is going to be automatically dereferenced", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_ELSE", default_level: Warn, desc: "empty else branch", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_LATE_INIT", default_level: Warn, desc: "late initializations that can be replaced by a `let` statement with an initializer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_PARENS_ON_RANGE_LITERALS", default_level: Warn, desc: "needless parenthesis on range literals can be removed", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEG_MULTIPLY", default_level: Warn, desc: "multiplying integers by `-1`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEW_WITHOUT_DEFAULT", default_level: Warn, desc: "`pub fn new() -> Self` method without `Default` implementation", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::BORROW_INTERIOR_MUTABLE_CONST", default_level: Warn, desc: "referencing `const` with interior mutability", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DECLARE_INTERIOR_MUTABLE_CONST", default_level: Warn, desc: "declaring `const` with interior mutability", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::JUST_UNDERSCORES_AND_DIGITS", default_level: Warn, desc: "unclear name", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::ASSIGN_OP_PATTERN", default_level: Warn, desc: "assigning the result of an operation on a variable to that same variable", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OP_REF", default_level: Warn, desc: "taking a reference to satisfy the type constraints on `==`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PARTIALEQ_TO_NONE", default_level: Warn, desc: "Binary comparison to `Option::None` relies on `T: PartialEq`, which is unneeded", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::CMP_NULL", default_level: Warn, desc: "comparing a pointer to a null pointer, suggesting to use `.is_null()` instead", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PTR_ARG", default_level: Warn, desc: "fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PTR_EQ", default_level: Warn, desc: "use `std::ptr::eq` when comparing raw pointers", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::QUESTION_MARK", default_level: Warn, desc: "checks for expressions that could be replaced by the `?` operator", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_RANGE_CONTAINS", default_level: Warn, desc: "manually reimplementing {`Range`, `RangeInclusive`}`::contains`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_FIELD_NAMES", default_level: Warn, desc: "checks for fields in struct literals where shorthands could be used", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::REDUNDANT_STATIC_LIFETIMES", default_level: Warn, desc: "Using explicit `'static` lifetime for constants or statics when elision rules would allow omitting them.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LET_AND_RETURN", default_level: Warn, desc: "creating a let-binding and then immediately returning it like `let x = expr; x` at the end of a block", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RETURN", default_level: Warn, desc: "using a return statement like `return expr;` where an expression would suffice", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_RETURN_WITH_QUESTION_MARK", default_level: Warn, desc: "using a return statement like `return Err(expr)?;` where removing it would suffice", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SELF_NAMED_CONSTRUCTORS", default_level: Warn, desc: "method should not have the same name as the type it is implemented for", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::SINGLE_COMPONENT_PATH_IMPORTS", default_level: Warn, desc: "imports with single component path are redundant", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::MANUAL_PATTERN_CHAR_COMPARISON", default_level: Warn, desc: "manual char comparison in string patterns", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TRIM_SPLIT_WHITESPACE", default_level: Warn, desc: "using `str::trim()` or alike before `str::split_whitespace`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TABS_IN_DOC_COMMENTS", default_level: Warn, desc: "using tabs in doc comments is not recommended", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TO_DIGIT_IS_SOME", default_level: Warn, desc: "`char.is_digit()` is clearer", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::TO_STRING_TRAIT_IMPL", default_level: Warn, desc: "check for direct implementations of `ToString`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::OWNED_COW", default_level: Warn, desc: "needlessly owned Cow type", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::LET_UNIT_VALUE", default_level: Warn, desc: "creating a `let` binding to a value of unit type, which usually can't be used afterwards", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNECESSARY_OWNED_EMPTY_STRINGS", default_level: Warn, desc: "detects cases of references to owned empty strings being passed as an argument to a function expecting `&str`", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNNEEDED_STRUCT_PATTERN", default_level: Warn, desc: "using struct pattern to match against unit variant", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNSAFE_REMOVED_FROM_NAME", default_level: Warn, desc: "`unsafe` removed from API names on import", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UNUSED_UNIT", default_level: Warn, desc: "needless unit expression", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::UPPER_CASE_ACRONYMS", default_level: Warn, desc: "capitalized acronyms are against the naming convention", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::NEEDLESS_PUB_SELF", default_level: Warn, desc: "checks for usage of `pub(self)` and `pub(in self)`.", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PRINTLN_EMPTY_STRING", default_level: Warn, desc: "using `println!(\"\")` with an empty string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PRINT_LITERAL", default_level: Warn, desc: "printing a literal with a format string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::PRINT_WITH_NEWLINE", default_level: Warn, desc: "using `print!()` with a format string that ends in a single newline", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRITELN_EMPTY_STRING", default_level: Warn, desc: "using `writeln!(buf, \"\")` with an empty string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRITE_LITERAL", default_level: Warn, desc: "writing a literal with a format string", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::WRITE_WITH_NEWLINE", default_level: Warn, desc: "using `write!()` with a format string that ends in a single newline", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::style", Warn) }, LintId { lint: Lint { name: "clippy::DBG_MACRO", default_level: Allow, desc: "`dbg!` macro is intended as a debugging tool", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Warn, lint_id: None, src: CommandLine("clippy::dbg_macro", Warn) }}} } -stack backtrace: - 0: 0x7f0174558c93 - ::fmt::h2f02338d4ae6d8b0 - 1: 0x7f0174c05987 - core::fmt::write::h5e77c22335cabc7f - 2: 0x7f0175cbf611 - std::io::Write::write_fmt::hccf7b69d0b3d44cc - 3: 0x7f0174558af2 - std::sys::backtrace::BacktraceLock::print::hb22254026b13323e - 4: 0x7f017455c6ea - std::panicking::default_hook::{{closure}}::h15ac4e3ee7801be5 - 5: 0x7f017455c26f - std::panicking::default_hook::h15db2a3343942a16 - 6: 0x7f017358ba03 - std[7cad246a9e76d988]::panicking::update_hook::>::{closure#0} - 7: 0x7f017455cf63 - std::panicking::rust_panic_with_hook::h67f3fa85499b6cf9 - 8: 0x7f017455cc5a - std::panicking::begin_panic_handler::{{closure}}::h40a30e994b26720e - 9: 0x7f0174559169 - std::sys::backtrace::__rust_end_short_backtrace::hb5bcb2f6ea295c8b - 10: 0x7f017455c91d - __rustc[bf3627c2b8b7eae9]::rust_begin_unwind - 11: 0x7f0170e874e0 - core::panicking::panic_fmt::h20722ae9d0312a90 - 12: 0x7f0173ba6579 - rustc_query_system[341f49cf1150f7a3]::query::plumbing::incremental_verify_ich_failed:: - 13: 0x7f01750892d1 - rustc_query_system[341f49cf1150f7a3]::query::plumbing::try_execute_query::, rustc_query_system[341f49cf1150f7a3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[c116a7b28af8393]::plumbing::QueryCtxt, true> - 14: 0x7f01750873c3 - rustc_query_impl[c116a7b28af8393]::query_impl::shallow_lint_levels_on::get_query_incr::__rust_end_short_backtrace - 15: 0x7f0175082fb7 - rustc_lint[1b5bb4c8a5faf0b4]::levels::lints_that_dont_need_to_run - 16: 0x7f0175a02a62 - rustc_query_impl[c116a7b28af8393]::plumbing::__rust_begin_short_backtrace::> - 17: 0x7f0175b1064c - rustc_query_system[341f49cf1150f7a3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[c116a7b28af8393]::plumbing::QueryCtxt, true> - 18: 0x7f0176019af1 - rustc_query_impl[c116a7b28af8393]::query_impl::lints_that_dont_need_to_run::get_query_incr::__rust_end_short_backtrace - 19: 0x7f0175bad365 - rustc_lint[1b5bb4c8a5faf0b4]::late::check_crate::{closure#0} - 20: 0x7f0175bad889 - rustc_lint[1b5bb4c8a5faf0b4]::late::check_crate - 21: 0x7f0175babb9f - rustc_interface[2a1066e4df123d40]::passes::analysis - 22: 0x7f0175bab975 - rustc_query_impl[c116a7b28af8393]::plumbing::__rust_begin_short_backtrace::> - 23: 0x7f0175ba6584 - rustc_query_system[341f49cf1150f7a3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[c116a7b28af8393]::plumbing::QueryCtxt, true> - 24: 0x7f0175ba5ea8 - rustc_query_impl[c116a7b28af8393]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace - 25: 0x7f0175e149c7 - rustc_interface[2a1066e4df123d40]::passes::create_and_enter_global_ctxt::, rustc_driver_impl[817478e824aa827]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0} - 26: 0x7f0175d01ea6 - rustc_interface[2a1066e4df123d40]::interface::run_compiler::<(), rustc_driver_impl[817478e824aa827]::run_compiler::{closure#0}>::{closure#1} - 27: 0x7f0175cb62be - std[7cad246a9e76d988]::sys::backtrace::__rust_begin_short_backtrace::::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> - 28: 0x7f0175cb672b - <::spawn_unchecked_::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[ee896a018689144d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} - 29: 0x7f0175cb7b2b - std::sys::pal::unix::thread::Thread::new::thread_start::h211a36f354245501 - 30: 0x7f016faa57eb - - 31: 0x7f016fb2918c - - 32: 0x0 - - -error: the compiler unexpectedly panicked. this is a bug. - -note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml - -note: please make sure that you have updated to the latest nightly - -note: rustc 1.89.0-nightly (414482f6a 2025-05-13) running on x86_64-unknown-linux-gnu - -note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED] -Z binary-dep-depinfo - -note: some of the compiler flags provided by cargo are hidden - -query stack during panic: -#0 [shallow_lint_levels_on] looking up lint levels for `` -#1 [lints_that_dont_need_to_run] Computing all lints that are explicitly enabled or with a default level greater than Allow -... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack -note: Clippy version: clippy 0.1.89 (d44e35d595 2025-05-19) - -error: could not compile `pass` (lib) due to 1 previous error diff --git a/tests/ui/doc_suspicious_footnotes.fixed b/tests/ui/doc_suspicious_footnotes.fixed index 9ed3fd4ef31c..2cce4b575ffa 100644 --- a/tests/ui/doc_suspicious_footnotes.fixed +++ b/tests/ui/doc_suspicious_footnotes.fixed @@ -1,5 +1,5 @@ #![warn(clippy::doc_suspicious_footnotes)] -#![allow(clippy::needless_raw_string_hashes)] +#![allow(clippy::needless_raw_string_hashes, clippy::items_before_use)] //! This is not a footnote[^1]. //! //! [^1]: diff --git a/tests/ui/doc_suspicious_footnotes.rs b/tests/ui/doc_suspicious_footnotes.rs index 9a8d0dcf4754..7f578dab2e38 100644 --- a/tests/ui/doc_suspicious_footnotes.rs +++ b/tests/ui/doc_suspicious_footnotes.rs @@ -1,5 +1,5 @@ #![warn(clippy::doc_suspicious_footnotes)] -#![allow(clippy::needless_raw_string_hashes)] +#![allow(clippy::needless_raw_string_hashes, clippy::items_before_use)] //! This is not a footnote[^1]. //~^ doc_suspicious_footnotes //! From b7a1fcb77b55e46e0a2213841f72910b84507dd3 Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Fri, 6 Jun 2025 02:16:13 +0530 Subject: [PATCH 3/7] Tweaks: Changes needed to pass `cargo test` locally --- CHANGELOG.md | 1 + book/src/lint_configuration.md | 10 +++++++++ clippy_config/src/conf.rs | 6 +++--- clippy_lints/src/booleans.rs | 1 + clippy_lints/src/infinite_iter.rs | 1 + clippy_lints/src/items_before_use.rs | 2 +- clippy_lints/src/lib.rs | 3 ++- tests/ui/infinite_iter.rs | 6 +++++- tests/ui/infinite_iter.stderr | 32 ++++++++++++++-------------- 9 files changed, 40 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b84f24acade4..81bcfa21e02c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6556,6 +6556,7 @@ Released 2018-09-13 [`source-item-ordering`]: https://doc.rust-lang.org/clippy/lint_configuration.html#source-item-ordering [`stack-size-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#stack-size-threshold [`standard-macro-braces`]: https://doc.rust-lang.org/clippy/lint_configuration.html#standard-macro-braces +[`strict-order-of-use`]: https://doc.rust-lang.org/clippy/lint_configuration.html#strict-order-of-use [`struct-field-name-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#struct-field-name-threshold [`suppress-restriction-lint-in-const`]: https://doc.rust-lang.org/clippy/lint_configuration.html#suppress-restriction-lint-in-const [`too-large-for-stack`]: https://doc.rust-lang.org/clippy/lint_configuration.html#too-large-for-stack diff --git a/book/src/lint_configuration.md b/book/src/lint_configuration.md index 7c850b4b023a..5b739fb10b1d 100644 --- a/book/src/lint_configuration.md +++ b/book/src/lint_configuration.md @@ -957,6 +957,16 @@ could be used with a full path two `MacroMatcher`s have to be added one with the * [`nonstandard_macro_braces`](https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces) +## `strict-order-of-use` +Makes the lint strict, use statements must precede mod and extern crate statements too. (Stylistic Choice) + +**Default Value:** `false` + +--- +**Affected lints:** +* [`items_before_use`](https://rust-lang.github.io/rust-clippy/master/index.html#items_before_use) + + ## `struct-field-name-threshold` The minimum number of struct fields for the lints about field names to trigger diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index a195ba19fecb..c9a178ad8a14 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -804,6 +804,9 @@ define_Conf! { /// `crate_name::macro_name` and one with just the macro name. #[lints(nonstandard_macro_braces)] standard_macro_braces: Vec = Vec::new(), + /// Makes the lint strict, use statements must precede mod and extern crate statements too. (Stylistic Choice) + #[lints(items_before_use)] + strict_order_of_use: bool = false, /// The minimum number of struct fields for the lints about field names to trigger #[lints(struct_field_names)] struct_field_name_threshold: u64 = 3, @@ -856,9 +859,6 @@ define_Conf! { /// Whether to also emit warnings for unsafe blocks with metavariable expansions in **private** macros. #[lints(macro_metavars_in_unsafe)] warn_unsafe_macro_metavars_in_private_macros: bool = false, - /// Makes the lint strict, use statements must precede mod and extern crate statements too. (Stylistic Choice) - #[lints(items_before_use)] - strict_order_of_use: bool = false, } /// Search for the configuration file. diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs index bf43234ff50f..fa349c4dc1a5 100644 --- a/clippy_lints/src/booleans.rs +++ b/clippy_lints/src/booleans.rs @@ -1,3 +1,4 @@ +#![allow(clippy::items_before_use)] use clippy_config::Conf; use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_hir_and_then}; use clippy_utils::msrvs::{self, Msrv}; diff --git a/clippy_lints/src/infinite_iter.rs b/clippy_lints/src/infinite_iter.rs index bf3eafe09b3d..7837dd248640 100644 --- a/clippy_lints/src/infinite_iter.rs +++ b/clippy_lints/src/infinite_iter.rs @@ -1,3 +1,4 @@ +#![allow(clippy::items_before_use)] use clippy_utils::diagnostics::span_lint; use clippy_utils::ty::{get_type_diagnostic_name, implements_trait}; use clippy_utils::{higher, sym}; diff --git a/clippy_lints/src/items_before_use.rs b/clippy_lints/src/items_before_use.rs index d233e1ded7e6..692e1096edc5 100644 --- a/clippy_lints/src/items_before_use.rs +++ b/clippy_lints/src/items_before_use.rs @@ -1,7 +1,7 @@ use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_and_note; use clippy_utils::sym; -use rustc_hir::*; +use rustc_hir::{HirId, Item, ItemKind, Mod}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::impl_lint_pass; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 8a51b817be74..a48df4f19e4e 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -17,7 +17,8 @@ clippy::must_use_candidate, rustc::diagnostic_outside_of_impl, rustc::untranslatable_diagnostic, - clippy::literal_string_with_formatting_args + clippy::literal_string_with_formatting_args, + clippy::items_before_use )] #![warn( trivial_casts, diff --git a/tests/ui/infinite_iter.rs b/tests/ui/infinite_iter.rs index 002a791a6579..b6cc99215c3c 100644 --- a/tests/ui/infinite_iter.rs +++ b/tests/ui/infinite_iter.rs @@ -1,4 +1,8 @@ -#![allow(clippy::uninlined_format_args, clippy::double_ended_iterator_last)] +#![allow( + clippy::uninlined_format_args, + clippy::double_ended_iterator_last, + clippy::items_before_use +)] use std::iter::repeat; fn square_is_lower_64(x: &u32) -> bool { diff --git a/tests/ui/infinite_iter.stderr b/tests/ui/infinite_iter.stderr index 47133a2ea62e..453a8f0eb351 100644 --- a/tests/ui/infinite_iter.stderr +++ b/tests/ui/infinite_iter.stderr @@ -1,29 +1,29 @@ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:11:5 + --> tests/ui/infinite_iter.rs:15:5 | LL | repeat(0_u8).collect::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here - --> tests/ui/infinite_iter.rs:9:8 + --> tests/ui/infinite_iter.rs:13:8 | LL | #[deny(clippy::infinite_iter)] | ^^^^^^^^^^^^^^^^^^^^^ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:15:5 + --> tests/ui/infinite_iter.rs:19:5 | LL | (0..8_u32).take_while(square_is_lower_64).cycle().count(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:19:5 + --> tests/ui/infinite_iter.rs:23:5 | LL | (0..8_u64).chain(0..).max(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:28:5 + --> tests/ui/infinite_iter.rs:32:5 | LL | / (0..8_u32) LL | | @@ -34,37 +34,37 @@ LL | | .for_each(|x| println!("{}", x)); | |________________________________________^ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:37:5 + --> tests/ui/infinite_iter.rs:41:5 | LL | (0_usize..).flat_map(|x| 0..x).product::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:41:5 + --> tests/ui/infinite_iter.rs:45:5 | LL | (0_u64..).filter(|x| x % 2 == 0).last(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:53:5 + --> tests/ui/infinite_iter.rs:57:5 | LL | (0..).zip((0..).take_while(square_is_lower_64)).count(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here - --> tests/ui/infinite_iter.rs:50:8 + --> tests/ui/infinite_iter.rs:54:8 | LL | #[deny(clippy::maybe_infinite_iter)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:57:5 + --> tests/ui/infinite_iter.rs:61:5 | LL | repeat(42).take_while(|x| *x == 42).chain(0..42).max(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:61:5 + --> tests/ui/infinite_iter.rs:65:5 | LL | / (1..) LL | | @@ -76,31 +76,31 @@ LL | | .min(); | |______________^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:69:5 + --> tests/ui/infinite_iter.rs:73:5 | LL | (0..).find(|x| *x == 24); | ^^^^^^^^^^^^^^^^^^^^^^^^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:73:5 + --> tests/ui/infinite_iter.rs:77:5 | LL | (0..).position(|x| x == 24); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:77:5 + --> tests/ui/infinite_iter.rs:81:5 | LL | (0..).any(|x| x == 24); | ^^^^^^^^^^^^^^^^^^^^^^ error: possible infinite iteration detected - --> tests/ui/infinite_iter.rs:81:5 + --> tests/ui/infinite_iter.rs:85:5 | LL | (0..).all(|x| x == 24); | ^^^^^^^^^^^^^^^^^^^^^^ error: infinite iteration detected - --> tests/ui/infinite_iter.rs:107:31 + --> tests/ui/infinite_iter.rs:111:31 | LL | let _: HashSet = (0..).collect(); | ^^^^^^^^^^^^^^^ From a9550d5f78f1fc929f98eca17c823e1cc742b1c7 Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Fri, 6 Jun 2025 03:27:21 +0530 Subject: [PATCH 4/7] Added allow for interal file to pass `cargo test --features internal --- tests/ui-internal/check_clippy_version_attribute.rs | 1 + tests/ui-internal/check_clippy_version_attribute.stderr | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/ui-internal/check_clippy_version_attribute.rs b/tests/ui-internal/check_clippy_version_attribute.rs index 897002949e67..ea682a2bd520 100644 --- a/tests/ui-internal/check_clippy_version_attribute.rs +++ b/tests/ui-internal/check_clippy_version_attribute.rs @@ -1,5 +1,6 @@ #![feature(rustc_private)] #![deny(clippy::invalid_clippy_version_attribute, clippy::missing_clippy_version_attribute)] +#![allow(clippy::items_before_use)] #[macro_use] extern crate rustc_middle; diff --git a/tests/ui-internal/check_clippy_version_attribute.stderr b/tests/ui-internal/check_clippy_version_attribute.stderr index 952bc9440303..8929bb2b33a0 100644 --- a/tests/ui-internal/check_clippy_version_attribute.stderr +++ b/tests/ui-internal/check_clippy_version_attribute.stderr @@ -1,5 +1,5 @@ error: this item has an invalid `clippy::version` attribute - --> tests/ui-internal/check_clippy_version_attribute.rs:40:1 + --> tests/ui-internal/check_clippy_version_attribute.rs:41:1 | LL | / declare_tool_lint! { LL | | @@ -19,7 +19,7 @@ LL | #![deny(clippy::invalid_clippy_version_attribute, clippy::missing_clippy_ve = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info) error: this item has an invalid `clippy::version` attribute - --> tests/ui-internal/check_clippy_version_attribute.rs:49:1 + --> tests/ui-internal/check_clippy_version_attribute.rs:50:1 | LL | / declare_tool_lint! { LL | | @@ -34,7 +34,7 @@ LL | | } = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info) error: this lint is missing the `clippy::version` attribute or version value - --> tests/ui-internal/check_clippy_version_attribute.rs:61:1 + --> tests/ui-internal/check_clippy_version_attribute.rs:62:1 | LL | / declare_tool_lint! { LL | | @@ -54,7 +54,7 @@ LL | #![deny(clippy::invalid_clippy_version_attribute, clippy::missing_clippy_ve = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info) error: this lint is missing the `clippy::version` attribute or version value - --> tests/ui-internal/check_clippy_version_attribute.rs:70:1 + --> tests/ui-internal/check_clippy_version_attribute.rs:71:1 | LL | / declare_tool_lint! { LL | | From ea60f45b8e807feb1f353e0c8e36cc3244465a5a Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Fri, 6 Jun 2025 03:39:53 +0530 Subject: [PATCH 5/7] fixed doc errors regarding inline module and invalid extern crate call --- clippy_lints/src/items_before_use.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/clippy_lints/src/items_before_use.rs b/clippy_lints/src/items_before_use.rs index 692e1096edc5..b1957a5be25b 100644 --- a/clippy_lints/src/items_before_use.rs +++ b/clippy_lints/src/items_before_use.rs @@ -18,8 +18,10 @@ declare_clippy_lint! { /// /// ### Example /// ```no_run - /// mod my_module; - /// extern crate some_crate; + /// mod my_module { + /// fn rand() {} + /// }; + /// extern crate rustc_driver; /// /// fn foo() {} /// use std::collections::HashMap; @@ -29,8 +31,10 @@ declare_clippy_lint! { /// ``` /// Use instead: /// ```no_run - /// mod my_module; - /// extern crate some_crate; + /// mod my_module { + /// fn rand2() {} + /// }; + /// extern crate rustc_hir; /// use std::collections::HashMap; /// use std::vec::Vec; /// From d8b6c74eac6139783f2b485edf7f0da0835735ea Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Fri, 6 Jun 2025 03:54:57 +0530 Subject: [PATCH 6/7] changes for doctest... --- clippy_lints/src/items_before_use.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/clippy_lints/src/items_before_use.rs b/clippy_lints/src/items_before_use.rs index b1957a5be25b..76647cd1ac1a 100644 --- a/clippy_lints/src/items_before_use.rs +++ b/clippy_lints/src/items_before_use.rs @@ -1,3 +1,4 @@ +#![feature(rustc_private)] use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_and_note; use clippy_utils::sym; From a32d0d44a2168ec447a769d2e83a5d4807d25725 Mon Sep 17 00:00:00 2001 From: utkrsharmaa Date: Fri, 6 Jun 2025 03:59:52 +0530 Subject: [PATCH 7/7] removed extern crate from example --- clippy_lints/src/items_before_use.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/clippy_lints/src/items_before_use.rs b/clippy_lints/src/items_before_use.rs index 76647cd1ac1a..24e43143e75d 100644 --- a/clippy_lints/src/items_before_use.rs +++ b/clippy_lints/src/items_before_use.rs @@ -1,4 +1,3 @@ -#![feature(rustc_private)] use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_and_note; use clippy_utils::sym; @@ -22,7 +21,6 @@ declare_clippy_lint! { /// mod my_module { /// fn rand() {} /// }; - /// extern crate rustc_driver; /// /// fn foo() {} /// use std::collections::HashMap; @@ -35,7 +33,6 @@ declare_clippy_lint! { /// mod my_module { /// fn rand2() {} /// }; - /// extern crate rustc_hir; /// use std::collections::HashMap; /// use std::vec::Vec; ///