1 //! This file is managed by `cargo dev update_lints`. Do not edit.
3 use lazy_static::lazy_static;
8 pub use lint::LINT_LEVELS;
11 // begin lint list, do not remove this comment, it’s used in `update_lints`
12 pub static ref ALL_LINTS: Vec<Lint> = vec![
14 name: "absurd_extreme_comparisons",
16 desc: "a comparison with a maximum or minimum value that is always true or false",
21 name: "almost_swapped",
23 desc: "`foo = bar; bar = foo` sequence",
28 name: "approx_constant",
30 desc: "the approximate of a known float constant (in `std::fXX::consts`)",
32 module: "approx_const",
35 name: "as_conversions",
37 desc: "using a potentially dangerous silent `as` conversion",
39 module: "as_conversions",
42 name: "assertions_on_constants",
44 desc: "`assert!(true)` / `assert!(false)` will be optimized out by the compiler, and should probably be replaced by a `panic!()` or `unreachable!()`",
46 module: "assertions_on_constants",
49 name: "assign_op_pattern",
51 desc: "assigning the result of an operation on a variable to that same variable",
56 name: "await_holding_lock",
58 desc: "Inside an async function, holding a MutexGuard while calling await",
60 module: "await_holding_lock",
65 desc: "expressions of the form `_ & mask == select` that will only ever return `true` or `false`",
70 name: "bind_instead_of_map",
72 desc: "using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`",
77 name: "blacklisted_name",
79 desc: "usage of a blacklisted/placeholder name",
81 module: "blacklisted_name",
84 name: "blanket_clippy_restriction_lints",
86 desc: "enabling the complete restriction group",
91 name: "blocks_in_if_conditions",
93 desc: "useless or complex blocks that can be eliminated in conditions",
95 module: "blocks_in_if_conditions",
98 name: "bool_comparison",
100 desc: "comparing a variable to a boolean, e.g., `if x == true` or `if x != true`",
102 module: "needless_bool",
105 name: "borrow_interior_mutable_const",
106 group: "correctness",
107 desc: "referencing `const` with interior mutability",
109 module: "non_copy_const",
112 name: "borrowed_box",
114 desc: "a borrow of a boxed type",
121 desc: "usage of `Box<Vec<T>>`, vector elements are already on the heap",
128 desc: "using `Box<T>` where unnecessary",
133 name: "builtin_type_shadow",
135 desc: "shadowing a builtin type",
137 module: "misc_early",
140 name: "cargo_common_metadata",
142 desc: "common metadata is defined in `Cargo.toml`",
144 module: "cargo_common_metadata",
147 name: "cast_lossless",
149 desc: "casts using `as` that are known to be lossless, e.g., `x as u64` where `x: u8`",
154 name: "cast_possible_truncation",
156 desc: "casts that may cause truncation of the value, e.g., `x as u8` where `x: u32`, or `x as i32` where `x: f32`",
161 name: "cast_possible_wrap",
163 desc: "casts that may cause wrapping around the value, e.g., `x as i32` where `x: u32` and `x > i32::MAX`",
168 name: "cast_precision_loss",
170 desc: "casts that cause loss of precision, e.g., `x as f32` where `x: u64`",
175 name: "cast_ptr_alignment",
177 desc: "cast from a pointer to a more-strictly-aligned pointer",
182 name: "cast_ref_to_mut",
183 group: "correctness",
184 desc: "a cast of reference to a mutable pointer",
189 name: "cast_sign_loss",
191 desc: "casts from signed types to unsigned types, e.g., `x as u32` where `x: i32`",
196 name: "char_lit_as_u8",
198 desc: "casting a character literal to `u8` truncates",
203 name: "chars_last_cmp",
205 desc: "using `.chars().last()` or `.chars().next_back()` to check if a string ends with a char",
210 name: "chars_next_cmp",
212 desc: "using `.chars().next()` to check if a string starts with a char",
217 name: "checked_conversions",
219 desc: "`try_from` could replace manual bounds checking when casting",
221 module: "checked_conversions",
224 name: "clone_double_ref",
225 group: "correctness",
226 desc: "using `clone` on `&&T`",
231 name: "clone_on_copy",
233 desc: "using `clone` on a `Copy` type",
238 name: "clone_on_ref_ptr",
239 group: "restriction",
240 desc: "using \'clone\' on a ref-counted pointer",
246 group: "correctness",
247 desc: "comparisons to `NAN`, which will always return false, probably not intended",
254 desc: "comparing a pointer to a null pointer, suggesting to use `.is_null()` instead.",
261 desc: "creating owned instances for comparing with others, e.g., `x == \"foo\".to_string()`",
266 name: "cognitive_complexity",
268 desc: "functions that should be split up into multiple functions",
270 module: "cognitive_complexity",
273 name: "collapsible_if",
275 desc: "`if`s that can be collapsed (e.g., `if x { if y { ... } }` and `else { if x { ... } }`)",
277 module: "collapsible_if",
280 name: "comparison_chain",
282 desc: "`if`s that can be rewritten with `match` and `cmp`",
284 module: "comparison_chain",
287 name: "copy_iterator",
289 desc: "implementing `Iterator` on a `Copy` type",
291 module: "copy_iterator",
295 group: "restriction",
296 desc: "calling `std::fs::create_dir` instead of `std::fs::create_dir_all`",
298 module: "create_dir",
301 name: "crosspointer_transmute",
303 desc: "transmutes that have to or from types that are a pointer to the other",
309 group: "restriction",
310 desc: "`dbg!` macro is intended as a debugging tool",
315 name: "debug_assert_with_mut_call",
317 desc: "mutable arguments in `debug_assert{,_ne,_eq}!`",
319 module: "mutable_debug_assertion",
322 name: "decimal_literal_representation",
323 group: "restriction",
324 desc: "using decimal representation when hexadecimal would be better",
326 module: "literal_representation",
329 name: "declare_interior_mutable_const",
330 group: "correctness",
331 desc: "declaring `const` with interior mutability",
333 module: "non_copy_const",
336 name: "default_trait_access",
338 desc: "checks for literal calls to `Default::default()`",
340 module: "default_trait_access",
343 name: "deprecated_cfg_attr",
345 desc: "usage of `cfg_attr(rustfmt)` instead of tool attributes",
350 name: "deprecated_semver",
351 group: "correctness",
352 desc: "use of `#[deprecated(since = \"x\")]` where x is not semver",
357 name: "deref_addrof",
359 desc: "use of `*&` or `*&mut` in an expression",
364 name: "derive_hash_xor_eq",
365 group: "correctness",
366 desc: "deriving `Hash` but implementing `PartialEq` explicitly",
371 name: "derive_ord_xor_partial_ord",
372 group: "correctness",
373 desc: "deriving `Ord` but implementing `PartialOrd` explicitly",
378 name: "diverging_sub_expression",
380 desc: "whether an expression contains a diverging sub expression",
382 module: "eval_order_dependence",
385 name: "doc_markdown",
387 desc: "presence of `_`, `::` or camel-case outside backticks in documentation",
392 name: "double_comparisons",
394 desc: "unnecessary double comparisons that can be simplified",
396 module: "double_comparison",
399 name: "double_must_use",
401 desc: "`#[must_use]` attribute on a `#[must_use]`-returning function / method",
408 desc: "`--x`, which is a double negation of `x` and not a pre-decrement as in C/C++",
410 module: "misc_early",
413 name: "double_parens",
415 desc: "Warn on unnecessary double parentheses",
417 module: "double_parens",
421 group: "correctness",
422 desc: "bounds of the form `T: Drop` are useless",
424 module: "drop_bounds",
428 group: "correctness",
429 desc: "calls to `std::mem::drop` with a value that implements Copy",
431 module: "drop_forget_ref",
435 group: "correctness",
436 desc: "calls to `std::mem::drop` with a reference instead of an owned value",
438 module: "drop_forget_ref",
441 name: "duplicate_underscore_argument",
443 desc: "function arguments having names which only differ by an underscore",
445 module: "misc_early",
448 name: "duration_subsec",
450 desc: "checks for calculation of subsecond microseconds or milliseconds",
452 module: "duration_subsec",
455 name: "else_if_without_else",
456 group: "restriction",
457 desc: "`if` expression with an `else if`, but without a final `else` branch",
459 module: "else_if_without_else",
464 desc: "enum with no variants",
466 module: "empty_enum",
469 name: "empty_line_after_outer_attr",
471 desc: "empty line after outer attribute",
478 desc: "empty `loop {}`, which should block or sleep",
483 name: "enum_clike_unportable_variant",
484 group: "correctness",
485 desc: "C-like enums that are `repr(isize/usize)` and have values that don\'t fit into an `i32`",
487 module: "enum_clike",
490 name: "enum_glob_use",
492 desc: "use items that import all variants of an enum",
494 module: "wildcard_imports",
497 name: "enum_variant_names",
499 desc: "enums where all variants share a prefix/postfix",
501 module: "enum_variants",
505 group: "correctness",
506 desc: "equal operands on both sides of a comparison or bitwise combination (e.g., `x == x`)",
512 group: "correctness",
513 desc: "using erasing operations, e.g., `x * 0` or `y & 0`",
515 module: "erasing_op",
518 name: "eval_order_dependence",
520 desc: "whether a variable read occurs before a write depends on sub-expression evaluation order",
522 module: "eval_order_dependence",
525 name: "excessive_precision",
527 desc: "excessive precision for float literal",
529 module: "float_literal",
533 group: "restriction",
534 desc: "`std::process::exit` is called, terminating the program",
539 name: "expect_fun_call",
541 desc: "using any `expect` method with a function call",
547 group: "restriction",
548 desc: "using `.expect()` on `Result` or `Option`, which might be better handled",
553 name: "expl_impl_clone_on_copy",
555 desc: "implementing `Clone` explicitly on `Copy` types",
560 name: "explicit_counter_loop",
562 desc: "for-looping with an explicit counter when `_.enumerate()` would do",
567 name: "explicit_deref_methods",
569 desc: "Explicit use of deref or deref_mut method while not in a method chain.",
571 module: "dereference",
574 name: "explicit_into_iter_loop",
576 desc: "for-looping over `_.into_iter()` when `_` would do",
581 name: "explicit_iter_loop",
583 desc: "for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do",
588 name: "explicit_write",
590 desc: "using the `write!()` family of functions instead of the `print!()` family of functions, when using the latter would work",
592 module: "explicit_write",
595 name: "extra_unused_lifetimes",
597 desc: "unused lifetimes in function definitions",
602 name: "fallible_impl_from",
604 desc: "Warn on impls of `From<..>` that contain `panic!()` or `unwrap()`",
606 module: "fallible_impl_from",
609 name: "filetype_is_file",
610 group: "restriction",
611 desc: "`FileType::is_file` is not recommended to test for readable file type",
618 desc: "using combinations of `filter`, `map`, `filter_map` and `flat_map` which can usually be written as a single method call",
623 name: "filter_map_next",
625 desc: "using combination of `filter_map` and `next` which can usually be written as a single method call",
632 desc: "using `filter(p).next()`, which is more succinctly expressed as `.find(p)`",
639 desc: "using a combination of `find` and `map` can usually be written as a single method call",
644 name: "flat_map_identity",
646 desc: "call to `flat_map` where `flatten` is sufficient",
651 name: "float_arithmetic",
652 group: "restriction",
653 desc: "any floating-point arithmetic statement",
655 module: "arithmetic",
659 group: "correctness",
660 desc: "using `==` or `!=` on float values instead of comparing difference with an epsilon",
665 name: "float_cmp_const",
666 group: "restriction",
667 desc: "using `==` or `!=` on float constants instead of comparing difference with an epsilon",
672 name: "float_equality_without_abs",
673 group: "correctness",
674 desc: "float equality check without `.abs()`",
676 module: "float_equality_without_abs",
679 name: "fn_address_comparisons",
680 group: "correctness",
681 desc: "comparison with an address of a function item",
683 module: "unnamed_address",
686 name: "fn_params_excessive_bools",
688 desc: "using too many bools in function parameters",
690 module: "excessive_bools",
693 name: "fn_to_numeric_cast",
695 desc: "casting a function pointer to a numeric type other than usize",
700 name: "fn_to_numeric_cast_with_truncation",
702 desc: "casting a function pointer to a numeric type not wide enough to store the address",
709 desc: "looping on a map using `iter` when `keys` or `values` would do",
714 name: "for_loops_over_fallibles",
715 group: "correctness",
716 desc: "for-looping over an `Option` or a `Result`, which is more clearly expressed as an `if let`",
722 group: "correctness",
723 desc: "calls to `std::mem::forget` with a value that implements Copy",
725 module: "drop_forget_ref",
729 group: "correctness",
730 desc: "calls to `std::mem::forget` with a reference instead of an owned value",
732 module: "drop_forget_ref",
735 name: "future_not_send",
737 desc: "public Futures must be Send",
739 module: "future_not_send",
742 name: "get_last_with_len",
744 desc: "Using `x.get(x.len() - 1)` when `x.last()` is correct and simpler",
746 module: "get_last_with_len",
750 group: "restriction",
751 desc: "using `.get().unwrap()` or `.get_mut().unwrap()` when using `[]` would work instead",
758 desc: "using identity operations, e.g., `x + 0` or `y / 1`",
760 module: "identity_op",
763 name: "if_let_mutex",
764 group: "correctness",
765 desc: "locking a `Mutex` in an `if let` block can cause deadlocks",
767 module: "if_let_mutex",
770 name: "if_let_some_result",
772 desc: "usage of `ok()` in `if let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead",
774 module: "if_let_some_result",
779 desc: "`if` branches that could be swapped so no negation operation is necessary on the condition",
781 module: "if_not_else",
784 name: "if_same_then_else",
785 group: "correctness",
786 desc: "`if` with the same `then` and `else` blocks",
791 name: "ifs_same_cond",
792 group: "correctness",
793 desc: "consecutive `if`s with the same condition",
798 name: "implicit_hasher",
800 desc: "missing generalization over different hashers",
805 name: "implicit_return",
806 group: "restriction",
807 desc: "use a return statement like `return expr` instead of an expression",
809 module: "implicit_return",
812 name: "implicit_saturating_sub",
814 desc: "Perform saturating subtraction instead of implicitly checking lower bound of data type",
816 module: "implicit_saturating_sub",
819 name: "imprecise_flops",
821 desc: "usage of imprecise floating point operations",
823 module: "floating_point_arithmetic",
826 name: "inconsistent_digit_grouping",
828 desc: "integer literals with digits grouped inconsistently",
830 module: "literal_representation",
833 name: "indexing_slicing",
834 group: "restriction",
835 desc: "indexing/slicing usage",
837 module: "indexing_slicing",
840 name: "ineffective_bit_mask",
841 group: "correctness",
842 desc: "expressions where a bit mask will be rendered useless by a comparison, e.g., `(x | 1) > 2`",
847 name: "inefficient_to_string",
849 desc: "using `to_string` on `&&T` where `T: ToString`",
854 name: "infallible_destructuring_match",
856 desc: "a `match` statement with a single infallible arm instead of a `let`",
861 name: "infinite_iter",
862 group: "correctness",
863 desc: "infinite iteration",
865 module: "infinite_iter",
868 name: "inherent_to_string",
870 desc: "type implements inherent method `to_string()`, but should instead implement the `Display` trait",
872 module: "inherent_to_string",
875 name: "inherent_to_string_shadow_display",
876 group: "correctness",
877 desc: "type implements inherent method `to_string()`, which gets shadowed by the implementation of the `Display` trait",
879 module: "inherent_to_string",
882 name: "inline_always",
884 desc: "use of `#[inline(always)]`",
889 name: "inline_fn_without_body",
890 group: "correctness",
891 desc: "use of `#[inline]` on trait methods without bodies",
893 module: "inline_fn_without_body",
896 name: "int_plus_one",
898 desc: "instead of using `x >= y + 1`, use `x > y`",
900 module: "int_plus_one",
903 name: "integer_arithmetic",
904 group: "restriction",
905 desc: "any integer arithmetic expression which could overflow or panic",
907 module: "arithmetic",
910 name: "integer_division",
911 group: "restriction",
912 desc: "integer division may cause loss of precision",
914 module: "integer_division",
917 name: "into_iter_on_ref",
919 desc: "using `.into_iter()` on a reference",
924 name: "invalid_atomic_ordering",
925 group: "correctness",
926 desc: "usage of invalid atomic ordering in atomic loads/stores and memory fences",
928 module: "atomic_ordering",
931 name: "invalid_regex",
932 group: "correctness",
933 desc: "invalid regular expressions",
938 name: "invalid_upcast_comparisons",
940 desc: "a comparison involving an upcast which is always true or false",
945 name: "items_after_statements",
947 desc: "blocks where an item comes after a statement",
949 module: "items_after_statements",
952 name: "iter_cloned_collect",
954 desc: "using `.cloned().collect()` on slice to create a `Vec`",
959 name: "iter_next_loop",
960 group: "correctness",
961 desc: "for-looping over `_.next()` which is probably not intended",
966 name: "iter_next_slice",
968 desc: "using `.iter().next()` on a sliced array, which can be shortened to just `.get()`",
975 desc: "using `.iter().nth()` on a standard library type with O(1) element access",
980 name: "iter_nth_zero",
982 desc: "replace `iter.nth(0)` with `iter.next()`",
987 name: "iter_skip_next",
989 desc: "using `.skip(x).next()` on an iterator",
994 name: "iterator_step_by_zero",
995 group: "correctness",
996 desc: "using `Iterator::step_by(0)`, which will panic at runtime",
1001 name: "just_underscores_and_digits",
1003 desc: "unclear name",
1005 module: "non_expressive_names",
1008 name: "large_const_arrays",
1010 desc: "large non-scalar const array may cause performance overhead",
1012 module: "large_const_arrays",
1015 name: "large_digit_groups",
1017 desc: "grouping digits into groups that are too large",
1019 module: "literal_representation",
1022 name: "large_enum_variant",
1024 desc: "large size difference between variants on an enum",
1026 module: "large_enum_variant",
1029 name: "large_stack_arrays",
1031 desc: "allocating large arrays on stack may cause stack overflow",
1033 module: "large_stack_arrays",
1036 name: "len_without_is_empty",
1038 desc: "traits or impls with a public `len` method but no corresponding `is_empty` method",
1045 desc: "checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` could be used instead",
1050 name: "let_and_return",
1052 desc: "creating a let-binding and then immediately returning it like `let x = expr; x` at the end of a block",
1057 name: "let_underscore_lock",
1058 group: "correctness",
1059 desc: "non-binding let on a synchronization lock",
1061 module: "let_underscore",
1064 name: "let_underscore_must_use",
1065 group: "restriction",
1066 desc: "non-binding let on a `#[must_use]` expression",
1068 module: "let_underscore",
1071 name: "let_unit_value",
1073 desc: "creating a `let` binding to a value of unit type, which usually can\'t be used afterwards",
1080 desc: "usage of LinkedList, usually a vector is faster, or a more specialized data structure like a `VecDeque`",
1086 group: "correctness",
1087 desc: "boolean expressions that contain terminals which can be eliminated",
1092 name: "lossy_float_literal",
1093 group: "restriction",
1094 desc: "lossy whole number float literals",
1096 module: "float_literal",
1099 name: "macro_use_imports",
1101 desc: "#[macro_use] is no longer needed",
1103 module: "macro_use",
1106 name: "main_recursion",
1108 desc: "recursion using the entrypoint",
1110 module: "main_recursion",
1113 name: "manual_async_fn",
1115 desc: "manual implementations of `async` functions can be simplified using the dedicated syntax",
1117 module: "manual_async_fn",
1120 name: "manual_memcpy",
1122 desc: "manually copying items between slices",
1127 name: "manual_non_exhaustive",
1129 desc: "manual implementations of the non-exhaustive pattern can be simplified using #[non_exhaustive]",
1131 module: "manual_non_exhaustive",
1134 name: "manual_saturating_arithmetic",
1136 desc: "`.chcked_add/sub(x).unwrap_or(MAX/MIN)`",
1141 name: "manual_swap",
1142 group: "complexity",
1143 desc: "manual swap of two variables",
1148 name: "many_single_char_names",
1150 desc: "too many single character bindings",
1152 module: "non_expressive_names",
1157 desc: "using `iterator.map(|x| x.clone())`, or dereferencing closures for `Copy` types",
1159 module: "map_clone",
1164 desc: "use of `contains_key` followed by `insert` on a `HashMap` or `BTreeMap`",
1169 name: "map_flatten",
1171 desc: "using combinations of `flatten` and `map` which can usually be written as a single method call",
1176 name: "map_identity",
1177 group: "complexity",
1178 desc: "using iterator.map(|x| x)",
1180 module: "map_identity",
1183 name: "map_unwrap_or",
1185 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)`",
1190 name: "match_as_ref",
1191 group: "complexity",
1192 desc: "a `match` on an Option value instead of using `as_ref()` or `as_mut`",
1199 desc: "a `match` on a boolean expression instead of an `if..else` block",
1204 name: "match_like_matches_macro",
1206 desc: "a match that could be written with the matches! macro",
1211 name: "match_on_vec_items",
1213 desc: "matching on vector elements can panic",
1215 module: "match_on_vec_items",
1218 name: "match_overlapping_arm",
1220 desc: "a `match` with overlapping arms",
1225 name: "match_ref_pats",
1227 desc: "a `match` or `if let` with all arms prefixed with `&` instead of deref-ing the match expression",
1232 name: "match_same_arms",
1234 desc: "`match` with identical arm bodies",
1239 name: "match_single_binding",
1240 group: "complexity",
1241 desc: "a match with a single binding instead of using `let` statement",
1246 name: "match_wild_err_arm",
1248 desc: "a `match` with `Err(_)` arm and take drastic actions",
1253 name: "match_wildcard_for_single_variants",
1255 desc: "a wildcard enum match for a single variant",
1260 name: "maybe_infinite_iter",
1262 desc: "possible infinite iteration",
1264 module: "infinite_iter",
1267 name: "mem_discriminant_non_enum",
1268 group: "correctness",
1269 desc: "calling `mem::descriminant` on non-enum type",
1271 module: "mem_discriminant",
1275 group: "restriction",
1276 desc: "`mem::forget` usage on `Drop` types, likely to cause memory leaks",
1278 module: "mem_forget",
1281 name: "mem_replace_option_with_none",
1283 desc: "replacing an `Option` with `None` instead of `take()`",
1285 module: "mem_replace",
1288 name: "mem_replace_with_default",
1290 desc: "replacing a value of type `T` with `T::default()` instead of using `std::mem::take`",
1292 module: "mem_replace",
1295 name: "mem_replace_with_uninit",
1296 group: "correctness",
1297 desc: "`mem::replace(&mut _, mem::uninitialized())` or `mem::replace(&mut _, mem::zeroed())`",
1299 module: "mem_replace",
1303 group: "correctness",
1304 desc: "`min(_, max(_, _))` (or vice versa) with bounds clamping the result to a constant",
1309 name: "mismatched_target_os",
1310 group: "correctness",
1311 desc: "usage of `cfg(operating_system)` instead of `cfg(target_os = \"operating_system\")`",
1316 name: "misrefactored_assign_op",
1317 group: "complexity",
1318 desc: "having a variable on both sides of an assign op",
1320 module: "assign_ops",
1323 name: "missing_const_for_fn",
1325 desc: "Lint functions definitions that could be made `const fn`",
1327 module: "missing_const_for_fn",
1330 name: "missing_docs_in_private_items",
1331 group: "restriction",
1332 desc: "detects missing documentation for public and private members",
1334 module: "missing_doc",
1337 name: "missing_errors_doc",
1339 desc: "`pub fn` returns `Result` without `# Errors` in doc comment",
1344 name: "missing_inline_in_public_items",
1345 group: "restriction",
1346 desc: "detects missing `#[inline]` attribute for public callables (functions, trait methods, methods...)",
1348 module: "missing_inline",
1351 name: "missing_safety_doc",
1353 desc: "`pub unsafe fn` without `# Safety` docs",
1358 name: "mistyped_literal_suffixes",
1359 group: "correctness",
1360 desc: "mistyped literal suffix",
1362 module: "literal_representation",
1365 name: "mixed_case_hex_literals",
1367 desc: "hex literals whose letter digits are not consistently upper- or lowercased",
1369 module: "misc_early",
1372 name: "module_inception",
1374 desc: "modules that have the same name as their parent module",
1376 module: "enum_variants",
1379 name: "module_name_repetitions",
1381 desc: "type names prefixed/postfixed with their containing module\'s name",
1383 module: "enum_variants",
1386 name: "modulo_arithmetic",
1387 group: "restriction",
1388 desc: "any modulo arithmetic statement",
1390 module: "modulo_arithmetic",
1394 group: "correctness",
1395 desc: "taking a number modulo 1, which always returns 0",
1400 name: "multiple_crate_versions",
1402 desc: "multiple versions of the same crate being used",
1404 module: "multiple_crate_versions",
1407 name: "multiple_inherent_impl",
1408 group: "restriction",
1409 desc: "Multiple inherent impl that could be grouped",
1411 module: "inherent_impl",
1414 name: "must_use_candidate",
1416 desc: "function or method that could take a `#[must_use]` attribute",
1418 module: "functions",
1421 name: "must_use_unit",
1423 desc: "`#[must_use]` attribute on a unit-returning function / method",
1425 module: "functions",
1428 name: "mut_from_ref",
1429 group: "correctness",
1430 desc: "fns that create mutable refs from immutable ref args",
1437 desc: "usage of double-mut refs, e.g., `&mut &mut ...`",
1442 name: "mut_range_bound",
1443 group: "complexity",
1444 desc: "for loop over a range where one of the bounds is a mutable variable",
1449 name: "mutable_key_type",
1450 group: "correctness",
1451 desc: "Check for mutable `Map`/`Set` key type",
1456 name: "mutex_atomic",
1458 desc: "using a mutex where an atomic value could be used instead",
1460 module: "mutex_atomic",
1463 name: "mutex_integer",
1465 desc: "using a mutex for an integer type",
1467 module: "mutex_atomic",
1470 name: "naive_bytecount",
1472 desc: "use of naive `<slice>.filter(|&x| x == y).count()` to count byte values",
1474 module: "bytecount",
1477 name: "needless_arbitrary_self_type",
1478 group: "complexity",
1479 desc: "type of `self` parameter is already by default `Self`",
1481 module: "needless_arbitrary_self_type",
1484 name: "needless_bool",
1485 group: "complexity",
1486 desc: "if-statements with plain booleans in the then- and else-clause, e.g., `if p { true } else { false }`",
1488 module: "needless_bool",
1491 name: "needless_borrow",
1493 desc: "taking a reference that is going to be automatically dereferenced",
1495 module: "needless_borrow",
1498 name: "needless_borrowed_reference",
1499 group: "complexity",
1500 desc: "taking a needless borrowed reference",
1502 module: "needless_borrowed_ref",
1505 name: "needless_collect",
1507 desc: "collecting an iterator when collect is not needed",
1512 name: "needless_continue",
1514 desc: "`continue` statements that can be replaced by a rearrangement of code",
1516 module: "needless_continue",
1519 name: "needless_doctest_main",
1521 desc: "presence of `fn main() {` in code examples",
1526 name: "needless_lifetimes",
1527 group: "complexity",
1528 desc: "using explicit lifetimes for references in function arguments when elision rules would allow omitting them",
1530 module: "lifetimes",
1533 name: "needless_pass_by_value",
1535 desc: "functions taking arguments by value, but not consuming them in its body",
1537 module: "needless_pass_by_value",
1540 name: "needless_range_loop",
1542 desc: "for-looping over a range of indices where an iterator over items would do",
1547 name: "needless_return",
1549 desc: "using a return statement like `return expr;` where an expression would suffice",
1554 name: "needless_update",
1555 group: "complexity",
1556 desc: "using `Foo { ..base }` when there are no missing fields",
1558 module: "needless_update",
1561 name: "neg_cmp_op_on_partial_ord",
1562 group: "complexity",
1563 desc: "The use of negated comparison operators on partially ordered types may produce confusing code.",
1565 module: "neg_cmp_op_on_partial_ord",
1568 name: "neg_multiply",
1570 desc: "multiplying integers with `-1`",
1572 module: "neg_multiply",
1576 group: "correctness",
1577 desc: "any loop that will always `break` or `return`",
1582 name: "new_ret_no_self",
1584 desc: "not returning type containing `Self` in a `new` method",
1589 name: "new_without_default",
1591 desc: "`fn new() -> Self` method without `Default` implementation",
1593 module: "new_without_default",
1597 group: "complexity",
1598 desc: "statements with no effect",
1600 module: "no_effect",
1603 name: "non_ascii_literal",
1605 desc: "using any literal non-ASCII chars in a string literal instead of using the `\\\\u` escape",
1610 name: "nonminimal_bool",
1611 group: "complexity",
1612 desc: "boolean expressions that can be written more concisely",
1617 name: "nonsensical_open_options",
1618 group: "correctness",
1619 desc: "nonsensical combination of options for opening a file",
1621 module: "open_options",
1624 name: "not_unsafe_ptr_arg_deref",
1625 group: "correctness",
1626 desc: "public functions dereferencing raw pointer arguments but not marked `unsafe`",
1628 module: "functions",
1633 desc: "using `ok().expect()`, which gives worse error messages than calling `expect` directly on the Result",
1640 desc: "taking a reference to satisfy the type constraints on `==`",
1645 name: "option_as_ref_deref",
1646 group: "complexity",
1647 desc: "using `as_ref().map(Deref::deref)`, which is more succinctly expressed as `as_deref()`",
1652 name: "option_env_unwrap",
1653 group: "correctness",
1654 desc: "using `option_env!(...).unwrap()` to get environment variable",
1656 module: "option_env_unwrap",
1659 name: "option_if_let_else",
1661 desc: "reimplementation of Option::map_or",
1663 module: "option_if_let_else",
1666 name: "option_map_or_none",
1668 desc: "using `Option.map_or(None, f)`, which is more succinctly expressed as `and_then(f)`",
1673 name: "option_map_unit_fn",
1674 group: "complexity",
1675 desc: "using `option.map(f)`, where `f` is a function or closure that returns `()`",
1677 module: "map_unit_fn",
1680 name: "option_option",
1682 desc: "usage of `Option<Option<T>>`",
1687 name: "or_fun_call",
1689 desc: "using any `*or` method with a function call, which suggests `*or_else`",
1694 name: "out_of_bounds_indexing",
1695 group: "correctness",
1696 desc: "out of bounds constant indexing",
1698 module: "indexing_slicing",
1701 name: "overflow_check_conditional",
1702 group: "complexity",
1703 desc: "overflow checks inspired by C which are likely to panic",
1705 module: "overflow_check_conditional",
1709 group: "restriction",
1710 desc: "usage of the `panic!` macro",
1712 module: "panic_unimplemented",
1715 name: "panic_params",
1717 desc: "missing parameters in `panic!` calls",
1719 module: "panic_unimplemented",
1722 name: "panicking_unwrap",
1723 group: "correctness",
1724 desc: "checks for calls of `unwrap[_err]()` that will always fail",
1729 name: "partialeq_ne_impl",
1730 group: "complexity",
1731 desc: "re-implementing `PartialEq::ne`",
1733 module: "partialeq_ne_impl",
1736 name: "path_buf_push_overwrite",
1738 desc: "calling `push` with file system root on `PathBuf` can overwrite it",
1740 module: "path_buf_push_overwrite",
1743 name: "pattern_type_mismatch",
1744 group: "restriction",
1745 desc: "type of pattern does not match the expression type",
1747 module: "pattern_type_mismatch",
1750 name: "possible_missing_comma",
1751 group: "correctness",
1752 desc: "possible missing comma in array",
1754 module: "formatting",
1758 group: "complexity",
1759 desc: "operations where precedence may be unclear",
1761 module: "precedence",
1764 name: "print_literal",
1766 desc: "printing a literal with a format string",
1771 name: "print_stdout",
1772 group: "restriction",
1773 desc: "printing on stdout",
1778 name: "print_with_newline",
1780 desc: "using `print!()` with a format string that ends in a single newline",
1785 name: "println_empty_string",
1787 desc: "using `println!(\"\")` with an empty string",
1794 desc: "fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively",
1799 name: "ptr_offset_with_cast",
1800 group: "complexity",
1801 desc: "unneeded pointer offset cast",
1803 module: "ptr_offset_with_cast",
1806 name: "pub_enum_variant_names",
1808 desc: "public enums where all variants share a prefix/postfix",
1810 module: "enum_variants",
1813 name: "question_mark",
1815 desc: "checks for expressions that could be replaced by the question mark operator",
1817 module: "question_mark",
1820 name: "range_minus_one",
1822 desc: "`x..=(y-1)` reads better as `x..y`",
1827 name: "range_plus_one",
1829 desc: "`x..(y+1)` reads better as `x..=y`",
1834 name: "range_zip_with_len",
1835 group: "complexity",
1836 desc: "zipping iterator with a range when `enumerate()` would do",
1841 name: "redundant_allocation",
1843 desc: "redundant allocation",
1848 name: "redundant_clone",
1850 desc: "`clone()` of an owned value that is going to be dropped immediately",
1852 module: "redundant_clone",
1855 name: "redundant_closure",
1857 desc: "redundant closures, i.e., `|a| foo(a)` (which can be written as just `foo`)",
1859 module: "eta_reduction",
1862 name: "redundant_closure_call",
1863 group: "complexity",
1864 desc: "throwaway closures called in the expression they are defined",
1866 module: "redundant_closure_call",
1869 name: "redundant_closure_for_method_calls",
1871 desc: "redundant closures for method calls",
1873 module: "eta_reduction",
1876 name: "redundant_field_names",
1878 desc: "checks for fields in struct literals where shorthands could be used",
1880 module: "redundant_field_names",
1883 name: "redundant_pattern",
1885 desc: "using `name @ _` in a pattern",
1887 module: "misc_early",
1890 name: "redundant_pattern_matching",
1892 desc: "use the proper utility function avoiding an `if let`",
1897 name: "redundant_pub_crate",
1899 desc: "Using `pub(crate)` visibility on items that are not crate visible due to the visibility of the module that contains them.",
1901 module: "redundant_pub_crate",
1904 name: "redundant_static_lifetimes",
1906 desc: "Using explicit `\'static` lifetime for constants or statics when elision rules would allow omitting them.",
1908 module: "redundant_static_lifetimes",
1911 name: "ref_in_deref",
1912 group: "complexity",
1913 desc: "Use of reference in auto dereference expression.",
1915 module: "reference",
1918 name: "repeat_once",
1919 group: "complexity",
1920 desc: "using `.repeat(1)` instead of `String.clone()`, `str.to_string()` or `slice.to_vec()` ",
1922 module: "repeat_once",
1925 name: "rest_pat_in_fully_bound_structs",
1926 group: "restriction",
1927 desc: "a match on a struct that binds all fields but still uses the wildcard pattern",
1932 name: "result_map_or_into_option",
1934 desc: "using `Result.map_or(None, Some)`, which is more succinctly expressed as `ok()`",
1939 name: "result_map_unit_fn",
1940 group: "complexity",
1941 desc: "using `result.map(f)`, where `f` is a function or closure that returns `()`",
1943 module: "map_unit_fn",
1946 name: "reversed_empty_ranges",
1947 group: "correctness",
1948 desc: "reversing the limits of range expressions, resulting in empty ranges",
1953 name: "same_functions_in_if_condition",
1955 desc: "consecutive `if`s with the same function call",
1960 name: "same_item_push",
1962 desc: "the same item is pushed inside of a for loop",
1967 name: "search_is_some",
1968 group: "complexity",
1969 desc: "using an iterator search followed by `is_some()`, which is more succinctly expressed as a call to `any()`",
1974 name: "self_assignment",
1975 group: "correctness",
1976 desc: "explicit self-assignment",
1978 module: "self_assignment",
1981 name: "serde_api_misuse",
1982 group: "correctness",
1983 desc: "various things that will negatively affect your serde experience",
1985 module: "serde_api",
1988 name: "shadow_reuse",
1989 group: "restriction",
1990 desc: "rebinding a name to an expression that re-uses the original value, e.g., `let x = x + 1`",
1995 name: "shadow_same",
1996 group: "restriction",
1997 desc: "rebinding a name to itself, e.g., `let mut x = &mut x`",
2002 name: "shadow_unrelated",
2004 desc: "rebinding a name without even using the original value",
2009 name: "short_circuit_statement",
2010 group: "complexity",
2011 desc: "using a short circuit boolean condition as a statement",
2016 name: "should_implement_trait",
2018 desc: "defining a method that should be implementing a std trait",
2023 name: "similar_names",
2025 desc: "similarly named items and bindings",
2027 module: "non_expressive_names",
2030 name: "single_char_pattern",
2032 desc: "using a single-character str where a char could be used, e.g., `_.split(\"x\")`",
2037 name: "single_char_push_str",
2039 desc: "`push_str()` used with a single-character string literal as parameter",
2044 name: "single_component_path_imports",
2046 desc: "imports with single component path are redundant",
2048 module: "single_component_path_imports",
2051 name: "single_match",
2053 desc: "a `match` statement with a single nontrivial arm (i.e., where the other arm is `_ => {}`) instead of `if let`",
2058 name: "single_match_else",
2060 desc: "a `match` statement with two arms where the second arm\'s pattern is a placeholder instead of a specific match pattern",
2065 name: "skip_while_next",
2066 group: "complexity",
2067 desc: "using `skip_while(p).next()`, which is more succinctly expressed as `.find(!p)`",
2072 name: "slow_vector_initialization",
2074 desc: "slow vector initialization",
2076 module: "slow_vector_initialization",
2079 name: "stable_sort_primitive",
2081 desc: "use of sort() when sort_unstable() is equivalent",
2083 module: "stable_sort_primitive",
2087 group: "restriction",
2088 desc: "using `x + ..` where x is a `String` instead of `push_str()`",
2093 name: "string_add_assign",
2095 desc: "using `x = x + ..` where x is a `String` instead of `push_str()`",
2100 name: "string_extend_chars",
2102 desc: "using `x.extend(s.chars())` where s is a `&str` or `String`",
2107 name: "string_lit_as_bytes",
2109 desc: "calling `as_bytes` on a string literal instead of using a byte string literal",
2114 name: "struct_excessive_bools",
2116 desc: "using too many bools in a struct",
2118 module: "excessive_bools",
2121 name: "suboptimal_flops",
2123 desc: "usage of sub-optimal floating point operations",
2125 module: "floating_point_arithmetic",
2128 name: "suspicious_arithmetic_impl",
2129 group: "correctness",
2130 desc: "suspicious use of operators in impl of arithmetic trait",
2132 module: "suspicious_trait_impl",
2135 name: "suspicious_assignment_formatting",
2137 desc: "suspicious formatting of `*=`, `-=` or `!=`",
2139 module: "formatting",
2142 name: "suspicious_else_formatting",
2144 desc: "suspicious formatting of `else`",
2146 module: "formatting",
2149 name: "suspicious_map",
2150 group: "complexity",
2151 desc: "suspicious usage of map",
2156 name: "suspicious_op_assign_impl",
2157 group: "correctness",
2158 desc: "suspicious use of operators in impl of OpAssign trait",
2160 module: "suspicious_trait_impl",
2163 name: "suspicious_unary_op_formatting",
2165 desc: "suspicious formatting of unary `-` or `!` on the RHS of a BinOp",
2167 module: "formatting",
2170 name: "tabs_in_doc_comments",
2172 desc: "using tabs in doc comments is not recommended",
2174 module: "tabs_in_doc_comments",
2177 name: "temporary_assignment",
2178 group: "complexity",
2179 desc: "assignments to temporaries",
2181 module: "temporary_assignment",
2184 name: "temporary_cstring_as_ptr",
2185 group: "correctness",
2186 desc: "getting the inner pointer of a temporary `CString`",
2191 name: "to_digit_is_some",
2193 desc: "`char.is_digit()` is clearer",
2195 module: "to_digit_is_some",
2198 name: "to_string_in_display",
2199 group: "correctness",
2200 desc: "`to_string` method used while implementing `Display` trait",
2202 module: "to_string_in_display",
2206 group: "restriction",
2207 desc: "`todo!` should not be present in production code",
2209 module: "panic_unimplemented",
2212 name: "too_many_arguments",
2213 group: "complexity",
2214 desc: "functions with too many arguments",
2216 module: "functions",
2219 name: "too_many_lines",
2221 desc: "functions with too many lines",
2223 module: "functions",
2226 name: "toplevel_ref_arg",
2228 desc: "an entire binding declared as `ref`, in a function argument or a `let` statement",
2233 name: "trait_duplication_in_bounds",
2235 desc: "Check if the same trait bounds are specified twice during a function declaration",
2237 module: "trait_bounds",
2240 name: "transmute_bytes_to_str",
2241 group: "complexity",
2242 desc: "transmutes from a `&[u8]` to a `&str`",
2244 module: "transmute",
2247 name: "transmute_float_to_int",
2248 group: "complexity",
2249 desc: "transmutes from a float to an integer",
2251 module: "transmute",
2254 name: "transmute_int_to_bool",
2255 group: "complexity",
2256 desc: "transmutes from an integer to a `bool`",
2258 module: "transmute",
2261 name: "transmute_int_to_char",
2262 group: "complexity",
2263 desc: "transmutes from an integer to a `char`",
2265 module: "transmute",
2268 name: "transmute_int_to_float",
2269 group: "complexity",
2270 desc: "transmutes from an integer to a float",
2272 module: "transmute",
2275 name: "transmute_ptr_to_ptr",
2276 group: "complexity",
2277 desc: "transmutes from a pointer to a pointer / a reference to a reference",
2279 module: "transmute",
2282 name: "transmute_ptr_to_ref",
2283 group: "complexity",
2284 desc: "transmutes from a pointer to a reference type",
2286 module: "transmute",
2289 name: "transmutes_expressible_as_ptr_casts",
2290 group: "complexity",
2291 desc: "transmutes that could be a pointer cast",
2293 module: "transmute",
2296 name: "transmuting_null",
2297 group: "correctness",
2298 desc: "transmutes from a null pointer to a reference, which is undefined behavior",
2300 module: "transmuting_null",
2303 name: "trivial_regex",
2305 desc: "trivial regular expressions",
2310 name: "trivially_copy_pass_by_ref",
2312 desc: "functions taking small copyable arguments by reference",
2314 module: "trivially_copy_pass_by_ref",
2319 desc: "return errors explicitly rather than hiding them behind a `?`",
2324 name: "type_complexity",
2325 group: "complexity",
2326 desc: "usage of very complex types that might be better factored into `type` definitions",
2331 name: "type_repetition_in_bounds",
2333 desc: "Types are repeated unnecessary in trait bounds use `+` instead of using `T: _, T: _`",
2335 module: "trait_bounds",
2338 name: "unicode_not_nfc",
2340 desc: "using a Unicode literal not in NFC normal form (see [Unicode tr15](http://www.unicode.org/reports/tr15/) for further information)",
2345 name: "unimplemented",
2346 group: "restriction",
2347 desc: "`unimplemented!` should not be present in production code",
2349 module: "panic_unimplemented",
2352 name: "uninit_assumed_init",
2353 group: "correctness",
2354 desc: "`MaybeUninit::uninit().assume_init()`",
2360 group: "complexity",
2361 desc: "passing unit to a function",
2367 group: "correctness",
2368 desc: "comparing unit values",
2373 name: "unit_return_expecting_ord",
2374 group: "correctness",
2375 desc: "fn arguments of type Fn(...) -> Ord returning the unit type ().",
2377 module: "unit_return_expecting_ord",
2380 name: "unknown_clippy_lints",
2382 desc: "unknown_lints for scoped Clippy lints",
2387 name: "unnecessary_cast",
2388 group: "complexity",
2389 desc: "cast to the same type, e.g., `x as i32` where `x: i32`",
2394 name: "unnecessary_filter_map",
2395 group: "complexity",
2396 desc: "using `filter_map` when a more succinct alternative exists",
2401 name: "unnecessary_fold",
2403 desc: "using `fold` when a more succinct alternative exists",
2408 name: "unnecessary_lazy_evaluations",
2410 desc: "using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation",
2415 name: "unnecessary_mut_passed",
2417 desc: "an argument passed as a mutable reference although the callee only demands an immutable reference",
2419 module: "mut_reference",
2422 name: "unnecessary_operation",
2423 group: "complexity",
2424 desc: "outer expressions with no effect",
2426 module: "no_effect",
2429 name: "unnecessary_sort_by",
2430 group: "complexity",
2431 desc: "Use of `Vec::sort_by` when `Vec::sort_by_key` or `Vec::sort` would be clearer",
2433 module: "unnecessary_sort_by",
2436 name: "unnecessary_unwrap",
2437 group: "complexity",
2438 desc: "checks for calls of `unwrap[_err]()` that cannot fail",
2443 name: "unneeded_field_pattern",
2444 group: "restriction",
2445 desc: "struct fields bound to a wildcard instead of using `..`",
2447 module: "misc_early",
2450 name: "unneeded_wildcard_pattern",
2451 group: "complexity",
2452 desc: "tuple patterns with a wildcard pattern (`_`) is next to a rest pattern (`..`)",
2454 module: "misc_early",
2457 name: "unnested_or_patterns",
2459 desc: "unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)`",
2461 module: "unnested_or_patterns",
2464 name: "unreachable",
2465 group: "restriction",
2466 desc: "`unreachable!` should not be present in production code",
2468 module: "panic_unimplemented",
2471 name: "unreadable_literal",
2473 desc: "long integer literal without underscores",
2475 module: "literal_representation",
2478 name: "unsafe_derive_deserialize",
2480 desc: "deriving `serde::Deserialize` on a type that has methods using `unsafe`",
2485 name: "unsafe_removed_from_name",
2487 desc: "`unsafe` removed from API names on import",
2489 module: "unsafe_removed_from_name",
2492 name: "unseparated_literal_suffix",
2494 desc: "literals whose suffix is not separated by an underscore",
2496 module: "misc_early",
2499 name: "unsound_collection_transmute",
2500 group: "correctness",
2501 desc: "transmute between collections of layout-incompatible types",
2503 module: "transmute",
2506 name: "unused_io_amount",
2507 group: "correctness",
2508 desc: "unused written/read amount",
2510 module: "unused_io_amount",
2513 name: "unused_self",
2515 desc: "methods that contain a `self` argument but don\'t use it",
2517 module: "unused_self",
2520 name: "unused_unit",
2522 desc: "needless unit expression",
2524 module: "unused_unit",
2527 name: "unwrap_in_result",
2528 group: "restriction",
2529 desc: "functions of type `Result<..>` or `Option`<...> that contain `expect()` or `unwrap()`",
2531 module: "unwrap_in_result",
2534 name: "unwrap_used",
2535 group: "restriction",
2536 desc: "using `.unwrap()` on `Result` or `Option`, which should at least get a better message using `expect()`",
2542 group: "restriction",
2543 desc: "use of `Debug`-based formatting",
2550 desc: "unnecessary structure name repetition whereas `Self` is applicable",
2555 name: "used_underscore_binding",
2557 desc: "using a binding which is prefixed with an underscore",
2562 name: "useless_asref",
2563 group: "complexity",
2564 desc: "using `as_ref` where the types before and after the call are the same",
2569 name: "useless_attribute",
2570 group: "correctness",
2571 desc: "use of lint attributes on `extern crate` items",
2576 name: "useless_conversion",
2577 group: "complexity",
2578 desc: "calls to `Into`, `TryInto`, `From`, `TryFrom`, `IntoIter` that performs useless conversions to the same type",
2580 module: "useless_conversion",
2583 name: "useless_format",
2584 group: "complexity",
2585 desc: "useless use of `format!`",
2590 name: "useless_let_if_seq",
2592 desc: "unidiomatic `let mut` declaration followed by initialization in `if`",
2594 module: "let_if_seq",
2597 name: "useless_transmute",
2599 desc: "transmutes that have the same to and from types or could be a cast/coercion",
2601 module: "transmute",
2604 name: "useless_vec",
2606 desc: "useless `vec!`",
2612 group: "complexity",
2613 desc: "usage of `Vec<Box<T>>` where T: Sized, vector elements are already on the heap",
2618 name: "vec_resize_to_zero",
2619 group: "correctness",
2620 desc: "emptying a vector with `resize(0, an_int)` instead of `clear()` is probably an argument inversion mistake",
2622 module: "vec_resize_to_zero",
2625 name: "verbose_bit_mask",
2627 desc: "expressions where a bit mask is less readable than the corresponding method call",
2632 name: "verbose_file_reads",
2633 group: "restriction",
2634 desc: "use of `File::read_to_end` or `File::read_to_string`",
2636 module: "verbose_file_reads",
2639 name: "vtable_address_comparisons",
2640 group: "correctness",
2641 desc: "comparison with an address of a trait vtable",
2643 module: "unnamed_address",
2646 name: "while_immutable_condition",
2647 group: "correctness",
2648 desc: "variables used within while expression are not mutated in the body",
2653 name: "while_let_loop",
2654 group: "complexity",
2655 desc: "`loop { if let { ... } else break }`, which can be written as a `while let` loop",
2660 name: "while_let_on_iterator",
2662 desc: "using a while-let loop instead of a for loop on an iterator",
2667 name: "wildcard_dependencies",
2669 desc: "wildcard dependencies being used",
2671 module: "wildcard_dependencies",
2674 name: "wildcard_enum_match_arm",
2675 group: "restriction",
2676 desc: "a wildcard enum match arm using `_`",
2681 name: "wildcard_imports",
2683 desc: "lint `use _::*` statements",
2685 module: "wildcard_imports",
2688 name: "wildcard_in_or_patterns",
2689 group: "complexity",
2690 desc: "a wildcard pattern used with others patterns in same match arm",
2695 name: "write_literal",
2697 desc: "writing a literal with a format string",
2702 name: "write_with_newline",
2704 desc: "using `write!()` with a format string that ends in a single newline",
2709 name: "writeln_empty_string",
2711 desc: "using `writeln!(buf, \"\")` with an empty string",
2716 name: "wrong_pub_self_convention",
2717 group: "restriction",
2718 desc: "defining a public method named with an established prefix (like \"into_\") that takes `self` with the wrong convention",
2723 name: "wrong_self_convention",
2725 desc: "defining a method named with an established prefix (like \"into_\") that takes `self` with the wrong convention",
2730 name: "wrong_transmute",
2731 group: "correctness",
2732 desc: "transmutes that are confusing at best, undefined behaviour at worst and always useless",
2734 module: "transmute",
2737 name: "zero_divided_by_zero",
2738 group: "complexity",
2739 desc: "usage of `0.0 / 0.0` to obtain NaN instead of `f32::NAN` or `f64::NAN`",
2741 module: "zero_div_zero",
2744 name: "zero_prefixed_literal",
2745 group: "complexity",
2746 desc: "integer literals starting with `0`",
2748 module: "misc_early",
2753 desc: "using `0 as *{const, mut} T`",
2758 name: "zero_width_space",
2759 group: "correctness",
2760 desc: "using a zero-width space in a string literal, which is confusing",
2766 group: "correctness",
2767 desc: "Check for offset calculations on raw pointers to zero-sized types",
2772 // end lint list, do not remove this comment, it’s used in `update_lints`