aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ide/src/hover.rs75
-rw-r--r--crates/ide_completion/src/completions/attribute.rs5
-rw-r--r--crates/ide_completion/src/completions/attribute/lint.rs127
-rw-r--r--crates/ide_completion/src/lib.rs2
-rw-r--r--crates/ide_db/src/helpers.rs1
-rw-r--r--crates/ide_db/src/helpers/generated_lints.rs (renamed from crates/ide_completion/src/generated_lint_completions.rs)1645
-rw-r--r--xtask/src/codegen/gen_lint_completions.rs52
7 files changed, 1130 insertions, 777 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 4d91c5c4f..f3f6f749c 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -3,11 +3,13 @@ use hir::{
3 AsAssocItem, AssocItemContainer, GenericParam, HasAttrs, HasSource, HirDisplay, InFile, Module, 3 AsAssocItem, AssocItemContainer, GenericParam, HasAttrs, HasSource, HirDisplay, InFile, Module,
4 ModuleDef, Semantics, 4 ModuleDef, Semantics,
5}; 5};
6use ide_completion::generated_lint_completions::{CLIPPY_LINTS, FEATURES};
7use ide_db::{ 6use ide_db::{
8 base_db::SourceDatabase, 7 base_db::SourceDatabase,
9 defs::{Definition, NameClass, NameRefClass}, 8 defs::{Definition, NameClass, NameRefClass},
10 helpers::FamousDefs, 9 helpers::{
10 generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES},
11 FamousDefs,
12 },
11 RootDatabase, 13 RootDatabase,
12}; 14};
13use itertools::Itertools; 15use itertools::Itertools;
@@ -206,25 +208,36 @@ fn try_hover_for_attribute(token: &SyntaxToken) -> Option<RangeInfo<HoverResult>
206 if !tt.syntax().text_range().contains(token.text_range().start()) { 208 if !tt.syntax().text_range().contains(token.text_range().start()) {
207 return None; 209 return None;
208 } 210 }
209 let lints = match &*path { 211 let (is_clippy, lints) = match &*path {
210 "feature" => FEATURES, 212 "feature" => (false, FEATURES),
211 "allow" | "warn" | "forbid" | "error" => { 213 "allow" | "deny" | "forbid" | "warn" => {
212 let is_clippy = algo::skip_trivia_token(token.clone(), Direction::Prev) 214 let is_clippy = algo::non_trivia_sibling(token.clone().into(), Direction::Prev)
213 .filter(|t| t.kind() == T![::]) 215 .filter(|t| t.kind() == T![:])
214 .and_then(|t| algo::skip_trivia_token(t, Direction::Prev)) 216 .and_then(|t| algo::non_trivia_sibling(t, Direction::Prev))
215 .map_or(false, |t| t.kind() == T![ident] && t.text() == "clippy"); 217 .filter(|t| t.kind() == T![:])
218 .and_then(|t| algo::non_trivia_sibling(t, Direction::Prev))
219 .map_or(false, |t| {
220 t.kind() == T![ident] && t.into_token().map_or(false, |t| t.text() == "clippy")
221 });
216 if is_clippy { 222 if is_clippy {
217 CLIPPY_LINTS 223 (true, CLIPPY_LINTS)
218 } else { 224 } else {
219 &[] 225 (false, DEFAULT_LINTS)
220 } 226 }
221 } 227 }
222 _ => return None, 228 _ => return None,
223 }; 229 };
224 let lint = lints 230
225 .binary_search_by_key(&token.text(), |lint| lint.label) 231 let tmp;
226 .ok() 232 let needle = if is_clippy {
227 .map(|idx| &FEATURES[idx])?; 233 tmp = format!("clippy::{}", token.text());
234 &tmp
235 } else {
236 &*token.text()
237 };
238
239 let lint =
240 lints.binary_search_by_key(&needle, |lint| lint.label).ok().map(|idx| &lints[idx])?;
228 Some(RangeInfo::new( 241 Some(RangeInfo::new(
229 token.text_range(), 242 token.text_range(),
230 HoverResult { 243 HoverResult {
@@ -4055,4 +4068,36 @@ pub fn foo() {}
4055 "##]], 4068 "##]],
4056 ) 4069 )
4057 } 4070 }
4071
4072 #[test]
4073 fn hover_lint() {
4074 check(
4075 r#"#![allow(arithmetic_overflow$0)]"#,
4076 expect![[r#"
4077 *arithmetic_overflow*
4078 ```
4079 arithmetic_overflow
4080 ```
4081 ___
4082
4083 arithmetic operation overflows
4084 "#]],
4085 )
4086 }
4087
4088 #[test]
4089 fn hover_clippy_lint() {
4090 check(
4091 r#"#![allow(clippy::almost_swapped$0)]"#,
4092 expect![[r#"
4093 *almost_swapped*
4094 ```
4095 clippy::almost_swapped
4096 ```
4097 ___
4098
4099 Checks for `foo = bar; bar = foo` sequences.
4100 "#]],
4101 )
4102 }
4058} 4103}
diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs
index c48bb9e66..f80d7eec3 100644
--- a/crates/ide_completion/src/completions/attribute.rs
+++ b/crates/ide_completion/src/completions/attribute.rs
@@ -3,20 +3,19 @@
3//! This module uses a bit of static metadata to provide completions 3//! This module uses a bit of static metadata to provide completions
4//! for built-in attributes. 4//! for built-in attributes.
5 5
6use ide_db::helpers::generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES};
6use once_cell::sync::Lazy; 7use once_cell::sync::Lazy;
7use rustc_hash::{FxHashMap, FxHashSet}; 8use rustc_hash::{FxHashMap, FxHashSet};
8use syntax::{algo::non_trivia_sibling, ast, AstNode, Direction, NodeOrToken, SyntaxKind, T}; 9use syntax::{algo::non_trivia_sibling, ast, AstNode, Direction, NodeOrToken, SyntaxKind, T};
9 10
10use crate::{ 11use crate::{
11 context::CompletionContext, 12 context::CompletionContext,
12 generated_lint_completions::{CLIPPY_LINTS, FEATURES},
13 item::{CompletionItem, CompletionItemKind, CompletionKind}, 13 item::{CompletionItem, CompletionItemKind, CompletionKind},
14 Completions, 14 Completions,
15}; 15};
16 16
17mod derive; 17mod derive;
18mod lint; 18mod lint;
19pub(crate) use self::lint::LintCompletion;
20 19
21pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { 20pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> {
22 let attribute = ctx.attribute_under_caret.as_ref()?; 21 let attribute = ctx.attribute_under_caret.as_ref()?;
@@ -25,7 +24,7 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
25 "derive" => derive::complete_derive(acc, ctx, token_tree), 24 "derive" => derive::complete_derive(acc, ctx, token_tree),
26 "feature" => lint::complete_lint(acc, ctx, token_tree, FEATURES), 25 "feature" => lint::complete_lint(acc, ctx, token_tree, FEATURES),
27 "allow" | "warn" | "deny" | "forbid" => { 26 "allow" | "warn" | "deny" | "forbid" => {
28 lint::complete_lint(acc, ctx, token_tree.clone(), lint::DEFAULT_LINT_COMPLETIONS); 27 lint::complete_lint(acc, ctx, token_tree.clone(), DEFAULT_LINTS);
29 lint::complete_lint(acc, ctx, token_tree, CLIPPY_LINTS); 28 lint::complete_lint(acc, ctx, token_tree, CLIPPY_LINTS);
30 } 29 }
31 _ => (), 30 _ => (),
diff --git a/crates/ide_completion/src/completions/attribute/lint.rs b/crates/ide_completion/src/completions/attribute/lint.rs
index 608e71cec..b486c9093 100644
--- a/crates/ide_completion/src/completions/attribute/lint.rs
+++ b/crates/ide_completion/src/completions/attribute/lint.rs
@@ -1,4 +1,5 @@
1//! Completion for lints 1//! Completion for lints
2use ide_db::helpers::generated_lints::Lint;
2use syntax::ast; 3use syntax::ast;
3 4
4use crate::{ 5use crate::{
@@ -11,7 +12,7 @@ pub(super) fn complete_lint(
11 acc: &mut Completions, 12 acc: &mut Completions,
12 ctx: &CompletionContext, 13 ctx: &CompletionContext,
13 derive_input: ast::TokenTree, 14 derive_input: ast::TokenTree,
14 lints_completions: &[LintCompletion], 15 lints_completions: &[Lint],
15) { 16) {
16 if let Some(existing_lints) = super::parse_comma_sep_input(derive_input) { 17 if let Some(existing_lints) = super::parse_comma_sep_input(derive_input) {
17 for lint_completion in lints_completions 18 for lint_completion in lints_completions
@@ -29,130 +30,6 @@ pub(super) fn complete_lint(
29 } 30 }
30} 31}
31 32
32pub struct LintCompletion {
33 pub label: &'static str,
34 pub description: &'static str,
35}
36
37#[rustfmt::skip]
38pub const DEFAULT_LINT_COMPLETIONS: &[LintCompletion] = &[
39 LintCompletion { label: "absolute_paths_not_starting_with_crate", description: r#"fully qualified paths that start with a module name instead of `crate`, `self`, or an extern crate name"# },
40 LintCompletion { label: "ambiguous_associated_items", description: r#"ambiguous associated items"# },
41 LintCompletion { label: "anonymous_parameters", description: r#"detects anonymous parameters"# },
42 LintCompletion { label: "arithmetic_overflow", description: r#"arithmetic operation overflows"# },
43 LintCompletion { label: "array_into_iter", description: r#"detects calling `into_iter` on arrays"# },
44 LintCompletion { label: "asm_sub_register", description: r#"using only a subset of a register for inline asm inputs"# },
45 LintCompletion { label: "bare_trait_objects", description: r#"suggest using `dyn Trait` for trait objects"# },
46 LintCompletion { label: "bindings_with_variant_name", description: r#"detects pattern bindings with the same name as one of the matched variants"# },
47 LintCompletion { label: "box_pointers", description: r#"use of owned (Box type) heap memory"# },
48 LintCompletion { label: "cenum_impl_drop_cast", description: r#"a C-like enum implementing Drop is cast"# },
49 LintCompletion { label: "clashing_extern_declarations", description: r#"detects when an extern fn has been declared with the same name but different types"# },
50 LintCompletion { label: "coherence_leak_check", description: r#"distinct impls distinguished only by the leak-check code"# },
51 LintCompletion { label: "conflicting_repr_hints", description: r#"conflicts between `#[repr(..)]` hints that were previously accepted and used in practice"# },
52 LintCompletion { label: "confusable_idents", description: r#"detects visually confusable pairs between identifiers"# },
53 LintCompletion { label: "const_err", description: r#"constant evaluation detected erroneous expression"# },
54 LintCompletion { label: "dead_code", description: r#"detect unused, unexported items"# },
55 LintCompletion { label: "deprecated_in_future", description: r#"detects use of items that will be deprecated in a future version"# },
56 LintCompletion { label: "deprecated", description: r#"detects use of deprecated items"# },
57 LintCompletion { label: "elided_lifetimes_in_paths", description: r#"hidden lifetime parameters in types are deprecated"# },
58 LintCompletion { label: "ellipsis_inclusive_range_patterns", description: r#"`...` range patterns are deprecated"# },
59 LintCompletion { label: "explicit_outlives_requirements", description: r#"outlives requirements can be inferred"# },
60 LintCompletion { label: "exported_private_dependencies", description: r#"public interface leaks type from a private dependency"# },
61 LintCompletion { label: "ill_formed_attribute_input", description: r#"ill-formed attribute inputs that were previously accepted and used in practice"# },
62 LintCompletion { label: "illegal_floating_point_literal_pattern", description: r#"floating-point literals cannot be used in patterns"# },
63 LintCompletion { label: "improper_ctypes_definitions", description: r#"proper use of libc types in foreign item definitions"# },
64 LintCompletion { label: "improper_ctypes", description: r#"proper use of libc types in foreign modules"# },
65 LintCompletion { label: "incomplete_features", description: r#"incomplete features that may function improperly in some or all cases"# },
66 LintCompletion { label: "incomplete_include", description: r#"trailing content in included file"# },
67 LintCompletion { label: "indirect_structural_match", description: r#"pattern with const indirectly referencing non-structural-match type"# },
68 LintCompletion { label: "inline_no_sanitize", description: r#"detects incompatible use of `#[inline(always)]` and `#[no_sanitize(...)]`"# },
69 LintCompletion { label: "intra_doc_link_resolution_failure", description: r#"failures in resolving intra-doc link targets"# },
70 LintCompletion { label: "invalid_codeblock_attributes", description: r#"codeblock attribute looks a lot like a known one"# },
71 LintCompletion { label: "invalid_type_param_default", description: r#"type parameter default erroneously allowed in invalid location"# },
72 LintCompletion { label: "invalid_value", description: r#"an invalid value is being created (such as a NULL reference)"# },
73 LintCompletion { label: "irrefutable_let_patterns", description: r#"detects irrefutable patterns in if-let and while-let statements"# },
74 LintCompletion { label: "keyword_idents", description: r#"detects edition keywords being used as an identifier"# },
75 LintCompletion { label: "late_bound_lifetime_arguments", description: r#"detects generic lifetime arguments in path segments with late bound lifetime parameters"# },
76 LintCompletion { label: "macro_expanded_macro_exports_accessed_by_absolute_paths", description: r#"macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"# },
77 LintCompletion { label: "macro_use_extern_crate", description: r#"the `#[macro_use]` attribute is now deprecated in favor of using macros via the module system"# },
78 LintCompletion { label: "meta_variable_misuse", description: r#"possible meta-variable misuse at macro definition"# },
79 LintCompletion { label: "missing_copy_implementations", description: r#"detects potentially-forgotten implementations of `Copy`"# },
80 LintCompletion { label: "missing_crate_level_docs", description: r#"detects crates with no crate-level documentation"# },
81 LintCompletion { label: "missing_debug_implementations", description: r#"detects missing implementations of Debug"# },
82 LintCompletion { label: "missing_doc_code_examples", description: r#"detects publicly-exported items without code samples in their documentation"# },
83 LintCompletion { label: "missing_docs", description: r#"detects missing documentation for public members"# },
84 LintCompletion { label: "missing_fragment_specifier", description: r#"detects missing fragment specifiers in unused `macro_rules!` patterns"# },
85 LintCompletion { label: "mixed_script_confusables", description: r#"detects Unicode scripts whose mixed script confusables codepoints are solely used"# },
86 LintCompletion { label: "mutable_borrow_reservation_conflict", description: r#"reservation of a two-phased borrow conflicts with other shared borrows"# },
87 LintCompletion { label: "mutable_transmutes", description: r#"mutating transmuted &mut T from &T may cause undefined behavior"# },
88 LintCompletion { label: "no_mangle_const_items", description: r#"const items will not have their symbols exported"# },
89 LintCompletion { label: "no_mangle_generic_items", description: r#"generic items must be mangled"# },
90 LintCompletion { label: "non_ascii_idents", description: r#"detects non-ASCII identifiers"# },
91 LintCompletion { label: "non_camel_case_types", description: r#"types, variants, traits and type parameters should have camel case names"# },
92 LintCompletion { label: "non_shorthand_field_patterns", description: r#"using `Struct { x: x }` instead of `Struct { x }` in a pattern"# },
93 LintCompletion { label: "non_snake_case", description: r#"variables, methods, functions, lifetime parameters and modules should have snake case names"# },
94 LintCompletion { label: "non_upper_case_globals", description: r#"static constants should have uppercase identifiers"# },
95 LintCompletion { label: "order_dependent_trait_objects", description: r#"trait-object types were treated as different depending on marker-trait order"# },
96 LintCompletion { label: "overflowing_literals", description: r#"literal out of range for its type"# },
97 LintCompletion { label: "overlapping_patterns", description: r#"detects overlapping patterns"# },
98 LintCompletion { label: "path_statements", description: r#"path statements with no effect"# },
99 LintCompletion { label: "patterns_in_fns_without_body", description: r#"patterns in functions without body were erroneously allowed"# },
100 LintCompletion { label: "private_doc_tests", description: r#"detects code samples in docs of private items not documented by rustdoc"# },
101 LintCompletion { label: "private_in_public", description: r#"detect private items in public interfaces not caught by the old implementation"# },
102 LintCompletion { label: "proc_macro_derive_resolution_fallback", description: r#"detects proc macro derives using inaccessible names from parent modules"# },
103 LintCompletion { label: "pub_use_of_private_extern_crate", description: r#"detect public re-exports of private extern crates"# },
104 LintCompletion { label: "redundant_semicolons", description: r#"detects unnecessary trailing semicolons"# },
105 LintCompletion { label: "renamed_and_removed_lints", description: r#"lints that have been renamed or removed"# },
106 LintCompletion { label: "safe_packed_borrows", description: r#"safe borrows of fields of packed structs were erroneously allowed"# },
107 LintCompletion { label: "single_use_lifetimes", description: r#"detects lifetime parameters that are only used once"# },
108 LintCompletion { label: "soft_unstable", description: r#"a feature gate that doesn't break dependent crates"# },
109 LintCompletion { label: "stable_features", description: r#"stable features found in `#[feature]` directive"# },
110 LintCompletion { label: "trivial_bounds", description: r#"these bounds don't depend on an type parameters"# },
111 LintCompletion { label: "trivial_casts", description: r#"detects trivial casts which could be removed"# },
112 LintCompletion { label: "trivial_numeric_casts", description: r#"detects trivial casts of numeric types which could be removed"# },
113 LintCompletion { label: "type_alias_bounds", description: r#"bounds in type aliases are not enforced"# },
114 LintCompletion { label: "tyvar_behind_raw_pointer", description: r#"raw pointer to an inference variable"# },
115 LintCompletion { label: "unaligned_references", description: r#"detects unaligned references to fields of packed structs"# },
116 LintCompletion { label: "uncommon_codepoints", description: r#"detects uncommon Unicode codepoints in identifiers"# },
117 LintCompletion { label: "unconditional_panic", description: r#"operation will cause a panic at runtime"# },
118 LintCompletion { label: "unconditional_recursion", description: r#"functions that cannot return without calling themselves"# },
119 LintCompletion { label: "unknown_crate_types", description: r#"unknown crate type found in `#[crate_type]` directive"# },
120 LintCompletion { label: "unknown_lints", description: r#"unrecognized lint attribute"# },
121 LintCompletion { label: "unnameable_test_items", description: r#"detects an item that cannot be named being marked as `#[test_case]`"# },
122 LintCompletion { label: "unreachable_code", description: r#"detects unreachable code paths"# },
123 LintCompletion { label: "unreachable_patterns", description: r#"detects unreachable patterns"# },
124 LintCompletion { label: "unreachable_pub", description: r#"`pub` items not reachable from crate root"# },
125 LintCompletion { label: "unsafe_code", description: r#"usage of `unsafe` code"# },
126 LintCompletion { label: "unsafe_op_in_unsafe_fn", description: r#"unsafe operations in unsafe functions without an explicit unsafe block are deprecated"# },
127 LintCompletion { label: "unstable_features", description: r#"enabling unstable features (deprecated. do not use)"# },
128 LintCompletion { label: "unstable_name_collisions", description: r#"detects name collision with an existing but unstable method"# },
129 LintCompletion { label: "unused_allocation", description: r#"detects unnecessary allocations that can be eliminated"# },
130 LintCompletion { label: "unused_assignments", description: r#"detect assignments that will never be read"# },
131 LintCompletion { label: "unused_attributes", description: r#"detects attributes that were not used by the compiler"# },
132 LintCompletion { label: "unused_braces", description: r#"unnecessary braces around an expression"# },
133 LintCompletion { label: "unused_comparisons", description: r#"comparisons made useless by limits of the types involved"# },
134 LintCompletion { label: "unused_crate_dependencies", description: r#"crate dependencies that are never used"# },
135 LintCompletion { label: "unused_doc_comments", description: r#"detects doc comments that aren't used by rustdoc"# },
136 LintCompletion { label: "unused_extern_crates", description: r#"extern crates that are never used"# },
137 LintCompletion { label: "unused_features", description: r#"unused features found in crate-level `#[feature]` directives"# },
138 LintCompletion { label: "unused_import_braces", description: r#"unnecessary braces around an imported item"# },
139 LintCompletion { label: "unused_imports", description: r#"imports that are never used"# },
140 LintCompletion { label: "unused_labels", description: r#"detects labels that are never used"# },
141 LintCompletion { label: "unused_lifetimes", description: r#"detects lifetime parameters that are never used"# },
142 LintCompletion { label: "unused_macros", description: r#"detects macros that were not used"# },
143 LintCompletion { label: "unused_must_use", description: r#"unused result of a type flagged as `#[must_use]`"# },
144 LintCompletion { label: "unused_mut", description: r#"detect mut variables which don't need to be mutable"# },
145 LintCompletion { label: "unused_parens", description: r#"`if`, `match`, `while` and `return` do not need parentheses"# },
146 LintCompletion { label: "unused_qualifications", description: r#"detects unnecessarily qualified names"# },
147 LintCompletion { label: "unused_results", description: r#"unused result of an expression in a statement"# },
148 LintCompletion { label: "unused_unsafe", description: r#"unnecessary use of an `unsafe` block"# },
149 LintCompletion { label: "unused_variables", description: r#"detect variables which are not used in any way"# },
150 LintCompletion { label: "variant_size_differences", description: r#"detects enums with widely varying variant sizes"# },
151 LintCompletion { label: "warnings", description: r#"mass-change the level for lints which produce warnings"# },
152 LintCompletion { label: "where_clauses_object_safety", description: r#"checks the object safety of where clauses"# },
153 LintCompletion { label: "while_true", description: r#"suggest using `loop { }` instead of `while true { }`"# },
154];
155
156#[cfg(test)] 33#[cfg(test)]
157mod tests { 34mod tests {
158 35
diff --git a/crates/ide_completion/src/lib.rs b/crates/ide_completion/src/lib.rs
index 1f0158745..6fb38f50d 100644
--- a/crates/ide_completion/src/lib.rs
+++ b/crates/ide_completion/src/lib.rs
@@ -10,8 +10,6 @@ mod render;
10 10
11mod completions; 11mod completions;
12 12
13pub mod generated_lint_completions;
14
15use completions::flyimport::position_for_import; 13use completions::flyimport::position_for_import;
16use ide_db::{ 14use ide_db::{
17 base_db::FilePosition, 15 base_db::FilePosition,
diff --git a/crates/ide_db/src/helpers.rs b/crates/ide_db/src/helpers.rs
index 21b48237a..00900cdc2 100644
--- a/crates/ide_db/src/helpers.rs
+++ b/crates/ide_db/src/helpers.rs
@@ -3,6 +3,7 @@ pub mod import_assets;
3pub mod insert_use; 3pub mod insert_use;
4pub mod merge_imports; 4pub mod merge_imports;
5pub mod rust_doc; 5pub mod rust_doc;
6pub mod generated_lints;
6 7
7use std::collections::VecDeque; 8use std::collections::VecDeque;
8 9
diff --git a/crates/ide_completion/src/generated_lint_completions.rs b/crates/ide_db/src/helpers/generated_lints.rs
index fe9554526..77021bae0 100644
--- a/crates/ide_completion/src/generated_lint_completions.rs
+++ b/crates/ide_db/src/helpers/generated_lints.rs
@@ -1,9 +1,460 @@
1//! Generated file, do not edit by hand, see `xtask/src/codegen` 1//! Generated file, do not edit by hand, see `xtask/src/codegen`
2 2
3use crate::completions::attribute::LintCompletion; 3pub struct Lint {
4 pub label: &'static str,
5 pub description: &'static str,
6}
7
8pub const DEFAULT_LINTS: &[Lint] = &[
9 Lint { label: "----", description: r##"-------"## },
10 Lint {
11 label: "absolute-paths-not-starting-with-crate",
12 description: r##"fully qualified paths that start with a module name instead of `crate`, `self`, or an extern crate name"##,
13 },
14 Lint { label: "ambiguous-associated-items", description: r##"ambiguous associated items"## },
15 Lint { label: "anonymous-parameters", description: r##"detects anonymous parameters"## },
16 Lint { label: "arithmetic-overflow", description: r##"arithmetic operation overflows"## },
17 Lint { label: "array-into-iter", description: r##"detects calling `into_iter` on arrays"## },
18 Lint {
19 label: "asm-sub-register",
20 description: r##"using only a subset of a register for inline asm inputs"##,
21 },
22 Lint { label: "bad-asm-style", description: r##"incorrect use of inline assembly"## },
23 Lint {
24 label: "bare-trait-objects",
25 description: r##"suggest using `dyn Trait` for trait objects"##,
26 },
27 Lint {
28 label: "bindings-with-variant-name",
29 description: r##"detects pattern bindings with the same name as one of the matched variants"##,
30 },
31 Lint { label: "box-pointers", description: r##"use of owned (Box type) heap memory"## },
32 Lint {
33 label: "cenum-impl-drop-cast",
34 description: r##"a C-like enum implementing Drop is cast"##,
35 },
36 Lint {
37 label: "clashing-extern-declarations",
38 description: r##"detects when an extern fn has been declared with the same name but different types"##,
39 },
40 Lint {
41 label: "coherence-leak-check",
42 description: r##"distinct impls distinguished only by the leak-check code"##,
43 },
44 Lint {
45 label: "conflicting-repr-hints",
46 description: r##"conflicts between `#[repr(..)]` hints that were previously accepted and used in practice"##,
47 },
48 Lint {
49 label: "confusable-idents",
50 description: r##"detects visually confusable pairs between identifiers"##,
51 },
52 Lint {
53 label: "const-err",
54 description: r##"constant evaluation encountered erroneous expression"##,
55 },
56 Lint {
57 label: "const-evaluatable-unchecked",
58 description: r##"detects a generic constant is used in a type without a emitting a warning"##,
59 },
60 Lint {
61 label: "const-item-mutation",
62 description: r##"detects attempts to mutate a `const` item"##,
63 },
64 Lint { label: "dead-code", description: r##"detect unused, unexported items"## },
65 Lint { label: "deprecated", description: r##"detects use of deprecated items"## },
66 Lint {
67 label: "deprecated-in-future",
68 description: r##"detects use of items that will be deprecated in a future version"##,
69 },
70 Lint {
71 label: "deref-nullptr",
72 description: r##"detects when an null pointer is dereferenced"##,
73 },
74 Lint {
75 label: "disjoint-capture-migration",
76 description: r##"Drop reorder and auto traits error because of `capture_disjoint_fields`"##,
77 },
78 Lint { label: "drop-bounds", description: r##"bounds of the form `T: Drop` are useless"## },
79 Lint {
80 label: "elided-lifetimes-in-paths",
81 description: r##"hidden lifetime parameters in types are deprecated"##,
82 },
83 Lint {
84 label: "ellipsis-inclusive-range-patterns",
85 description: r##"`...` range patterns are deprecated"##,
86 },
87 Lint {
88 label: "explicit-outlives-requirements",
89 description: r##"outlives requirements can be inferred"##,
90 },
91 Lint {
92 label: "exported-private-dependencies",
93 description: r##"public interface leaks type from a private dependency"##,
94 },
95 Lint { label: "forbidden-lint-groups", description: r##"applying forbid to lint-groups"## },
96 Lint {
97 label: "function-item-references",
98 description: r##"suggest casting to a function pointer when attempting to take references to function items"##,
99 },
100 Lint {
101 label: "ill-formed-attribute-input",
102 description: r##"ill-formed attribute inputs that were previously accepted and used in practice"##,
103 },
104 Lint {
105 label: "illegal-floating-point-literal-pattern",
106 description: r##"floating-point literals cannot be used in patterns"##,
107 },
108 Lint {
109 label: "improper-ctypes",
110 description: r##"proper use of libc types in foreign modules"##,
111 },
112 Lint {
113 label: "improper-ctypes-definitions",
114 description: r##"proper use of libc types in foreign item definitions"##,
115 },
116 Lint {
117 label: "incomplete-features",
118 description: r##"incomplete features that may function improperly in some or all cases"##,
119 },
120 Lint { label: "incomplete-include", description: r##"trailing content in included file"## },
121 Lint {
122 label: "indirect-structural-match",
123 description: r##"constant used in pattern contains value of non-structural-match type in a field or a variant"##,
124 },
125 Lint {
126 label: "ineffective-unstable-trait-impl",
127 description: r##"detects `#[unstable]` on stable trait implementations for stable types"##,
128 },
129 Lint {
130 label: "inline-no-sanitize",
131 description: r##"detects incompatible use of `#[inline(always)]` and `#[no_sanitize(...)]`"##,
132 },
133 Lint {
134 label: "invalid-type-param-default",
135 description: r##"type parameter default erroneously allowed in invalid location"##,
136 },
137 Lint {
138 label: "invalid-value",
139 description: r##"an invalid value is being created (such as a null reference)"##,
140 },
141 Lint {
142 label: "irrefutable-let-patterns",
143 description: r##"detects irrefutable patterns in `if let` and `while let` statements"##,
144 },
145 Lint {
146 label: "keyword-idents",
147 description: r##"detects edition keywords being used as an identifier"##,
148 },
149 Lint { label: "large-assignments", description: r##"detects large moves or copies"## },
150 Lint {
151 label: "late-bound-lifetime-arguments",
152 description: r##"detects generic lifetime arguments in path segments with late bound lifetime parameters"##,
153 },
154 Lint {
155 label: "legacy-derive-helpers",
156 description: r##"detects derive helper attributes that are used before they are introduced"##,
157 },
158 Lint {
159 label: "macro-expanded-macro-exports-accessed-by-absolute-paths",
160 description: r##"macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"##,
161 },
162 Lint {
163 label: "macro-use-extern-crate",
164 description: r##"the `#[macro_use]` attribute is now deprecated in favor of using macros via the module system"##,
165 },
166 Lint {
167 label: "meta-variable-misuse",
168 description: r##"possible meta-variable misuse at macro definition"##,
169 },
170 Lint { label: "missing-abi", description: r##"No declared ABI for extern declaration"## },
171 Lint {
172 label: "missing-copy-implementations",
173 description: r##"detects potentially-forgotten implementations of `Copy`"##,
174 },
175 Lint {
176 label: "missing-debug-implementations",
177 description: r##"detects missing implementations of Debug"##,
178 },
179 Lint {
180 label: "missing-docs",
181 description: r##"detects missing documentation for public members"##,
182 },
183 Lint {
184 label: "missing-fragment-specifier",
185 description: r##"detects missing fragment specifiers in unused `macro_rules!` patterns"##,
186 },
187 Lint {
188 label: "mixed-script-confusables",
189 description: r##"detects Unicode scripts whose mixed script confusables codepoints are solely used"##,
190 },
191 Lint {
192 label: "mutable-borrow-reservation-conflict",
193 description: r##"reservation of a two-phased borrow conflicts with other shared borrows"##,
194 },
195 Lint {
196 label: "mutable-transmutes",
197 description: r##"mutating transmuted &mut T from &T may cause undefined behavior"##,
198 },
199 Lint {
200 label: "no-mangle-const-items",
201 description: r##"const items will not have their symbols exported"##,
202 },
203 Lint { label: "no-mangle-generic-items", description: r##"generic items must be mangled"## },
204 Lint { label: "non-ascii-idents", description: r##"detects non-ASCII identifiers"## },
205 Lint {
206 label: "non-camel-case-types",
207 description: r##"types, variants, traits and type parameters should have camel case names"##,
208 },
209 Lint {
210 label: "non-fmt-panic",
211 description: r##"detect single-argument panic!() invocations in which the argument is not a format string"##,
212 },
213 Lint {
214 label: "non-shorthand-field-patterns",
215 description: r##"using `Struct { x: x }` instead of `Struct { x }` in a pattern"##,
216 },
217 Lint {
218 label: "non-snake-case",
219 description: r##"variables, methods, functions, lifetime parameters and modules should have snake case names"##,
220 },
221 Lint {
222 label: "non-upper-case-globals",
223 description: r##"static constants should have uppercase identifiers"##,
224 },
225 Lint {
226 label: "nontrivial-structural-match",
227 description: r##"constant used in pattern of non-structural-match type and the constant's initializer expression contains values of non-structural-match types"##,
228 },
229 Lint {
230 label: "noop-method-call",
231 description: r##"detects the use of well-known noop methods"##,
232 },
233 Lint {
234 label: "or-patterns-back-compat",
235 description: r##"detects usage of old versions of or-patterns"##,
236 },
237 Lint {
238 label: "order-dependent-trait-objects",
239 description: r##"trait-object types were treated as different depending on marker-trait order"##,
240 },
241 Lint { label: "overflowing-literals", description: r##"literal out of range for its type"## },
242 Lint {
243 label: "overlapping-range-endpoints",
244 description: r##"detects range patterns with overlapping endpoints"##,
245 },
246 Lint { label: "path-statements", description: r##"path statements with no effect"## },
247 Lint {
248 label: "patterns-in-fns-without-body",
249 description: r##"patterns in functions without body were erroneously allowed"##,
250 },
251 Lint {
252 label: "pointer-structural-match",
253 description: r##"pointers are not structural-match"##,
254 },
255 Lint {
256 label: "private-in-public",
257 description: r##"detect private items in public interfaces not caught by the old implementation"##,
258 },
259 Lint {
260 label: "proc-macro-back-compat",
261 description: r##"detects usage of old versions of certain proc-macro crates"##,
262 },
263 Lint {
264 label: "proc-macro-derive-resolution-fallback",
265 description: r##"detects proc macro derives using inaccessible names from parent modules"##,
266 },
267 Lint {
268 label: "pub-use-of-private-extern-crate",
269 description: r##"detect public re-exports of private extern crates"##,
270 },
271 Lint {
272 label: "redundant-semicolons",
273 description: r##"detects unnecessary trailing semicolons"##,
274 },
275 Lint {
276 label: "renamed-and-removed-lints",
277 description: r##"lints that have been renamed or removed"##,
278 },
279 Lint {
280 label: "semicolon-in-expressions-from-macros",
281 description: r##"trailing semicolon in macro body used as expression"##,
282 },
283 Lint {
284 label: "single-use-lifetimes",
285 description: r##"detects lifetime parameters that are only used once"##,
286 },
287 Lint {
288 label: "soft-unstable",
289 description: r##"a feature gate that doesn't break dependent crates"##,
290 },
291 Lint {
292 label: "stable-features",
293 description: r##"stable features found in `#[feature]` directive"##,
294 },
295 Lint {
296 label: "temporary-cstring-as-ptr",
297 description: r##"detects getting the inner pointer of a temporary `CString`"##,
298 },
299 Lint {
300 label: "trivial-bounds",
301 description: r##"these bounds don't depend on an type parameters"##,
302 },
303 Lint {
304 label: "trivial-casts",
305 description: r##"detects trivial casts which could be removed"##,
306 },
307 Lint {
308 label: "trivial-numeric-casts",
309 description: r##"detects trivial casts of numeric types which could be removed"##,
310 },
311 Lint {
312 label: "type-alias-bounds",
313 description: r##"bounds in type aliases are not enforced"##,
314 },
315 Lint {
316 label: "tyvar-behind-raw-pointer",
317 description: r##"raw pointer to an inference variable"##,
318 },
319 Lint {
320 label: "unaligned-references",
321 description: r##"detects unaligned references to fields of packed structs"##,
322 },
323 Lint {
324 label: "uncommon-codepoints",
325 description: r##"detects uncommon Unicode codepoints in identifiers"##,
326 },
327 Lint {
328 label: "unconditional-panic",
329 description: r##"operation will cause a panic at runtime"##,
330 },
331 Lint {
332 label: "unconditional-recursion",
333 description: r##"functions that cannot return without calling themselves"##,
334 },
335 Lint { label: "uninhabited-static", description: r##"uninhabited static"## },
336 Lint {
337 label: "unknown-crate-types",
338 description: r##"unknown crate type found in `#[crate_type]` directive"##,
339 },
340 Lint { label: "unknown-lints", description: r##"unrecognized lint attribute"## },
341 Lint {
342 label: "unnameable-test-items",
343 description: r##"detects an item that cannot be named being marked as `#[test_case]`"##,
344 },
345 Lint { label: "unreachable-code", description: r##"detects unreachable code paths"## },
346 Lint { label: "unreachable-patterns", description: r##"detects unreachable patterns"## },
347 Lint {
348 label: "unreachable-pub",
349 description: r##"`pub` items not reachable from crate root"##,
350 },
351 Lint { label: "unsafe-code", description: r##"usage of `unsafe` code"## },
352 Lint {
353 label: "unsafe-op-in-unsafe-fn",
354 description: r##"unsafe operations in unsafe functions without an explicit unsafe block are deprecated"##,
355 },
356 Lint {
357 label: "unstable-features",
358 description: r##"enabling unstable features (deprecated. do not use)"##,
359 },
360 Lint {
361 label: "unstable-name-collisions",
362 description: r##"detects name collision with an existing but unstable method"##,
363 },
364 Lint {
365 label: "unsupported-naked-functions",
366 description: r##"unsupported naked function definitions"##,
367 },
368 Lint {
369 label: "unused-allocation",
370 description: r##"detects unnecessary allocations that can be eliminated"##,
371 },
372 Lint {
373 label: "unused-assignments",
374 description: r##"detect assignments that will never be read"##,
375 },
376 Lint {
377 label: "unused-attributes",
378 description: r##"detects attributes that were not used by the compiler"##,
379 },
380 Lint { label: "unused-braces", description: r##"unnecessary braces around an expression"## },
381 Lint {
382 label: "unused-comparisons",
383 description: r##"comparisons made useless by limits of the types involved"##,
384 },
385 Lint {
386 label: "unused-crate-dependencies",
387 description: r##"crate dependencies that are never used"##,
388 },
389 Lint {
390 label: "unused-doc-comments",
391 description: r##"detects doc comments that aren't used by rustdoc"##,
392 },
393 Lint { label: "unused-extern-crates", description: r##"extern crates that are never used"## },
394 Lint {
395 label: "unused-features",
396 description: r##"unused features found in crate-level `#[feature]` directives"##,
397 },
398 Lint {
399 label: "unused-import-braces",
400 description: r##"unnecessary braces around an imported item"##,
401 },
402 Lint { label: "unused-imports", description: r##"imports that are never used"## },
403 Lint { label: "unused-labels", description: r##"detects labels that are never used"## },
404 Lint {
405 label: "unused-lifetimes",
406 description: r##"detects lifetime parameters that are never used"##,
407 },
408 Lint { label: "unused-macros", description: r##"detects macros that were not used"## },
409 Lint {
410 label: "unused-must-use",
411 description: r##"unused result of a type flagged as `#[must_use]`"##,
412 },
413 Lint {
414 label: "unused-mut",
415 description: r##"detect mut variables which don't need to be mutable"##,
416 },
417 Lint {
418 label: "unused-parens",
419 description: r##"`if`, `match`, `while` and `return` do not need parentheses"##,
420 },
421 Lint {
422 label: "unused-qualifications",
423 description: r##"detects unnecessarily qualified names"##,
424 },
425 Lint {
426 label: "unused-results",
427 description: r##"unused result of an expression in a statement"##,
428 },
429 Lint { label: "unused-unsafe", description: r##"unnecessary use of an `unsafe` block"## },
430 Lint {
431 label: "unused-variables",
432 description: r##"detect variables which are not used in any way"##,
433 },
434 Lint {
435 label: "useless-deprecated",
436 description: r##"detects deprecation attributes with no effect"##,
437 },
438 Lint {
439 label: "variant-size-differences",
440 description: r##"detects enums with widely varying variant sizes"##,
441 },
442 Lint {
443 label: "warnings",
444 description: r##"mass-change the level for lints which produce warnings"##,
445 },
446 Lint {
447 label: "where-clauses-object-safety",
448 description: r##"checks the object safety of where clauses"##,
449 },
450 Lint {
451 label: "while-true",
452 description: r##"suggest using `loop { }` instead of `while true { }`"##,
453 },
454];
4 455
5pub const FEATURES: &[LintCompletion] = &[ 456pub const FEATURES: &[Lint] = &[
6 LintCompletion { 457 Lint {
7 label: "abi_c_cmse_nonsecure_call", 458 label: "abi_c_cmse_nonsecure_call",
8 description: r##"# `abi_c_cmse_nonsecure_call` 459 description: r##"# `abi_c_cmse_nonsecure_call`
9 460
@@ -95,7 +546,7 @@ call_nonsecure_function:
95``` 546```
96"##, 547"##,
97 }, 548 },
98 LintCompletion { 549 Lint {
99 label: "abi_msp430_interrupt", 550 label: "abi_msp430_interrupt",
100 description: r##"# `abi_msp430_interrupt` 551 description: r##"# `abi_msp430_interrupt`
101 552
@@ -141,7 +592,7 @@ Disassembly of section .text:
141``` 592```
142"##, 593"##,
143 }, 594 },
144 LintCompletion { 595 Lint {
145 label: "abi_ptx", 596 label: "abi_ptx",
146 description: r##"# `abi_ptx` 597 description: r##"# `abi_ptx`
147 598
@@ -205,7 +656,7 @@ $ cat $(find -name '*.s')
205``` 656```
206"##, 657"##,
207 }, 658 },
208 LintCompletion { 659 Lint {
209 label: "abi_thiscall", 660 label: "abi_thiscall",
210 description: r##"# `abi_thiscall` 661 description: r##"# `abi_thiscall`
211 662
@@ -221,7 +672,7 @@ convention on x86 Windows except that the first parameter of the method,
221the `this` pointer, is passed in the ECX register. 672the `this` pointer, is passed in the ECX register.
222"##, 673"##,
223 }, 674 },
224 LintCompletion { 675 Lint {
225 label: "allocator_api", 676 label: "allocator_api",
226 description: r##"# `allocator_api` 677 description: r##"# `allocator_api`
227 678
@@ -240,7 +691,7 @@ for which you want a custom allocator.
240TBD 691TBD
241"##, 692"##,
242 }, 693 },
243 LintCompletion { 694 Lint {
244 label: "allocator_internals", 695 label: "allocator_internals",
245 description: r##"# `allocator_internals` 696 description: r##"# `allocator_internals`
246 697
@@ -251,7 +702,7 @@ compiler.
251------------------------ 702------------------------
252"##, 703"##,
253 }, 704 },
254 LintCompletion { 705 Lint {
255 label: "arbitrary_enum_discriminant", 706 label: "arbitrary_enum_discriminant",
256 description: r##"# `arbitrary_enum_discriminant` 707 description: r##"# `arbitrary_enum_discriminant`
257 708
@@ -292,7 +743,7 @@ assert_eq!(1, Enum::Struct{a: 7, b: 11}.tag());
292``` 743```
293"##, 744"##,
294 }, 745 },
295 LintCompletion { 746 Lint {
296 label: "asm", 747 label: "asm",
297 description: r##"# `asm` 748 description: r##"# `asm`
298 749
@@ -1134,7 +1585,7 @@ The compiler performs some additional checks on options:
1134> **Note**: As a general rule, the flags covered by `preserves_flags` are those which are *not* preserved when performing a function call. 1585> **Note**: As a general rule, the flags covered by `preserves_flags` are those which are *not* preserved when performing a function call.
1135"##, 1586"##,
1136 }, 1587 },
1137 LintCompletion { 1588 Lint {
1138 label: "auto_traits", 1589 label: "auto_traits",
1139 description: r##"# `auto_traits` 1590 description: r##"# `auto_traits`
1140 1591
@@ -1244,7 +1695,7 @@ Auto traits cannot have any trait items, such as methods or associated types. Th
1244Auto traits cannot have supertraits. This is for soundness reasons, as the interaction of coinduction with implied bounds is difficult to reconcile. 1695Auto traits cannot have supertraits. This is for soundness reasons, as the interaction of coinduction with implied bounds is difficult to reconcile.
1245"##, 1696"##,
1246 }, 1697 },
1247 LintCompletion { 1698 Lint {
1248 label: "box_patterns", 1699 label: "box_patterns",
1249 description: r##"# `box_patterns` 1700 description: r##"# `box_patterns`
1250 1701
@@ -1280,7 +1731,7 @@ fn main() {
1280``` 1731```
1281"##, 1732"##,
1282 }, 1733 },
1283 LintCompletion { 1734 Lint {
1284 label: "box_syntax", 1735 label: "box_syntax",
1285 description: r##"# `box_syntax` 1736 description: r##"# `box_syntax`
1286 1737
@@ -1306,7 +1757,7 @@ fn main() {
1306``` 1757```
1307"##, 1758"##,
1308 }, 1759 },
1309 LintCompletion { 1760 Lint {
1310 label: "c_unwind", 1761 label: "c_unwind",
1311 description: r##"# `c_unwind` 1762 description: r##"# `c_unwind`
1312 1763
@@ -1325,7 +1776,7 @@ See [RFC 2945] for more information.
1325[RFC 2945]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md 1776[RFC 2945]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
1326"##, 1777"##,
1327 }, 1778 },
1328 LintCompletion { 1779 Lint {
1329 label: "c_variadic", 1780 label: "c_variadic",
1330 description: r##"# `c_variadic` 1781 description: r##"# `c_variadic`
1331 1782
@@ -1353,7 +1804,7 @@ pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize {
1353``` 1804```
1354"##, 1805"##,
1355 }, 1806 },
1356 LintCompletion { 1807 Lint {
1357 label: "c_variadic", 1808 label: "c_variadic",
1358 description: r##"# `c_variadic` 1809 description: r##"# `c_variadic`
1359 1810
@@ -1383,7 +1834,7 @@ pub unsafe extern "C" fn vadd(n: usize, mut args: VaList) -> usize {
1383``` 1834```
1384"##, 1835"##,
1385 }, 1836 },
1386 LintCompletion { 1837 Lint {
1387 label: "c_void_variant", 1838 label: "c_void_variant",
1388 description: r##"# `c_void_variant` 1839 description: r##"# `c_void_variant`
1389 1840
@@ -1392,7 +1843,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1392------------------------ 1843------------------------
1393"##, 1844"##,
1394 }, 1845 },
1395 LintCompletion { 1846 Lint {
1396 label: "cfg_panic", 1847 label: "cfg_panic",
1397 description: r##"# `cfg_panic` 1848 description: r##"# `cfg_panic`
1398 1849
@@ -1434,7 +1885,7 @@ fn b() {
1434``` 1885```
1435"##, 1886"##,
1436 }, 1887 },
1437 LintCompletion { 1888 Lint {
1438 label: "cfg_sanitize", 1889 label: "cfg_sanitize",
1439 description: r##"# `cfg_sanitize` 1890 description: r##"# `cfg_sanitize`
1440 1891
@@ -1472,7 +1923,7 @@ fn b() {
1472``` 1923```
1473"##, 1924"##,
1474 }, 1925 },
1475 LintCompletion { 1926 Lint {
1476 label: "cfg_version", 1927 label: "cfg_version",
1477 description: r##"# `cfg_version` 1928 description: r##"# `cfg_version`
1478 1929
@@ -1511,7 +1962,7 @@ fn b() {
1511``` 1962```
1512"##, 1963"##,
1513 }, 1964 },
1514 LintCompletion { 1965 Lint {
1515 label: "char_error_internals", 1966 label: "char_error_internals",
1516 description: r##"# `char_error_internals` 1967 description: r##"# `char_error_internals`
1517 1968
@@ -1520,7 +1971,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1520------------------------ 1971------------------------
1521"##, 1972"##,
1522 }, 1973 },
1523 LintCompletion { 1974 Lint {
1524 label: "cmse_nonsecure_entry", 1975 label: "cmse_nonsecure_entry",
1525 description: r##"# `cmse_nonsecure_entry` 1976 description: r##"# `cmse_nonsecure_entry`
1526 1977
@@ -1605,7 +2056,7 @@ $ arm-none-eabi-objdump -D function.o
1605``` 2056```
1606"##, 2057"##,
1607 }, 2058 },
1608 LintCompletion { 2059 Lint {
1609 label: "compiler_builtins", 2060 label: "compiler_builtins",
1610 description: r##"# `compiler_builtins` 2061 description: r##"# `compiler_builtins`
1611 2062
@@ -1614,7 +2065,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1614------------------------ 2065------------------------
1615"##, 2066"##,
1616 }, 2067 },
1617 LintCompletion { 2068 Lint {
1618 label: "concat_idents", 2069 label: "concat_idents",
1619 description: r##"# `concat_idents` 2070 description: r##"# `concat_idents`
1620 2071
@@ -1640,7 +2091,7 @@ fn main() {
1640``` 2091```
1641"##, 2092"##,
1642 }, 2093 },
1643 LintCompletion { 2094 Lint {
1644 label: "const_eval_limit", 2095 label: "const_eval_limit",
1645 description: r##"# `const_eval_limit` 2096 description: r##"# `const_eval_limit`
1646 2097
@@ -1651,7 +2102,7 @@ The tracking issue for this feature is: [#67217]
1651The `const_eval_limit` allows someone to limit the evaluation steps the CTFE undertakes to evaluate a `const fn`. 2102The `const_eval_limit` allows someone to limit the evaluation steps the CTFE undertakes to evaluate a `const fn`.
1652"##, 2103"##,
1653 }, 2104 },
1654 LintCompletion { 2105 Lint {
1655 label: "core_intrinsics", 2106 label: "core_intrinsics",
1656 description: r##"# `core_intrinsics` 2107 description: r##"# `core_intrinsics`
1657 2108
@@ -1660,7 +2111,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1660------------------------ 2111------------------------
1661"##, 2112"##,
1662 }, 2113 },
1663 LintCompletion { 2114 Lint {
1664 label: "core_panic", 2115 label: "core_panic",
1665 description: r##"# `core_panic` 2116 description: r##"# `core_panic`
1666 2117
@@ -1669,7 +2120,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1669------------------------ 2120------------------------
1670"##, 2121"##,
1671 }, 2122 },
1672 LintCompletion { 2123 Lint {
1673 label: "core_private_bignum", 2124 label: "core_private_bignum",
1674 description: r##"# `core_private_bignum` 2125 description: r##"# `core_private_bignum`
1675 2126
@@ -1678,7 +2129,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1678------------------------ 2129------------------------
1679"##, 2130"##,
1680 }, 2131 },
1681 LintCompletion { 2132 Lint {
1682 label: "core_private_diy_float", 2133 label: "core_private_diy_float",
1683 description: r##"# `core_private_diy_float` 2134 description: r##"# `core_private_diy_float`
1684 2135
@@ -1687,7 +2138,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1687------------------------ 2138------------------------
1688"##, 2139"##,
1689 }, 2140 },
1690 LintCompletion { 2141 Lint {
1691 label: "crate_visibility_modifier", 2142 label: "crate_visibility_modifier",
1692 description: r##"# `crate_visibility_modifier` 2143 description: r##"# `crate_visibility_modifier`
1693 2144
@@ -1711,7 +2162,7 @@ crate struct Foo {
1711``` 2162```
1712"##, 2163"##,
1713 }, 2164 },
1714 LintCompletion { 2165 Lint {
1715 label: "custom_test_frameworks", 2166 label: "custom_test_frameworks",
1716 description: r##"# `custom_test_frameworks` 2167 description: r##"# `custom_test_frameworks`
1717 2168
@@ -1747,7 +2198,7 @@ const WILL_FAIL: i32 = 4;
1747``` 2198```
1748"##, 2199"##,
1749 }, 2200 },
1750 LintCompletion { 2201 Lint {
1751 label: "dec2flt", 2202 label: "dec2flt",
1752 description: r##"# `dec2flt` 2203 description: r##"# `dec2flt`
1753 2204
@@ -1756,7 +2207,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1756------------------------ 2207------------------------
1757"##, 2208"##,
1758 }, 2209 },
1759 LintCompletion { 2210 Lint {
1760 label: "default_free_fn", 2211 label: "default_free_fn",
1761 description: r##"# `default_free_fn` 2212 description: r##"# `default_free_fn`
1762 2213
@@ -1807,7 +2258,7 @@ fn main() {
1807``` 2258```
1808"##, 2259"##,
1809 }, 2260 },
1810 LintCompletion { 2261 Lint {
1811 label: "derive_clone_copy", 2262 label: "derive_clone_copy",
1812 description: r##"# `derive_clone_copy` 2263 description: r##"# `derive_clone_copy`
1813 2264
@@ -1816,7 +2267,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1816------------------------ 2267------------------------
1817"##, 2268"##,
1818 }, 2269 },
1819 LintCompletion { 2270 Lint {
1820 label: "derive_eq", 2271 label: "derive_eq",
1821 description: r##"# `derive_eq` 2272 description: r##"# `derive_eq`
1822 2273
@@ -1825,7 +2276,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1825------------------------ 2276------------------------
1826"##, 2277"##,
1827 }, 2278 },
1828 LintCompletion { 2279 Lint {
1829 label: "doc_cfg", 2280 label: "doc_cfg",
1830 description: r##"# `doc_cfg` 2281 description: r##"# `doc_cfg`
1831 2282
@@ -1875,7 +2326,7 @@ pub struct Icon {
1875[#43348]: https://github.com/rust-lang/rust/issues/43348 2326[#43348]: https://github.com/rust-lang/rust/issues/43348
1876"##, 2327"##,
1877 }, 2328 },
1878 LintCompletion { 2329 Lint {
1879 label: "doc_masked", 2330 label: "doc_masked",
1880 description: r##"# `doc_masked` 2331 description: r##"# `doc_masked`
1881 2332
@@ -1903,7 +2354,7 @@ Such types would introduce broken links into the documentation.
1903[#44027]: https://github.com/rust-lang/rust/pull/44027 2354[#44027]: https://github.com/rust-lang/rust/pull/44027
1904"##, 2355"##,
1905 }, 2356 },
1906 LintCompletion { 2357 Lint {
1907 label: "doc_notable_trait", 2358 label: "doc_notable_trait",
1908 description: r##"# `doc_notable_trait` 2359 description: r##"# `doc_notable_trait`
1909 2360
@@ -1940,7 +2391,7 @@ See also its documentation in [the rustdoc book][rustdoc-book-notable_trait].
1940[rustdoc-book-notable_trait]: ../../rustdoc/unstable-features.html#adding-your-trait-to-the-notable-traits-dialog 2391[rustdoc-book-notable_trait]: ../../rustdoc/unstable-features.html#adding-your-trait-to-the-notable-traits-dialog
1941"##, 2392"##,
1942 }, 2393 },
1943 LintCompletion { 2394 Lint {
1944 label: "external_doc", 2395 label: "external_doc",
1945 description: r##"# `external_doc` 2396 description: r##"# `external_doc`
1946 2397
@@ -1984,7 +2435,7 @@ This feature was proposed in [RFC #1990] and initially implemented in PR [#44781
1984[#44781]: https://github.com/rust-lang/rust/pull/44781 2435[#44781]: https://github.com/rust-lang/rust/pull/44781
1985"##, 2436"##,
1986 }, 2437 },
1987 LintCompletion { 2438 Lint {
1988 label: "fd", 2439 label: "fd",
1989 description: r##"# `fd` 2440 description: r##"# `fd`
1990 2441
@@ -1993,7 +2444,7 @@ This feature is internal to the Rust compiler and is not intended for general us
1993------------------------ 2444------------------------
1994"##, 2445"##,
1995 }, 2446 },
1996 LintCompletion { 2447 Lint {
1997 label: "fd_read", 2448 label: "fd_read",
1998 description: r##"# `fd_read` 2449 description: r##"# `fd_read`
1999 2450
@@ -2002,7 +2453,7 @@ This feature is internal to the Rust compiler and is not intended for general us
2002------------------------ 2453------------------------
2003"##, 2454"##,
2004 }, 2455 },
2005 LintCompletion { 2456 Lint {
2006 label: "ffi_const", 2457 label: "ffi_const",
2007 description: r##"# `ffi_const` 2458 description: r##"# `ffi_const`
2008 2459
@@ -2058,7 +2509,7 @@ against are compatible with those of the `#[ffi_const]`.
2058[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_const.htm 2509[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_const.htm
2059"##, 2510"##,
2060 }, 2511 },
2061 LintCompletion { 2512 Lint {
2062 label: "ffi_pure", 2513 label: "ffi_pure",
2063 description: r##"# `ffi_pure` 2514 description: r##"# `ffi_pure`
2064 2515
@@ -2118,7 +2569,7 @@ against are compatible with those of the `#[ffi_pure]`.
2118[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_pure.htm 2569[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_pure.htm
2119"##, 2570"##,
2120 }, 2571 },
2121 LintCompletion { 2572 Lint {
2122 label: "flt2dec", 2573 label: "flt2dec",
2123 description: r##"# `flt2dec` 2574 description: r##"# `flt2dec`
2124 2575
@@ -2127,7 +2578,7 @@ This feature is internal to the Rust compiler and is not intended for general us
2127------------------------ 2578------------------------
2128"##, 2579"##,
2129 }, 2580 },
2130 LintCompletion { 2581 Lint {
2131 label: "fmt_internals", 2582 label: "fmt_internals",
2132 description: r##"# `fmt_internals` 2583 description: r##"# `fmt_internals`
2133 2584
@@ -2136,7 +2587,7 @@ This feature is internal to the Rust compiler and is not intended for general us
2136------------------------ 2587------------------------
2137"##, 2588"##,
2138 }, 2589 },
2139 LintCompletion { 2590 Lint {
2140 label: "fn_traits", 2591 label: "fn_traits",
2141 description: r##"# `fn_traits` 2592 description: r##"# `fn_traits`
2142 2593
@@ -2175,7 +2626,7 @@ fn main() {
2175``` 2626```
2176"##, 2627"##,
2177 }, 2628 },
2178 LintCompletion { 2629 Lint {
2179 label: "format_args_capture", 2630 label: "format_args_capture",
2180 description: r##"# `format_args_capture` 2631 description: r##"# `format_args_capture`
2181 2632
@@ -2226,7 +2677,7 @@ A non-exhaustive list of macros which benefit from this functionality include:
2226- macros in many thirdparty crates, such as `log` 2677- macros in many thirdparty crates, such as `log`
2227"##, 2678"##,
2228 }, 2679 },
2229 LintCompletion { 2680 Lint {
2230 label: "generators", 2681 label: "generators",
2231 description: r##"# `generators` 2682 description: r##"# `generators`
2232 2683
@@ -2476,7 +2927,7 @@ is just a rough desugaring, not a normative specification for what the compiler
2476does. 2927does.
2477"##, 2928"##,
2478 }, 2929 },
2479 LintCompletion { 2930 Lint {
2480 label: "global_asm", 2931 label: "global_asm",
2481 description: r##"# `global_asm` 2932 description: r##"# `global_asm`
2482 2933
@@ -2593,7 +3044,7 @@ assembly to `fn` bodies only, you might try the
2593[asm](asm.md) feature instead. 3044[asm](asm.md) feature instead.
2594"##, 3045"##,
2595 }, 3046 },
2596 LintCompletion { 3047 Lint {
2597 label: "impl_trait_in_bindings", 3048 label: "impl_trait_in_bindings",
2598 description: r##"# `impl_trait_in_bindings` 3049 description: r##"# `impl_trait_in_bindings`
2599 3050
@@ -2625,7 +3076,7 @@ example, calling inherent methods or methods outside of the specified traits
2625(e.g., `a.abs()` or `b.abs()`) is not allowed, and yields an error. 3076(e.g., `a.abs()` or `b.abs()`) is not allowed, and yields an error.
2626"##, 3077"##,
2627 }, 3078 },
2628 LintCompletion { 3079 Lint {
2629 label: "infer_static_outlives_requirements", 3080 label: "infer_static_outlives_requirements",
2630 description: r##"# `infer_static_outlives_requirements` 3081 description: r##"# `infer_static_outlives_requirements`
2631 3082
@@ -2673,7 +3124,7 @@ struct Bar<T: 'static> {
2673``` 3124```
2674"##, 3125"##,
2675 }, 3126 },
2676 LintCompletion { 3127 Lint {
2677 label: "inline_const", 3128 label: "inline_const",
2678 description: r##"# `inline_const` 3129 description: r##"# `inline_const`
2679 3130
@@ -2722,7 +3173,7 @@ match some_int {
2722[#76001]: https://github.com/rust-lang/rust/issues/76001 3173[#76001]: https://github.com/rust-lang/rust/issues/76001
2723"##, 3174"##,
2724 }, 3175 },
2725 LintCompletion { 3176 Lint {
2726 label: "int_error_internals", 3177 label: "int_error_internals",
2727 description: r##"# `int_error_internals` 3178 description: r##"# `int_error_internals`
2728 3179
@@ -2731,7 +3182,7 @@ This feature is internal to the Rust compiler and is not intended for general us
2731------------------------ 3182------------------------
2732"##, 3183"##,
2733 }, 3184 },
2734 LintCompletion { 3185 Lint {
2735 label: "internal_output_capture", 3186 label: "internal_output_capture",
2736 description: r##"# `internal_output_capture` 3187 description: r##"# `internal_output_capture`
2737 3188
@@ -2740,7 +3191,7 @@ This feature is internal to the Rust compiler and is not intended for general us
2740------------------------ 3191------------------------
2741"##, 3192"##,
2742 }, 3193 },
2743 LintCompletion { 3194 Lint {
2744 label: "intra_doc_pointers", 3195 label: "intra_doc_pointers",
2745 description: r##"# `intra-doc-pointers` 3196 description: r##"# `intra-doc-pointers`
2746 3197
@@ -2759,7 +3210,7 @@ raw pointers in intra-doc links are unstable until it does.
2759``` 3210```
2760"##, 3211"##,
2761 }, 3212 },
2762 LintCompletion { 3213 Lint {
2763 label: "intrinsics", 3214 label: "intrinsics",
2764 description: r##"# `intrinsics` 3215 description: r##"# `intrinsics`
2765 3216
@@ -2792,7 +3243,7 @@ extern "rust-intrinsic" {
2792As with any other FFI functions, these are always `unsafe` to call. 3243As with any other FFI functions, these are always `unsafe` to call.
2793"##, 3244"##,
2794 }, 3245 },
2795 LintCompletion { 3246 Lint {
2796 label: "is_sorted", 3247 label: "is_sorted",
2797 description: r##"# `is_sorted` 3248 description: r##"# `is_sorted`
2798 3249
@@ -2807,7 +3258,7 @@ add the methods `is_sorted`, `is_sorted_by` and `is_sorted_by_key` to
2807`Iterator`. 3258`Iterator`.
2808"##, 3259"##,
2809 }, 3260 },
2810 LintCompletion { 3261 Lint {
2811 label: "lang_items", 3262 label: "lang_items",
2812 description: r##"# `lang_items` 3263 description: r##"# `lang_items`
2813 3264
@@ -3106,7 +3557,7 @@ the source code.
3106 - `rc`: `liballoc/rc.rs` 3557 - `rc`: `liballoc/rc.rs`
3107"##, 3558"##,
3108 }, 3559 },
3109 LintCompletion { 3560 Lint {
3110 label: "libstd_sys_internals", 3561 label: "libstd_sys_internals",
3111 description: r##"# `libstd_sys_internals` 3562 description: r##"# `libstd_sys_internals`
3112 3563
@@ -3115,7 +3566,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3115------------------------ 3566------------------------
3116"##, 3567"##,
3117 }, 3568 },
3118 LintCompletion { 3569 Lint {
3119 label: "libstd_thread_internals", 3570 label: "libstd_thread_internals",
3120 description: r##"# `libstd_thread_internals` 3571 description: r##"# `libstd_thread_internals`
3121 3572
@@ -3124,7 +3575,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3124------------------------ 3575------------------------
3125"##, 3576"##,
3126 }, 3577 },
3127 LintCompletion { 3578 Lint {
3128 label: "link_cfg", 3579 label: "link_cfg",
3129 description: r##"# `link_cfg` 3580 description: r##"# `link_cfg`
3130 3581
@@ -3133,7 +3584,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3133------------------------ 3584------------------------
3134"##, 3585"##,
3135 }, 3586 },
3136 LintCompletion { 3587 Lint {
3137 label: "llvm_asm", 3588 label: "llvm_asm",
3138 description: r##"# `llvm_asm` 3589 description: r##"# `llvm_asm`
3139 3590
@@ -3330,7 +3781,7 @@ If you need more power and don't mind losing some of the niceties of
3330`llvm_asm!`, check out [global_asm](global-asm.md). 3781`llvm_asm!`, check out [global_asm](global-asm.md).
3331"##, 3782"##,
3332 }, 3783 },
3333 LintCompletion { 3784 Lint {
3334 label: "marker_trait_attr", 3785 label: "marker_trait_attr",
3335 description: r##"# `marker_trait_attr` 3786 description: r##"# `marker_trait_attr`
3336 3787
@@ -3369,7 +3820,7 @@ This is expected to replace the unstable `overlapping_marker_traits`
3369feature, which applied to all empty traits (without needing an opt-in). 3820feature, which applied to all empty traits (without needing an opt-in).
3370"##, 3821"##,
3371 }, 3822 },
3372 LintCompletion { 3823 Lint {
3373 label: "native_link_modifiers", 3824 label: "native_link_modifiers",
3374 description: r##"# `native_link_modifiers` 3825 description: r##"# `native_link_modifiers`
3375 3826
@@ -3384,7 +3835,7 @@ The `native_link_modifiers` feature allows you to use the `modifiers` syntax wit
3384Modifiers are specified as a comma-delimited string with each modifier prefixed with either a `+` or `-` to indicate that the modifier is enabled or disabled, respectively. The last boolean value specified for a given modifier wins. 3835Modifiers are specified as a comma-delimited string with each modifier prefixed with either a `+` or `-` to indicate that the modifier is enabled or disabled, respectively. The last boolean value specified for a given modifier wins.
3385"##, 3836"##,
3386 }, 3837 },
3387 LintCompletion { 3838 Lint {
3388 label: "native_link_modifiers_as_needed", 3839 label: "native_link_modifiers_as_needed",
3389 description: r##"# `native_link_modifiers_as_needed` 3840 description: r##"# `native_link_modifiers_as_needed`
3390 3841
@@ -3406,7 +3857,7 @@ The modifier does nothing for linkers that don't support it (e.g. `link.exe`).
3406The default for this modifier is unclear, some targets currently specify it as `+as-needed`, some do not. We may want to try making `+as-needed` a default for all targets. 3857The default for this modifier is unclear, some targets currently specify it as `+as-needed`, some do not. We may want to try making `+as-needed` a default for all targets.
3407"##, 3858"##,
3408 }, 3859 },
3409 LintCompletion { 3860 Lint {
3410 label: "native_link_modifiers_bundle", 3861 label: "native_link_modifiers_bundle",
3411 description: r##"# `native_link_modifiers_bundle` 3862 description: r##"# `native_link_modifiers_bundle`
3412 3863
@@ -3429,7 +3880,7 @@ This modifier is supposed to supersede the `static-nobundle` linking kind define
3429The default for this modifier is currently `+bundle`, but it could be changed later on some future edition boundary. 3880The default for this modifier is currently `+bundle`, but it could be changed later on some future edition boundary.
3430"##, 3881"##,
3431 }, 3882 },
3432 LintCompletion { 3883 Lint {
3433 label: "native_link_modifiers_verbatim", 3884 label: "native_link_modifiers_verbatim",
3434 description: r##"# `native_link_modifiers_verbatim` 3885 description: r##"# `native_link_modifiers_verbatim`
3435 3886
@@ -3453,7 +3904,7 @@ This RFC changes the behavior of `raw-dylib` linking kind specified by [RFC 2627
3453If your DLL doesn't have the `.dll` suffix, it can be specified with `+verbatim`. 3904If your DLL doesn't have the `.dll` suffix, it can be specified with `+verbatim`.
3454"##, 3905"##,
3455 }, 3906 },
3456 LintCompletion { 3907 Lint {
3457 label: "native_link_modifiers_whole_archive", 3908 label: "native_link_modifiers_whole_archive",
3458 description: r##"# `native_link_modifiers_whole_archive` 3909 description: r##"# `native_link_modifiers_whole_archive`
3459 3910
@@ -3475,7 +3926,7 @@ The modifier does nothing for linkers that don't support it.
3475The default for this modifier is `-whole-archive`. 3926The default for this modifier is `-whole-archive`.
3476"##, 3927"##,
3477 }, 3928 },
3478 LintCompletion { 3929 Lint {
3479 label: "negative_impls", 3930 label: "negative_impls",
3480 description: r##"# `negative_impls` 3931 description: r##"# `negative_impls`
3481 3932
@@ -3536,7 +3987,7 @@ This serves two purposes:
3536* It prevents downstream crates from creating such impls. 3987* It prevents downstream crates from creating such impls.
3537"##, 3988"##,
3538 }, 3989 },
3539 LintCompletion { 3990 Lint {
3540 label: "no_coverage", 3991 label: "no_coverage",
3541 description: r##"# `no_coverage` 3992 description: r##"# `no_coverage`
3542 3993
@@ -3570,7 +4021,7 @@ fn bar() {
3570``` 4021```
3571"##, 4022"##,
3572 }, 4023 },
3573 LintCompletion { 4024 Lint {
3574 label: "no_sanitize", 4025 label: "no_sanitize",
3575 description: r##"# `no_sanitize` 4026 description: r##"# `no_sanitize`
3576 4027
@@ -3603,7 +4054,7 @@ fn foo() {
3603``` 4054```
3604"##, 4055"##,
3605 }, 4056 },
3606 LintCompletion { 4057 Lint {
3607 label: "plugin", 4058 label: "plugin",
3608 description: r##"# `plugin` 4059 description: r##"# `plugin`
3609 4060
@@ -3726,7 +4177,7 @@ You can run `rustc -W help foo.rs` to see a list of lints known to `rustc`,
3726including those provided by plugins loaded by `foo.rs`. 4177including those provided by plugins loaded by `foo.rs`.
3727"##, 4178"##,
3728 }, 4179 },
3729 LintCompletion { 4180 Lint {
3730 label: "plugin_registrar", 4181 label: "plugin_registrar",
3731 description: r##"# `plugin_registrar` 4182 description: r##"# `plugin_registrar`
3732 4183
@@ -3743,7 +4194,7 @@ their docs.
3743------------------------ 4194------------------------
3744"##, 4195"##,
3745 }, 4196 },
3746 LintCompletion { 4197 Lint {
3747 label: "print_internals", 4198 label: "print_internals",
3748 description: r##"# `print_internals` 4199 description: r##"# `print_internals`
3749 4200
@@ -3752,7 +4203,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3752------------------------ 4203------------------------
3753"##, 4204"##,
3754 }, 4205 },
3755 LintCompletion { 4206 Lint {
3756 label: "profiler_runtime", 4207 label: "profiler_runtime",
3757 description: r##"# `profiler_runtime` 4208 description: r##"# `profiler_runtime`
3758 4209
@@ -3761,7 +4212,7 @@ The tracking issue for this feature is: [#42524](https://github.com/rust-lang/ru
3761------------------------ 4212------------------------
3762"##, 4213"##,
3763 }, 4214 },
3764 LintCompletion { 4215 Lint {
3765 label: "profiler_runtime_lib", 4216 label: "profiler_runtime_lib",
3766 description: r##"# `profiler_runtime_lib` 4217 description: r##"# `profiler_runtime_lib`
3767 4218
@@ -3770,7 +4221,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3770------------------------ 4221------------------------
3771"##, 4222"##,
3772 }, 4223 },
3773 LintCompletion { 4224 Lint {
3774 label: "repr128", 4225 label: "repr128",
3775 description: r##"# `repr128` 4226 description: r##"# `repr128`
3776 4227
@@ -3792,7 +4243,7 @@ enum Foo {
3792``` 4243```
3793"##, 4244"##,
3794 }, 4245 },
3795 LintCompletion { 4246 Lint {
3796 label: "rt", 4247 label: "rt",
3797 description: r##"# `rt` 4248 description: r##"# `rt`
3798 4249
@@ -3801,7 +4252,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3801------------------------ 4252------------------------
3802"##, 4253"##,
3803 }, 4254 },
3804 LintCompletion { 4255 Lint {
3805 label: "rustc_attrs", 4256 label: "rustc_attrs",
3806 description: r##"# `rustc_attrs` 4257 description: r##"# `rustc_attrs`
3807 4258
@@ -3858,7 +4309,7 @@ error: aborting due to 2 previous errors
3858``` 4309```
3859"##, 4310"##,
3860 }, 4311 },
3861 LintCompletion { 4312 Lint {
3862 label: "sort_internals", 4313 label: "sort_internals",
3863 description: r##"# `sort_internals` 4314 description: r##"# `sort_internals`
3864 4315
@@ -3867,7 +4318,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3867------------------------ 4318------------------------
3868"##, 4319"##,
3869 }, 4320 },
3870 LintCompletion { 4321 Lint {
3871 label: "str_internals", 4322 label: "str_internals",
3872 description: r##"# `str_internals` 4323 description: r##"# `str_internals`
3873 4324
@@ -3876,7 +4327,7 @@ This feature is internal to the Rust compiler and is not intended for general us
3876------------------------ 4327------------------------
3877"##, 4328"##,
3878 }, 4329 },
3879 LintCompletion { 4330 Lint {
3880 label: "test", 4331 label: "test",
3881 description: r##"# `test` 4332 description: r##"# `test`
3882 4333
@@ -4038,7 +4489,7 @@ However, the optimizer can still modify a testcase in an undesirable manner
4038even when using either of the above. 4489even when using either of the above.
4039"##, 4490"##,
4040 }, 4491 },
4041 LintCompletion { 4492 Lint {
4042 label: "thread_local_internals", 4493 label: "thread_local_internals",
4043 description: r##"# `thread_local_internals` 4494 description: r##"# `thread_local_internals`
4044 4495
@@ -4047,7 +4498,7 @@ This feature is internal to the Rust compiler and is not intended for general us
4047------------------------ 4498------------------------
4048"##, 4499"##,
4049 }, 4500 },
4050 LintCompletion { 4501 Lint {
4051 label: "trace_macros", 4502 label: "trace_macros",
4052 description: r##"# `trace_macros` 4503 description: r##"# `trace_macros`
4053 4504
@@ -4090,7 +4541,7 @@ note: trace_macro
4090``` 4541```
4091"##, 4542"##,
4092 }, 4543 },
4093 LintCompletion { 4544 Lint {
4094 label: "trait_alias", 4545 label: "trait_alias",
4095 description: r##"# `trait_alias` 4546 description: r##"# `trait_alias`
4096 4547
@@ -4128,7 +4579,7 @@ pub fn main() {
4128``` 4579```
4129"##, 4580"##,
4130 }, 4581 },
4131 LintCompletion { 4582 Lint {
4132 label: "transparent_unions", 4583 label: "transparent_unions",
4133 description: r##"# `transparent_unions` 4584 description: r##"# `transparent_unions`
4134 4585
@@ -4215,7 +4666,7 @@ possible, but is not required to, and different compiler versions may differ in
4215their application of these optimizations. 4666their application of these optimizations.
4216"##, 4667"##,
4217 }, 4668 },
4218 LintCompletion { 4669 Lint {
4219 label: "try_blocks", 4670 label: "try_blocks",
4220 description: r##"# `try_blocks` 4671 description: r##"# `try_blocks`
4221 4672
@@ -4249,7 +4700,7 @@ assert!(result.is_err());
4249``` 4700```
4250"##, 4701"##,
4251 }, 4702 },
4252 LintCompletion { 4703 Lint {
4253 label: "try_trait", 4704 label: "try_trait",
4254 description: r##"# `try_trait` 4705 description: r##"# `try_trait`
4255 4706
@@ -4303,7 +4754,7 @@ function (or catch block). Having a distinct error type (as opposed to
4303just `()`, or similar) restricts this to where it's semantically meaningful. 4754just `()`, or similar) restricts this to where it's semantically meaningful.
4304"##, 4755"##,
4305 }, 4756 },
4306 LintCompletion { 4757 Lint {
4307 label: "unboxed_closures", 4758 label: "unboxed_closures",
4308 description: r##"# `unboxed_closures` 4759 description: r##"# `unboxed_closures`
4309 4760
@@ -4332,7 +4783,7 @@ fn main() {}
4332``` 4783```
4333"##, 4784"##,
4334 }, 4785 },
4335 LintCompletion { 4786 Lint {
4336 label: "unsized_locals", 4787 label: "unsized_locals",
4337 description: r##"# `unsized_locals` 4788 description: r##"# `unsized_locals`
4338 4789
@@ -4511,7 +4962,7 @@ fn main() {
4511will unnecessarily extend the stack frame. 4962will unnecessarily extend the stack frame.
4512"##, 4963"##,
4513 }, 4964 },
4514 LintCompletion { 4965 Lint {
4515 label: "unsized_tuple_coercion", 4966 label: "unsized_tuple_coercion",
4516 description: r##"# `unsized_tuple_coercion` 4967 description: r##"# `unsized_tuple_coercion`
4517 4968
@@ -4542,7 +4993,7 @@ fn main() {
4542[RFC0401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md 4993[RFC0401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
4543"##, 4994"##,
4544 }, 4995 },
4545 LintCompletion { 4996 Lint {
4546 label: "update_panic_count", 4997 label: "update_panic_count",
4547 description: r##"# `update_panic_count` 4998 description: r##"# `update_panic_count`
4548 4999
@@ -4551,7 +5002,7 @@ This feature is internal to the Rust compiler and is not intended for general us
4551------------------------ 5002------------------------
4552"##, 5003"##,
4553 }, 5004 },
4554 LintCompletion { 5005 Lint {
4555 label: "windows_c", 5006 label: "windows_c",
4556 description: r##"# `windows_c` 5007 description: r##"# `windows_c`
4557 5008
@@ -4560,7 +5011,7 @@ This feature is internal to the Rust compiler and is not intended for general us
4560------------------------ 5011------------------------
4561"##, 5012"##,
4562 }, 5013 },
4563 LintCompletion { 5014 Lint {
4564 label: "windows_handle", 5015 label: "windows_handle",
4565 description: r##"# `windows_handle` 5016 description: r##"# `windows_handle`
4566 5017
@@ -4569,7 +5020,7 @@ This feature is internal to the Rust compiler and is not intended for general us
4569------------------------ 5020------------------------
4570"##, 5021"##,
4571 }, 5022 },
4572 LintCompletion { 5023 Lint {
4573 label: "windows_net", 5024 label: "windows_net",
4574 description: r##"# `windows_net` 5025 description: r##"# `windows_net`
4575 5026
@@ -4578,7 +5029,7 @@ This feature is internal to the Rust compiler and is not intended for general us
4578------------------------ 5029------------------------
4579"##, 5030"##,
4580 }, 5031 },
4581 LintCompletion { 5032 Lint {
4582 label: "windows_stdio", 5033 label: "windows_stdio",
4583 description: r##"# `windows_stdio` 5034 description: r##"# `windows_stdio`
4584 5035
@@ -4589,1899 +5040,1851 @@ This feature is internal to the Rust compiler and is not intended for general us
4589 }, 5040 },
4590]; 5041];
4591 5042
4592pub const CLIPPY_LINTS: &[LintCompletion] = &[ 5043pub const CLIPPY_LINTS: &[Lint] = &[
4593 LintCompletion { 5044 Lint {
4594 label: "clippy::absurd_extreme_comparisons", 5045 label: "clippy::absurd_extreme_comparisons",
4595 description: r##"Checks for comparisons where one side of the relation is\neither the minimum or maximum value for its type and warns if it involves a\ncase that is always true or always false. Only integer and boolean types are\nchecked."##, 5046 description: r##"Checks for comparisons where one side of the relation is\neither the minimum or maximum value for its type and warns if it involves a\ncase that is always true or always false. Only integer and boolean types are\nchecked."##,
4596 }, 5047 },
4597 LintCompletion { 5048 Lint {
4598 label: "clippy::almost_swapped", 5049 label: "clippy::almost_swapped",
4599 description: r##"Checks for `foo = bar; bar = foo` sequences."##, 5050 description: r##"Checks for `foo = bar; bar = foo` sequences."##,
4600 }, 5051 },
4601 LintCompletion { 5052 Lint {
4602 label: "clippy::approx_constant", 5053 label: "clippy::approx_constant",
4603 description: r##"Checks for floating point literals that approximate\nconstants which are defined in\n[`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)\nor\n[`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),\nrespectively, suggesting to use the predefined constant."##, 5054 description: r##"Checks for floating point literals that approximate\nconstants which are defined in\n[`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)\nor\n[`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),\nrespectively, suggesting to use the predefined constant."##,
4604 }, 5055 },
4605 LintCompletion { 5056 Lint {
4606 label: "clippy::as_conversions", 5057 label: "clippy::as_conversions",
4607 description: r##"Checks for usage of `as` conversions.\n\nNote that this lint is specialized in linting *every single* use of `as`\nregardless of whether good alternatives exist or not.\nIf you want more precise lints for `as`, please consider using these separate lints:\n`unnecessary_cast`, `cast_lossless/possible_truncation/possible_wrap/precision_loss/sign_loss`,\n`fn_to_numeric_cast(_with_truncation)`, `char_lit_as_u8`, `ref_to_mut` and `ptr_as_ptr`.\nThere is a good explanation the reason why this lint should work in this way and how it is useful\n[in this issue](https://github.com/rust-lang/rust-clippy/issues/5122)."##, 5058 description: r##"Checks for usage of `as` conversions.\n\nNote that this lint is specialized in linting *every single* use of `as`\nregardless of whether good alternatives exist or not.\nIf you want more precise lints for `as`, please consider using these separate lints:\n`unnecessary_cast`, `cast_lossless/possible_truncation/possible_wrap/precision_loss/sign_loss`,\n`fn_to_numeric_cast(_with_truncation)`, `char_lit_as_u8`, `ref_to_mut` and `ptr_as_ptr`.\nThere is a good explanation the reason why this lint should work in this way and how it is useful\n[in this issue](https://github.com/rust-lang/rust-clippy/issues/5122)."##,
4608 }, 5059 },
4609 LintCompletion { 5060 Lint {
4610 label: "clippy::assertions_on_constants", 5061 label: "clippy::assertions_on_constants",
4611 description: r##"Checks for `assert!(true)` and `assert!(false)` calls."##, 5062 description: r##"Checks for `assert!(true)` and `assert!(false)` calls."##,
4612 }, 5063 },
4613 LintCompletion { 5064 Lint {
4614 label: "clippy::assign_op_pattern", 5065 label: "clippy::assign_op_pattern",
4615 description: r##"Checks for `a = a op b` or `a = b commutative_op a`\npatterns."##, 5066 description: r##"Checks for `a = a op b` or `a = b commutative_op a`\npatterns."##,
4616 }, 5067 },
4617 LintCompletion { 5068 Lint {
4618 label: "clippy::assign_ops", 5069 label: "clippy::assign_ops",
4619 description: r##"Nothing. This lint has been deprecated."##, 5070 description: r##"Nothing. This lint has been deprecated."##,
4620 }, 5071 },
4621 LintCompletion { 5072 Lint {
4622 label: "clippy::async_yields_async", 5073 label: "clippy::async_yields_async",
4623 description: r##"Checks for async blocks that yield values of types\nthat can themselves be awaited."##, 5074 description: r##"Checks for async blocks that yield values of types\nthat can themselves be awaited."##,
4624 }, 5075 },
4625 LintCompletion { 5076 Lint {
4626 label: "clippy::await_holding_lock", 5077 label: "clippy::await_holding_lock",
4627 description: r##"Checks for calls to await while holding a\nnon-async-aware MutexGuard."##, 5078 description: r##"Checks for calls to await while holding a\nnon-async-aware MutexGuard."##,
4628 }, 5079 },
4629 LintCompletion { 5080 Lint {
4630 label: "clippy::await_holding_refcell_ref", 5081 label: "clippy::await_holding_refcell_ref",
4631 description: r##"Checks for calls to await while holding a\n`RefCell` `Ref` or `RefMut`."##, 5082 description: r##"Checks for calls to await while holding a\n`RefCell` `Ref` or `RefMut`."##,
4632 }, 5083 },
4633 LintCompletion { 5084 Lint {
4634 label: "clippy::bad_bit_mask", 5085 label: "clippy::bad_bit_mask",
4635 description: r##"Checks for incompatible bit masks in comparisons.\n\nThe formula for detecting if an expression of the type `_ <bit_op> m\n<cmp_op> c` (where `<bit_op>` is one of {`&`, `|`} and `<cmp_op>` is one of\n{`!=`, `>=`, `>`, `!=`, `>=`, `>`}) can be determined from the following\ntable:\n\n|Comparison |Bit Op|Example |is always|Formula |\n|------------|------|------------|---------|----------------------|\n|`==` or `!=`| `&` |`x & 2 == 3`|`false` |`c & m != c` |\n|`<` or `>=`| `&` |`x & 2 < 3` |`true` |`m < c` |\n|`>` or `<=`| `&` |`x & 1 > 1` |`false` |`m <= c` |\n|`==` or `!=`| `|` |`x | 1 == 0`|`false` |`c | m != c` |\n|`<` or `>=`| `|` |`x | 1 < 1` |`false` |`m >= c` |\n|`<=` or `>` | `|` |`x | 1 > 0` |`true` |`m > c` |"##, 5086 description: r##"Checks for incompatible bit masks in comparisons.\n\nThe formula for detecting if an expression of the type `_ <bit_op> m\n<cmp_op> c` (where `<bit_op>` is one of {`&`, `|`} and `<cmp_op>` is one of\n{`!=`, `>=`, `>`, `!=`, `>=`, `>`}) can be determined from the following\ntable:\n\n|Comparison |Bit Op|Example |is always|Formula |\n|------------|------|------------|---------|----------------------|\n|`==` or `!=`| `&` |`x & 2 == 3`|`false` |`c & m != c` |\n|`<` or `>=`| `&` |`x & 2 < 3` |`true` |`m < c` |\n|`>` or `<=`| `&` |`x & 1 > 1` |`false` |`m <= c` |\n|`==` or `!=`| `|` |`x | 1 == 0`|`false` |`c | m != c` |\n|`<` or `>=`| `|` |`x | 1 < 1` |`false` |`m >= c` |\n|`<=` or `>` | `|` |`x | 1 > 0` |`true` |`m > c` |"##,
4636 }, 5087 },
4637 LintCompletion { 5088 Lint {
4638 label: "clippy::bind_instead_of_map", 5089 label: "clippy::bind_instead_of_map",
4639 description: r##"Checks for usage of `_.and_then(|x| Some(y))`, `_.and_then(|x| Ok(y))` or\n`_.or_else(|x| Err(y))`."##, 5090 description: r##"Checks for usage of `_.and_then(|x| Some(y))`, `_.and_then(|x| Ok(y))` or\n`_.or_else(|x| Err(y))`."##,
4640 }, 5091 },
4641 LintCompletion { 5092 Lint {
4642 label: "clippy::blacklisted_name", 5093 label: "clippy::blacklisted_name",
4643 description: r##"Checks for usage of blacklisted names for variables, such\nas `foo`."##, 5094 description: r##"Checks for usage of blacklisted names for variables, such\nas `foo`."##,
4644 }, 5095 },
4645 LintCompletion { 5096 Lint {
4646 label: "clippy::blanket_clippy_restriction_lints", 5097 label: "clippy::blanket_clippy_restriction_lints",
4647 description: r##"Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category."##, 5098 description: r##"Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category."##,
4648 }, 5099 },
4649 LintCompletion { 5100 Lint {
4650 label: "clippy::blocks_in_if_conditions", 5101 label: "clippy::blocks_in_if_conditions",
4651 description: r##"Checks for `if` conditions that use blocks containing an\nexpression, statements or conditions that use closures with blocks."##, 5102 description: r##"Checks for `if` conditions that use blocks containing an\nexpression, statements or conditions that use closures with blocks."##,
4652 }, 5103 },
4653 LintCompletion { 5104 Lint {
4654 label: "clippy::bool_assert_comparison", 5105 label: "clippy::bool_assert_comparison",
4655 description: r##"This lint warns about boolean comparisons in assert-like macros."##, 5106 description: r##"This lint warns about boolean comparisons in assert-like macros."##,
4656 }, 5107 },
4657 LintCompletion { 5108 Lint {
4658 label: "clippy::bool_comparison", 5109 label: "clippy::bool_comparison",
4659 description: r##"Checks for expressions of the form `x == true`,\n`x != true` and order comparisons such as `x < true` (or vice versa) and\nsuggest using the variable directly."##, 5110 description: r##"Checks for expressions of the form `x == true`,\n`x != true` and order comparisons such as `x < true` (or vice versa) and\nsuggest using the variable directly."##,
4660 }, 5111 },
4661 LintCompletion { 5112 Lint {
4662 label: "clippy::borrow_interior_mutable_const", 5113 label: "clippy::borrow_interior_mutable_const",
4663 description: r##"Checks if `const` items which is interior mutable (e.g.,\ncontains a `Cell`, `Mutex`, `AtomicXxxx`, etc.) has been borrowed directly."##, 5114 description: r##"Checks if `const` items which is interior mutable (e.g.,\ncontains a `Cell`, `Mutex`, `AtomicXxxx`, etc.) has been borrowed directly."##,
4664 }, 5115 },
4665 LintCompletion { 5116 Lint {
4666 label: "clippy::borrowed_box", 5117 label: "clippy::borrowed_box",
4667 description: r##"Checks for use of `&Box<T>` anywhere in the code.\nCheck the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##, 5118 description: r##"Checks for use of `&Box<T>` anywhere in the code.\nCheck the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
4668 }, 5119 },
4669 LintCompletion { 5120 Lint {
4670 label: "clippy::box_vec", 5121 label: "clippy::box_vec",
4671 description: r##"Checks for use of `Box<Vec<_>>` anywhere in the code.\nCheck the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##, 5122 description: r##"Checks for use of `Box<Vec<_>>` anywhere in the code.\nCheck the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
4672 }, 5123 },
4673 LintCompletion { 5124 Lint {
4674 label: "clippy::boxed_local", 5125 label: "clippy::boxed_local",
4675 description: r##"Checks for usage of `Box<T>` where an unboxed `T` would\nwork fine."##, 5126 description: r##"Checks for usage of `Box<T>` where an unboxed `T` would\nwork fine."##,
4676 }, 5127 },
4677 LintCompletion { 5128 Lint {
4678 label: "clippy::branches_sharing_code", 5129 label: "clippy::branches_sharing_code",
4679 description: r##"Checks if the `if` and `else` block contain shared code that can be\nmoved out of the blocks."##, 5130 description: r##"Checks if the `if` and `else` block contain shared code that can be\nmoved out of the blocks."##,
4680 }, 5131 },
4681 LintCompletion { 5132 Lint {
4682 label: "clippy::builtin_type_shadow", 5133 label: "clippy::builtin_type_shadow",
4683 description: r##"Warns if a generic shadows a built-in type."##, 5134 description: r##"Warns if a generic shadows a built-in type."##,
4684 }, 5135 },
4685 LintCompletion { 5136 Lint {
4686 label: "clippy::bytes_nth", 5137 label: "clippy::bytes_nth",
4687 description: r##"Checks for the use of `.bytes().nth()`."##, 5138 description: r##"Checks for the use of `.bytes().nth()`."##,
4688 }, 5139 },
4689 LintCompletion { 5140 Lint {
4690 label: "clippy::cargo_common_metadata", 5141 label: "clippy::cargo_common_metadata",
4691 description: r##"Checks to see if all common metadata is defined in\n`Cargo.toml`. See: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#cargotoml-includes-all-common-metadata-c-metadata"##, 5142 description: r##"Checks to see if all common metadata is defined in\n`Cargo.toml`. See: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#cargotoml-includes-all-common-metadata-c-metadata"##,
4692 }, 5143 },
4693 LintCompletion { 5144 Lint {
4694 label: "clippy::case_sensitive_file_extension_comparisons", 5145 label: "clippy::case_sensitive_file_extension_comparisons",
4695 description: r##"Checks for calls to `ends_with` with possible file extensions\nand suggests to use a case-insensitive approach instead."##, 5146 description: r##"Checks for calls to `ends_with` with possible file extensions\nand suggests to use a case-insensitive approach instead."##,
4696 }, 5147 },
4697 LintCompletion { 5148 Lint {
4698 label: "clippy::cast_lossless", 5149 label: "clippy::cast_lossless",
4699 description: r##"Checks for casts between numerical types that may\nbe replaced by safe conversion functions."##, 5150 description: r##"Checks for casts between numerical types that may\nbe replaced by safe conversion functions."##,
4700 }, 5151 },
4701 LintCompletion { 5152 Lint {
4702 label: "clippy::cast_possible_truncation", 5153 label: "clippy::cast_possible_truncation",
4703 description: r##"Checks for casts between numerical types that may\ntruncate large values. This is expected behavior, so the cast is `Allow` by\ndefault."##, 5154 description: r##"Checks for casts between numerical types that may\ntruncate large values. This is expected behavior, so the cast is `Allow` by\ndefault."##,
4704 }, 5155 },
4705 LintCompletion { 5156 Lint {
4706 label: "clippy::cast_possible_wrap", 5157 label: "clippy::cast_possible_wrap",
4707 description: r##"Checks for casts from an unsigned type to a signed type of\nthe same size. Performing such a cast is a 'no-op' for the compiler,\ni.e., nothing is changed at the bit level, and the binary representation of\nthe value is reinterpreted. This can cause wrapping if the value is too big\nfor the target signed type. However, the cast works as defined, so this lint\nis `Allow` by default."##, 5158 description: r##"Checks for casts from an unsigned type to a signed type of\nthe same size. Performing such a cast is a 'no-op' for the compiler,\ni.e., nothing is changed at the bit level, and the binary representation of\nthe value is reinterpreted. This can cause wrapping if the value is too big\nfor the target signed type. However, the cast works as defined, so this lint\nis `Allow` by default."##,
4708 }, 5159 },
4709 LintCompletion { 5160 Lint {
4710 label: "clippy::cast_precision_loss", 5161 label: "clippy::cast_precision_loss",
4711 description: r##"Checks for casts from any numerical to a float type where\nthe receiving type cannot store all values from the original type without\nrounding errors. This possible rounding is to be expected, so this lint is\n`Allow` by default.\n\nBasically, this warns on casting any integer with 32 or more bits to `f32`\nor any 64-bit integer to `f64`."##, 5162 description: r##"Checks for casts from any numerical to a float type where\nthe receiving type cannot store all values from the original type without\nrounding errors. This possible rounding is to be expected, so this lint is\n`Allow` by default.\n\nBasically, this warns on casting any integer with 32 or more bits to `f32`\nor any 64-bit integer to `f64`."##,
4712 }, 5163 },
4713 LintCompletion { 5164 Lint {
4714 label: "clippy::cast_ptr_alignment", 5165 label: "clippy::cast_ptr_alignment",
4715 description: r##"Checks for casts, using `as` or `pointer::cast`,\nfrom a less-strictly-aligned pointer to a more-strictly-aligned pointer"##, 5166 description: r##"Checks for casts, using `as` or `pointer::cast`,\nfrom a less-strictly-aligned pointer to a more-strictly-aligned pointer"##,
4716 }, 5167 },
4717 LintCompletion { 5168 Lint {
4718 label: "clippy::cast_ref_to_mut", 5169 label: "clippy::cast_ref_to_mut",
4719 description: r##"Checks for casts of `&T` to `&mut T` anywhere in the code."##, 5170 description: r##"Checks for casts of `&T` to `&mut T` anywhere in the code."##,
4720 }, 5171 },
4721 LintCompletion { 5172 Lint {
4722 label: "clippy::cast_sign_loss", 5173 label: "clippy::cast_sign_loss",
4723 description: r##"Checks for casts from a signed to an unsigned numerical\ntype. In this case, negative values wrap around to large positive values,\nwhich can be quite surprising in practice. However, as the cast works as\ndefined, this lint is `Allow` by default."##, 5174 description: r##"Checks for casts from a signed to an unsigned numerical\ntype. In this case, negative values wrap around to large positive values,\nwhich can be quite surprising in practice. However, as the cast works as\ndefined, this lint is `Allow` by default."##,
4724 }, 5175 },
4725 LintCompletion { 5176 Lint {
4726 label: "clippy::char_lit_as_u8", 5177 label: "clippy::char_lit_as_u8",
4727 description: r##"Checks for expressions where a character literal is cast\nto `u8` and suggests using a byte literal instead."##, 5178 description: r##"Checks for expressions where a character literal is cast\nto `u8` and suggests using a byte literal instead."##,
4728 }, 5179 },
4729 LintCompletion { 5180 Lint {
4730 label: "clippy::chars_last_cmp", 5181 label: "clippy::chars_last_cmp",
4731 description: r##"Checks for usage of `_.chars().last()` or\n`_.chars().next_back()` on a `str` to check if it ends with a given char."##, 5182 description: r##"Checks for usage of `_.chars().last()` or\n`_.chars().next_back()` on a `str` to check if it ends with a given char."##,
4732 }, 5183 },
4733 LintCompletion { 5184 Lint {
4734 label: "clippy::chars_next_cmp", 5185 label: "clippy::chars_next_cmp",
4735 description: r##"Checks for usage of `.chars().next()` on a `str` to check\nif it starts with a given char."##, 5186 description: r##"Checks for usage of `.chars().next()` on a `str` to check\nif it starts with a given char."##,
4736 }, 5187 },
4737 LintCompletion { 5188 Lint {
4738 label: "clippy::checked_conversions", 5189 label: "clippy::checked_conversions",
4739 description: r##"Checks for explicit bounds checking when casting."##, 5190 description: r##"Checks for explicit bounds checking when casting."##,
4740 }, 5191 },
4741 LintCompletion { 5192 Lint {
4742 label: "clippy::clone_double_ref", 5193 label: "clippy::clone_double_ref",
4743 description: r##"Checks for usage of `.clone()` on an `&&T`."##, 5194 description: r##"Checks for usage of `.clone()` on an `&&T`."##,
4744 }, 5195 },
4745 LintCompletion { 5196 Lint {
4746 label: "clippy::clone_on_copy", 5197 label: "clippy::clone_on_copy",
4747 description: r##"Checks for usage of `.clone()` on a `Copy` type."##, 5198 description: r##"Checks for usage of `.clone()` on a `Copy` type."##,
4748 }, 5199 },
4749 LintCompletion { 5200 Lint {
4750 label: "clippy::clone_on_ref_ptr", 5201 label: "clippy::clone_on_ref_ptr",
4751 description: r##"Checks for usage of `.clone()` on a ref-counted pointer,\n(`Rc`, `Arc`, `rc::Weak`, or `sync::Weak`), and suggests calling Clone via unified\nfunction syntax instead (e.g., `Rc::clone(foo)`)."##, 5202 description: r##"Checks for usage of `.clone()` on a ref-counted pointer,\n(`Rc`, `Arc`, `rc::Weak`, or `sync::Weak`), and suggests calling Clone via unified\nfunction syntax instead (e.g., `Rc::clone(foo)`)."##,
4752 }, 5203 },
4753 LintCompletion { 5204 Lint {
4754 label: "clippy::cloned_instead_of_copied", 5205 label: "clippy::cloned_instead_of_copied",
4755 description: r##"Checks for usages of `cloned()` on an `Iterator` or `Option` where\n`copied()` could be used instead."##, 5206 description: r##"Checks for usages of `cloned()` on an `Iterator` or `Option` where\n`copied()` could be used instead."##,
4756 }, 5207 },
4757 LintCompletion { label: "clippy::cmp_nan", description: r##"Checks for comparisons to NaN."## }, 5208 Lint { label: "clippy::cmp_nan", description: r##"Checks for comparisons to NaN."## },
4758 LintCompletion { 5209 Lint {
4759 label: "clippy::cmp_null", 5210 label: "clippy::cmp_null",
4760 description: r##"This lint checks for equality comparisons with `ptr::null`"##, 5211 description: r##"This lint checks for equality comparisons with `ptr::null`"##,
4761 }, 5212 },
4762 LintCompletion { 5213 Lint {
4763 label: "clippy::cmp_owned", 5214 label: "clippy::cmp_owned",
4764 description: r##"Checks for conversions to owned values just for the sake\nof a comparison."##, 5215 description: r##"Checks for conversions to owned values just for the sake\nof a comparison."##,
4765 }, 5216 },
4766 LintCompletion { 5217 Lint {
4767 label: "clippy::cognitive_complexity", 5218 label: "clippy::cognitive_complexity",
4768 description: r##"Checks for methods with high cognitive complexity."##, 5219 description: r##"Checks for methods with high cognitive complexity."##,
4769 }, 5220 },
4770 LintCompletion { 5221 Lint {
4771 label: "clippy::collapsible_else_if", 5222 label: "clippy::collapsible_else_if",
4772 description: r##"Checks for collapsible `else { if ... }` expressions\nthat can be collapsed to `else if ...`."##, 5223 description: r##"Checks for collapsible `else { if ... }` expressions\nthat can be collapsed to `else if ...`."##,
4773 }, 5224 },
4774 LintCompletion { 5225 Lint {
4775 label: "clippy::collapsible_if", 5226 label: "clippy::collapsible_if",
4776 description: r##"Checks for nested `if` statements which can be collapsed\nby `&&`-combining their conditions."##, 5227 description: r##"Checks for nested `if` statements which can be collapsed\nby `&&`-combining their conditions."##,
4777 }, 5228 },
4778 LintCompletion { 5229 Lint {
4779 label: "clippy::collapsible_match", 5230 label: "clippy::collapsible_match",
4780 description: r##"Finds nested `match` or `if let` expressions where the patterns may be \"collapsed\" together\nwithout adding any branches.\n\nNote that this lint is not intended to find _all_ cases where nested match patterns can be merged, but only\ncases where merging would most likely make the code more readable."##, 5231 description: r##"Finds nested `match` or `if let` expressions where the patterns may be \"collapsed\" together\nwithout adding any branches.\n\nNote that this lint is not intended to find _all_ cases where nested match patterns can be merged, but only\ncases where merging would most likely make the code more readable."##,
4781 }, 5232 },
4782 LintCompletion { 5233 Lint {
4783 label: "clippy::comparison_chain", 5234 label: "clippy::comparison_chain",
4784 description: r##"Checks comparison chains written with `if` that can be\nrewritten with `match` and `cmp`."##, 5235 description: r##"Checks comparison chains written with `if` that can be\nrewritten with `match` and `cmp`."##,
4785 }, 5236 },
4786 LintCompletion { 5237 Lint {
4787 label: "clippy::comparison_to_empty", 5238 label: "clippy::comparison_to_empty",
4788 description: r##"Checks for comparing to an empty slice such as `\"\"` or `[]`,\nand suggests using `.is_empty()` where applicable."##, 5239 description: r##"Checks for comparing to an empty slice such as `\"\"` or `[]`,\nand suggests using `.is_empty()` where applicable."##,
4789 }, 5240 },
4790 LintCompletion { 5241 Lint {
4791 label: "clippy::copy_iterator", 5242 label: "clippy::copy_iterator",
4792 description: r##"Checks for types that implement `Copy` as well as\n`Iterator`."##, 5243 description: r##"Checks for types that implement `Copy` as well as\n`Iterator`."##,
4793 }, 5244 },
4794 LintCompletion { 5245 Lint {
4795 label: "clippy::create_dir", 5246 label: "clippy::create_dir",
4796 description: r##"Checks usage of `std::fs::create_dir` and suggest using `std::fs::create_dir_all` instead."##, 5247 description: r##"Checks usage of `std::fs::create_dir` and suggest using `std::fs::create_dir_all` instead."##,
4797 }, 5248 },
4798 LintCompletion { 5249 Lint {
4799 label: "clippy::crosspointer_transmute", 5250 label: "clippy::crosspointer_transmute",
4800 description: r##"Checks for transmutes between a type `T` and `*T`."##, 5251 description: r##"Checks for transmutes between a type `T` and `*T`."##,
4801 }, 5252 },
4802 LintCompletion { 5253 Lint { label: "clippy::dbg_macro", description: r##"Checks for usage of dbg!() macro."## },
4803 label: "clippy::dbg_macro", 5254 Lint {
4804 description: r##"Checks for usage of dbg!() macro."##,
4805 },
4806 LintCompletion {
4807 label: "clippy::debug_assert_with_mut_call", 5255 label: "clippy::debug_assert_with_mut_call",
4808 description: r##"Checks for function/method calls with a mutable\nparameter in `debug_assert!`, `debug_assert_eq!` and `debug_assert_ne!` macros."##, 5256 description: r##"Checks for function/method calls with a mutable\nparameter in `debug_assert!`, `debug_assert_eq!` and `debug_assert_ne!` macros."##,
4809 }, 5257 },
4810 LintCompletion { 5258 Lint {
4811 label: "clippy::decimal_literal_representation", 5259 label: "clippy::decimal_literal_representation",
4812 description: r##"Warns if there is a better representation for a numeric literal."##, 5260 description: r##"Warns if there is a better representation for a numeric literal."##,
4813 }, 5261 },
4814 LintCompletion { 5262 Lint {
4815 label: "clippy::declare_interior_mutable_const", 5263 label: "clippy::declare_interior_mutable_const",
4816 description: r##"Checks for declaration of `const` items which is interior\nmutable (e.g., contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.)."##, 5264 description: r##"Checks for declaration of `const` items which is interior\nmutable (e.g., contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.)."##,
4817 }, 5265 },
4818 LintCompletion { 5266 Lint {
4819 label: "clippy::default_numeric_fallback", 5267 label: "clippy::default_numeric_fallback",
4820 description: r##"Checks for usage of unconstrained numeric literals which may cause default numeric fallback in type\ninference.\n\nDefault numeric fallback means that if numeric types have not yet been bound to concrete\ntypes at the end of type inference, then integer type is bound to `i32`, and similarly\nfloating type is bound to `f64`.\n\nSee [RFC0212](https://github.com/rust-lang/rfcs/blob/master/text/0212-restore-int-fallback.md) for more information about the fallback."##, 5268 description: r##"Checks for usage of unconstrained numeric literals which may cause default numeric fallback in type\ninference.\n\nDefault numeric fallback means that if numeric types have not yet been bound to concrete\ntypes at the end of type inference, then integer type is bound to `i32`, and similarly\nfloating type is bound to `f64`.\n\nSee [RFC0212](https://github.com/rust-lang/rfcs/blob/master/text/0212-restore-int-fallback.md) for more information about the fallback."##,
4821 }, 5269 },
4822 LintCompletion { 5270 Lint {
4823 label: "clippy::default_trait_access", 5271 label: "clippy::default_trait_access",
4824 description: r##"Checks for literal calls to `Default::default()`."##, 5272 description: r##"Checks for literal calls to `Default::default()`."##,
4825 }, 5273 },
4826 LintCompletion { 5274 Lint {
4827 label: "clippy::deprecated_cfg_attr", 5275 label: "clippy::deprecated_cfg_attr",
4828 description: r##"Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it\nwith `#[rustfmt::skip]`."##, 5276 description: r##"Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it\nwith `#[rustfmt::skip]`."##,
4829 }, 5277 },
4830 LintCompletion { 5278 Lint {
4831 label: "clippy::deprecated_semver", 5279 label: "clippy::deprecated_semver",
4832 description: r##"Checks for `#[deprecated]` annotations with a `since`\nfield that is not a valid semantic version."##, 5280 description: r##"Checks for `#[deprecated]` annotations with a `since`\nfield that is not a valid semantic version."##,
4833 }, 5281 },
4834 LintCompletion { 5282 Lint {
4835 label: "clippy::deref_addrof", 5283 label: "clippy::deref_addrof",
4836 description: r##"Checks for usage of `*&` and `*&mut` in expressions."##, 5284 description: r##"Checks for usage of `*&` and `*&mut` in expressions."##,
4837 }, 5285 },
4838 LintCompletion { 5286 Lint {
4839 label: "clippy::derive_hash_xor_eq", 5287 label: "clippy::derive_hash_xor_eq",
4840 description: r##"Checks for deriving `Hash` but implementing `PartialEq`\nexplicitly or vice versa."##, 5288 description: r##"Checks for deriving `Hash` but implementing `PartialEq`\nexplicitly or vice versa."##,
4841 }, 5289 },
4842 LintCompletion { 5290 Lint {
4843 label: "clippy::derive_ord_xor_partial_ord", 5291 label: "clippy::derive_ord_xor_partial_ord",
4844 description: r##"Checks for deriving `Ord` but implementing `PartialOrd`\nexplicitly or vice versa."##, 5292 description: r##"Checks for deriving `Ord` but implementing `PartialOrd`\nexplicitly or vice versa."##,
4845 }, 5293 },
4846 LintCompletion { 5294 Lint {
4847 label: "clippy::disallowed_method", 5295 label: "clippy::disallowed_method",
4848 description: r##"Denies the configured methods and functions in clippy.toml"##, 5296 description: r##"Denies the configured methods and functions in clippy.toml"##,
4849 }, 5297 },
4850 LintCompletion { 5298 Lint {
4851 label: "clippy::diverging_sub_expression", 5299 label: "clippy::diverging_sub_expression",
4852 description: r##"Checks for diverging calls that are not match arms or\nstatements."##, 5300 description: r##"Checks for diverging calls that are not match arms or\nstatements."##,
4853 }, 5301 },
4854 LintCompletion { 5302 Lint {
4855 label: "clippy::doc_markdown", 5303 label: "clippy::doc_markdown",
4856 description: r##"Checks for the presence of `_`, `::` or camel-case words\noutside ticks in documentation."##, 5304 description: r##"Checks for the presence of `_`, `::` or camel-case words\noutside ticks in documentation."##,
4857 }, 5305 },
4858 LintCompletion { 5306 Lint {
4859 label: "clippy::double_comparisons", 5307 label: "clippy::double_comparisons",
4860 description: r##"Checks for double comparisons that could be simplified to a single expression."##, 5308 description: r##"Checks for double comparisons that could be simplified to a single expression."##,
4861 }, 5309 },
4862 LintCompletion { 5310 Lint {
4863 label: "clippy::double_must_use", 5311 label: "clippy::double_must_use",
4864 description: r##"Checks for a [`#[must_use]`] attribute without\nfurther information on functions and methods that return a type already\nmarked as `#[must_use]`.\n\n[`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"##, 5312 description: r##"Checks for a [`#[must_use]`] attribute without\nfurther information on functions and methods that return a type already\nmarked as `#[must_use]`.\n\n[`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"##,
4865 }, 5313 },
4866 LintCompletion { 5314 Lint {
4867 label: "clippy::double_neg", 5315 label: "clippy::double_neg",
4868 description: r##"Detects expressions of the form `--x`."##, 5316 description: r##"Detects expressions of the form `--x`."##,
4869 }, 5317 },
4870 LintCompletion { 5318 Lint {
4871 label: "clippy::double_parens", 5319 label: "clippy::double_parens",
4872 description: r##"Checks for unnecessary double parentheses."##, 5320 description: r##"Checks for unnecessary double parentheses."##,
4873 }, 5321 },
4874 LintCompletion { 5322 Lint {
4875 label: "clippy::drop_copy", 5323 label: "clippy::drop_copy",
4876 description: r##"Checks for calls to `std::mem::drop` with a value\nthat derives the Copy trait"##, 5324 description: r##"Checks for calls to `std::mem::drop` with a value\nthat derives the Copy trait"##,
4877 }, 5325 },
4878 LintCompletion { 5326 Lint {
4879 label: "clippy::drop_ref", 5327 label: "clippy::drop_ref",
4880 description: r##"Checks for calls to `std::mem::drop` with a reference\ninstead of an owned value."##, 5328 description: r##"Checks for calls to `std::mem::drop` with a reference\ninstead of an owned value."##,
4881 }, 5329 },
4882 LintCompletion { 5330 Lint {
4883 label: "clippy::duplicate_underscore_argument", 5331 label: "clippy::duplicate_underscore_argument",
4884 description: r##"Checks for function arguments having the similar names\ndiffering by an underscore."##, 5332 description: r##"Checks for function arguments having the similar names\ndiffering by an underscore."##,
4885 }, 5333 },
4886 LintCompletion { 5334 Lint {
4887 label: "clippy::duration_subsec", 5335 label: "clippy::duration_subsec",
4888 description: r##"Checks for calculation of subsecond microseconds or milliseconds\nfrom other `Duration` methods."##, 5336 description: r##"Checks for calculation of subsecond microseconds or milliseconds\nfrom other `Duration` methods."##,
4889 }, 5337 },
4890 LintCompletion { 5338 Lint {
4891 label: "clippy::else_if_without_else", 5339 label: "clippy::else_if_without_else",
4892 description: r##"Checks for usage of if expressions with an `else if` branch,\nbut without a final `else` branch."##, 5340 description: r##"Checks for usage of if expressions with an `else if` branch,\nbut without a final `else` branch."##,
4893 }, 5341 },
4894 LintCompletion { 5342 Lint {
4895 label: "clippy::empty_enum", 5343 label: "clippy::empty_enum",
4896 description: r##"Checks for `enum`s with no variants.\n\nAs of this writing, the `never_type` is still a\nnightly-only experimental API. Therefore, this lint is only triggered\nif the `never_type` is enabled."##, 5344 description: r##"Checks for `enum`s with no variants.\n\nAs of this writing, the `never_type` is still a\nnightly-only experimental API. Therefore, this lint is only triggered\nif the `never_type` is enabled."##,
4897 }, 5345 },
4898 LintCompletion { 5346 Lint {
4899 label: "clippy::empty_line_after_outer_attr", 5347 label: "clippy::empty_line_after_outer_attr",
4900 description: r##"Checks for empty lines after outer attributes"##, 5348 description: r##"Checks for empty lines after outer attributes"##,
4901 }, 5349 },
4902 LintCompletion { 5350 Lint { label: "clippy::empty_loop", description: r##"Checks for empty `loop` expressions."## },
4903 label: "clippy::empty_loop", 5351 Lint {
4904 description: r##"Checks for empty `loop` expressions."##,
4905 },
4906 LintCompletion {
4907 label: "clippy::enum_clike_unportable_variant", 5352 label: "clippy::enum_clike_unportable_variant",
4908 description: r##"Checks for C-like enumerations that are\n`repr(isize/usize)` and have values that don't fit into an `i32`."##, 5353 description: r##"Checks for C-like enumerations that are\n`repr(isize/usize)` and have values that don't fit into an `i32`."##,
4909 }, 5354 },
4910 LintCompletion { 5355 Lint { label: "clippy::enum_glob_use", description: r##"Checks for `use Enum::*`."## },
4911 label: "clippy::enum_glob_use", 5356 Lint {
4912 description: r##"Checks for `use Enum::*`."##,
4913 },
4914 LintCompletion {
4915 label: "clippy::enum_variant_names", 5357 label: "clippy::enum_variant_names",
4916 description: r##"Detects enumeration variants that are prefixed or suffixed\nby the same characters."##, 5358 description: r##"Detects enumeration variants that are prefixed or suffixed\nby the same characters."##,
4917 }, 5359 },
4918 LintCompletion { 5360 Lint {
4919 label: "clippy::eq_op", 5361 label: "clippy::eq_op",
4920 description: r##"Checks for equal operands to comparison, logical and\nbitwise, difference and division binary operators (`==`, `>`, etc., `&&`,\n`||`, `&`, `|`, `^`, `-` and `/`)."##, 5362 description: r##"Checks for equal operands to comparison, logical and\nbitwise, difference and division binary operators (`==`, `>`, etc., `&&`,\n`||`, `&`, `|`, `^`, `-` and `/`)."##,
4921 }, 5363 },
4922 LintCompletion { 5364 Lint {
4923 label: "clippy::erasing_op", 5365 label: "clippy::erasing_op",
4924 description: r##"Checks for erasing operations, e.g., `x * 0`."##, 5366 description: r##"Checks for erasing operations, e.g., `x * 0`."##,
4925 }, 5367 },
4926 LintCompletion { 5368 Lint {
4927 label: "clippy::eval_order_dependence", 5369 label: "clippy::eval_order_dependence",
4928 description: r##"Checks for a read and a write to the same variable where\nwhether the read occurs before or after the write depends on the evaluation\norder of sub-expressions."##, 5370 description: r##"Checks for a read and a write to the same variable where\nwhether the read occurs before or after the write depends on the evaluation\norder of sub-expressions."##,
4929 }, 5371 },
4930 LintCompletion { 5372 Lint {
4931 label: "clippy::excessive_precision", 5373 label: "clippy::excessive_precision",
4932 description: r##"Checks for float literals with a precision greater\nthan that supported by the underlying type."##, 5374 description: r##"Checks for float literals with a precision greater\nthan that supported by the underlying type."##,
4933 }, 5375 },
4934 LintCompletion { 5376 Lint {
4935 label: "clippy::exhaustive_enums", 5377 label: "clippy::exhaustive_enums",
4936 description: r##"Warns on any exported `enum`s that are not tagged `#[non_exhaustive]`"##, 5378 description: r##"Warns on any exported `enum`s that are not tagged `#[non_exhaustive]`"##,
4937 }, 5379 },
4938 LintCompletion { 5380 Lint {
4939 label: "clippy::exhaustive_structs", 5381 label: "clippy::exhaustive_structs",
4940 description: r##"Warns on any exported `structs`s that are not tagged `#[non_exhaustive]`"##, 5382 description: r##"Warns on any exported `structs`s that are not tagged `#[non_exhaustive]`"##,
4941 }, 5383 },
4942 LintCompletion { 5384 Lint {
4943 label: "clippy::exit", 5385 label: "clippy::exit",
4944 description: r##"`exit()` terminates the program and doesn't provide a\nstack trace."##, 5386 description: r##"`exit()` terminates the program and doesn't provide a\nstack trace."##,
4945 }, 5387 },
4946 LintCompletion { 5388 Lint {
4947 label: "clippy::expect_fun_call", 5389 label: "clippy::expect_fun_call",
4948 description: r##"Checks for calls to `.expect(&format!(...))`, `.expect(foo(..))`,\netc., and suggests to use `unwrap_or_else` instead"##, 5390 description: r##"Checks for calls to `.expect(&format!(...))`, `.expect(foo(..))`,\netc., and suggests to use `unwrap_or_else` instead"##,
4949 }, 5391 },
4950 LintCompletion { 5392 Lint {
4951 label: "clippy::expect_used", 5393 label: "clippy::expect_used",
4952 description: r##"Checks for `.expect()` calls on `Option`s and `Result`s."##, 5394 description: r##"Checks for `.expect()` calls on `Option`s and `Result`s."##,
4953 }, 5395 },
4954 LintCompletion { 5396 Lint {
4955 label: "clippy::expl_impl_clone_on_copy", 5397 label: "clippy::expl_impl_clone_on_copy",
4956 description: r##"Checks for explicit `Clone` implementations for `Copy`\ntypes."##, 5398 description: r##"Checks for explicit `Clone` implementations for `Copy`\ntypes."##,
4957 }, 5399 },
4958 LintCompletion { 5400 Lint {
4959 label: "clippy::explicit_counter_loop", 5401 label: "clippy::explicit_counter_loop",
4960 description: r##"Checks `for` loops over slices with an explicit counter\nand suggests the use of `.enumerate()`."##, 5402 description: r##"Checks `for` loops over slices with an explicit counter\nand suggests the use of `.enumerate()`."##,
4961 }, 5403 },
4962 LintCompletion { 5404 Lint {
4963 label: "clippy::explicit_deref_methods", 5405 label: "clippy::explicit_deref_methods",
4964 description: r##"Checks for explicit `deref()` or `deref_mut()` method calls."##, 5406 description: r##"Checks for explicit `deref()` or `deref_mut()` method calls."##,
4965 }, 5407 },
4966 LintCompletion { 5408 Lint {
4967 label: "clippy::explicit_into_iter_loop", 5409 label: "clippy::explicit_into_iter_loop",
4968 description: r##"Checks for loops on `y.into_iter()` where `y` will do, and\nsuggests the latter."##, 5410 description: r##"Checks for loops on `y.into_iter()` where `y` will do, and\nsuggests the latter."##,
4969 }, 5411 },
4970 LintCompletion { 5412 Lint {
4971 label: "clippy::explicit_iter_loop", 5413 label: "clippy::explicit_iter_loop",
4972 description: r##"Checks for loops on `x.iter()` where `&x` will do, and\nsuggests the latter."##, 5414 description: r##"Checks for loops on `x.iter()` where `&x` will do, and\nsuggests the latter."##,
4973 }, 5415 },
4974 LintCompletion { 5416 Lint {
4975 label: "clippy::explicit_write", 5417 label: "clippy::explicit_write",
4976 description: r##"Checks for usage of `write!()` / `writeln()!` which can be\nreplaced with `(e)print!()` / `(e)println!()`"##, 5418 description: r##"Checks for usage of `write!()` / `writeln()!` which can be\nreplaced with `(e)print!()` / `(e)println!()`"##,
4977 }, 5419 },
4978 LintCompletion { 5420 Lint {
4979 label: "clippy::extend_from_slice", 5421 label: "clippy::extend_from_slice",
4980 description: r##"Nothing. This lint has been deprecated."##, 5422 description: r##"Nothing. This lint has been deprecated."##,
4981 }, 5423 },
4982 LintCompletion { 5424 Lint {
4983 label: "clippy::extra_unused_lifetimes", 5425 label: "clippy::extra_unused_lifetimes",
4984 description: r##"Checks for lifetimes in generics that are never used\nanywhere else."##, 5426 description: r##"Checks for lifetimes in generics that are never used\nanywhere else."##,
4985 }, 5427 },
4986 LintCompletion { 5428 Lint {
4987 label: "clippy::fallible_impl_from", 5429 label: "clippy::fallible_impl_from",
4988 description: r##"Checks for impls of `From<..>` that contain `panic!()` or `unwrap()`"##, 5430 description: r##"Checks for impls of `From<..>` that contain `panic!()` or `unwrap()`"##,
4989 }, 5431 },
4990 LintCompletion { 5432 Lint {
4991 label: "clippy::field_reassign_with_default", 5433 label: "clippy::field_reassign_with_default",
4992 description: r##"Checks for immediate reassignment of fields initialized\nwith Default::default()."##, 5434 description: r##"Checks for immediate reassignment of fields initialized\nwith Default::default()."##,
4993 }, 5435 },
4994 LintCompletion { 5436 Lint {
4995 label: "clippy::filetype_is_file", 5437 label: "clippy::filetype_is_file",
4996 description: r##"Checks for `FileType::is_file()`."##, 5438 description: r##"Checks for `FileType::is_file()`."##,
4997 }, 5439 },
4998 LintCompletion { 5440 Lint {
4999 label: "clippy::filter_map", 5441 label: "clippy::filter_map",
5000 description: r##"Nothing. This lint has been deprecated."##, 5442 description: r##"Nothing. This lint has been deprecated."##,
5001 }, 5443 },
5002 LintCompletion { 5444 Lint {
5003 label: "clippy::filter_map_identity", 5445 label: "clippy::filter_map_identity",
5004 description: r##"Checks for usage of `filter_map(|x| x)`."##, 5446 description: r##"Checks for usage of `filter_map(|x| x)`."##,
5005 }, 5447 },
5006 LintCompletion { 5448 Lint {
5007 label: "clippy::filter_map_next", 5449 label: "clippy::filter_map_next",
5008 description: r##"Checks for usage of `_.filter_map(_).next()`."##, 5450 description: r##"Checks for usage of `_.filter_map(_).next()`."##,
5009 }, 5451 },
5010 LintCompletion { 5452 Lint {
5011 label: "clippy::filter_next", 5453 label: "clippy::filter_next",
5012 description: r##"Checks for usage of `_.filter(_).next()`."##, 5454 description: r##"Checks for usage of `_.filter(_).next()`."##,
5013 }, 5455 },
5014 LintCompletion { 5456 Lint { label: "clippy::find_map", description: r##"Nothing. This lint has been deprecated."## },
5015 label: "clippy::find_map", 5457 Lint {
5016 description: r##"Nothing. This lint has been deprecated."##,
5017 },
5018 LintCompletion {
5019 label: "clippy::flat_map_identity", 5458 label: "clippy::flat_map_identity",
5020 description: r##"Checks for usage of `flat_map(|x| x)`."##, 5459 description: r##"Checks for usage of `flat_map(|x| x)`."##,
5021 }, 5460 },
5022 LintCompletion { 5461 Lint {
5023 label: "clippy::flat_map_option", 5462 label: "clippy::flat_map_option",
5024 description: r##"Checks for usages of `Iterator::flat_map()` where `filter_map()` could be\nused instead."##, 5463 description: r##"Checks for usages of `Iterator::flat_map()` where `filter_map()` could be\nused instead."##,
5025 }, 5464 },
5026 LintCompletion { 5465 Lint { label: "clippy::float_arithmetic", description: r##"Checks for float arithmetic."## },
5027 label: "clippy::float_arithmetic", 5466 Lint {
5028 description: r##"Checks for float arithmetic."##,
5029 },
5030 LintCompletion {
5031 label: "clippy::float_cmp", 5467 label: "clippy::float_cmp",
5032 description: r##"Checks for (in-)equality comparisons on floating-point\nvalues (apart from zero), except in functions called `*eq*` (which probably\nimplement equality for a type involving floats)."##, 5468 description: r##"Checks for (in-)equality comparisons on floating-point\nvalues (apart from zero), except in functions called `*eq*` (which probably\nimplement equality for a type involving floats)."##,
5033 }, 5469 },
5034 LintCompletion { 5470 Lint {
5035 label: "clippy::float_cmp_const", 5471 label: "clippy::float_cmp_const",
5036 description: r##"Checks for (in-)equality comparisons on floating-point\nvalue and constant, except in functions called `*eq*` (which probably\nimplement equality for a type involving floats)."##, 5472 description: r##"Checks for (in-)equality comparisons on floating-point\nvalue and constant, except in functions called `*eq*` (which probably\nimplement equality for a type involving floats)."##,
5037 }, 5473 },
5038 LintCompletion { 5474 Lint {
5039 label: "clippy::float_equality_without_abs", 5475 label: "clippy::float_equality_without_abs",
5040 description: r##"Checks for statements of the form `(a - b) < f32::EPSILON` or\n`(a - b) < f64::EPSILON`. Notes the missing `.abs()`."##, 5476 description: r##"Checks for statements of the form `(a - b) < f32::EPSILON` or\n`(a - b) < f64::EPSILON`. Notes the missing `.abs()`."##,
5041 }, 5477 },
5042 LintCompletion { 5478 Lint {
5043 label: "clippy::fn_address_comparisons", 5479 label: "clippy::fn_address_comparisons",
5044 description: r##"Checks for comparisons with an address of a function item."##, 5480 description: r##"Checks for comparisons with an address of a function item."##,
5045 }, 5481 },
5046 LintCompletion { 5482 Lint {
5047 label: "clippy::fn_params_excessive_bools", 5483 label: "clippy::fn_params_excessive_bools",
5048 description: r##"Checks for excessive use of\nbools in function definitions."##, 5484 description: r##"Checks for excessive use of\nbools in function definitions."##,
5049 }, 5485 },
5050 LintCompletion { 5486 Lint {
5051 label: "clippy::fn_to_numeric_cast", 5487 label: "clippy::fn_to_numeric_cast",
5052 description: r##"Checks for casts of function pointers to something other than usize"##, 5488 description: r##"Checks for casts of function pointers to something other than usize"##,
5053 }, 5489 },
5054 LintCompletion { 5490 Lint {
5055 label: "clippy::fn_to_numeric_cast_with_truncation", 5491 label: "clippy::fn_to_numeric_cast_with_truncation",
5056 description: r##"Checks for casts of a function pointer to a numeric type not wide enough to\nstore address."##, 5492 description: r##"Checks for casts of a function pointer to a numeric type not wide enough to\nstore address."##,
5057 }, 5493 },
5058 LintCompletion { 5494 Lint {
5059 label: "clippy::for_kv_map", 5495 label: "clippy::for_kv_map",
5060 description: r##"Checks for iterating a map (`HashMap` or `BTreeMap`) and\nignoring either the keys or values."##, 5496 description: r##"Checks for iterating a map (`HashMap` or `BTreeMap`) and\nignoring either the keys or values."##,
5061 }, 5497 },
5062 LintCompletion { 5498 Lint {
5063 label: "clippy::for_loops_over_fallibles", 5499 label: "clippy::for_loops_over_fallibles",
5064 description: r##"Checks for `for` loops over `Option` or `Result` values."##, 5500 description: r##"Checks for `for` loops over `Option` or `Result` values."##,
5065 }, 5501 },
5066 LintCompletion { 5502 Lint {
5067 label: "clippy::forget_copy", 5503 label: "clippy::forget_copy",
5068 description: r##"Checks for calls to `std::mem::forget` with a value that\nderives the Copy trait"##, 5504 description: r##"Checks for calls to `std::mem::forget` with a value that\nderives the Copy trait"##,
5069 }, 5505 },
5070 LintCompletion { 5506 Lint {
5071 label: "clippy::forget_ref", 5507 label: "clippy::forget_ref",
5072 description: r##"Checks for calls to `std::mem::forget` with a reference\ninstead of an owned value."##, 5508 description: r##"Checks for calls to `std::mem::forget` with a reference\ninstead of an owned value."##,
5073 }, 5509 },
5074 LintCompletion { 5510 Lint {
5075 label: "clippy::from_iter_instead_of_collect", 5511 label: "clippy::from_iter_instead_of_collect",
5076 description: r##"Checks for `from_iter()` function calls on types that implement the `FromIterator`\ntrait."##, 5512 description: r##"Checks for `from_iter()` function calls on types that implement the `FromIterator`\ntrait."##,
5077 }, 5513 },
5078 LintCompletion { 5514 Lint {
5079 label: "clippy::from_over_into", 5515 label: "clippy::from_over_into",
5080 description: r##"Searches for implementations of the `Into<..>` trait and suggests to implement `From<..>` instead."##, 5516 description: r##"Searches for implementations of the `Into<..>` trait and suggests to implement `From<..>` instead."##,
5081 }, 5517 },
5082 LintCompletion { 5518 Lint {
5083 label: "clippy::from_str_radix_10", 5519 label: "clippy::from_str_radix_10",
5084 description: r##"Checks for function invocations of the form `primitive::from_str_radix(s, 10)`"##, 5520 description: r##"Checks for function invocations of the form `primitive::from_str_radix(s, 10)`"##,
5085 }, 5521 },
5086 LintCompletion { 5522 Lint {
5087 label: "clippy::future_not_send", 5523 label: "clippy::future_not_send",
5088 description: r##"This lint requires Future implementations returned from\nfunctions and methods to implement the `Send` marker trait. It is mostly\nused by library authors (public and internal) that target an audience where\nmultithreaded executors are likely to be used for running these Futures."##, 5524 description: r##"This lint requires Future implementations returned from\nfunctions and methods to implement the `Send` marker trait. It is mostly\nused by library authors (public and internal) that target an audience where\nmultithreaded executors are likely to be used for running these Futures."##,
5089 }, 5525 },
5090 LintCompletion { 5526 Lint {
5091 label: "clippy::get_last_with_len", 5527 label: "clippy::get_last_with_len",
5092 description: r##"Checks for using `x.get(x.len() - 1)` instead of\n`x.last()`."##, 5528 description: r##"Checks for using `x.get(x.len() - 1)` instead of\n`x.last()`."##,
5093 }, 5529 },
5094 LintCompletion { 5530 Lint {
5095 label: "clippy::get_unwrap", 5531 label: "clippy::get_unwrap",
5096 description: r##"Checks for use of `.get().unwrap()` (or\n`.get_mut().unwrap`) on a standard library type which implements `Index`"##, 5532 description: r##"Checks for use of `.get().unwrap()` (or\n`.get_mut().unwrap`) on a standard library type which implements `Index`"##,
5097 }, 5533 },
5098 LintCompletion { 5534 Lint {
5099 label: "clippy::identity_op", 5535 label: "clippy::identity_op",
5100 description: r##"Checks for identity operations, e.g., `x + 0`."##, 5536 description: r##"Checks for identity operations, e.g., `x + 0`."##,
5101 }, 5537 },
5102 LintCompletion { 5538 Lint {
5103 label: "clippy::if_let_mutex", 5539 label: "clippy::if_let_mutex",
5104 description: r##"Checks for `Mutex::lock` calls in `if let` expression\nwith lock calls in any of the else blocks."##, 5540 description: r##"Checks for `Mutex::lock` calls in `if let` expression\nwith lock calls in any of the else blocks."##,
5105 }, 5541 },
5106 LintCompletion { 5542 Lint {
5107 label: "clippy::if_let_redundant_pattern_matching", 5543 label: "clippy::if_let_redundant_pattern_matching",
5108 description: r##"Nothing. This lint has been deprecated."##, 5544 description: r##"Nothing. This lint has been deprecated."##,
5109 }, 5545 },
5110 LintCompletion { 5546 Lint {
5111 label: "clippy::if_let_some_result", 5547 label: "clippy::if_let_some_result",
5112 description: r##"* Checks for unnecessary `ok()` in if let."##, 5548 description: r##"* Checks for unnecessary `ok()` in if let."##,
5113 }, 5549 },
5114 LintCompletion { 5550 Lint {
5115 label: "clippy::if_not_else", 5551 label: "clippy::if_not_else",
5116 description: r##"Checks for usage of `!` or `!=` in an if condition with an\nelse branch."##, 5552 description: r##"Checks for usage of `!` or `!=` in an if condition with an\nelse branch."##,
5117 }, 5553 },
5118 LintCompletion { 5554 Lint {
5119 label: "clippy::if_same_then_else", 5555 label: "clippy::if_same_then_else",
5120 description: r##"Checks for `if/else` with the same body as the *then* part\nand the *else* part."##, 5556 description: r##"Checks for `if/else` with the same body as the *then* part\nand the *else* part."##,
5121 }, 5557 },
5122 LintCompletion { 5558 Lint {
5123 label: "clippy::if_then_some_else_none", 5559 label: "clippy::if_then_some_else_none",
5124 description: r##"Checks for if-else that could be written to `bool::then`."##, 5560 description: r##"Checks for if-else that could be written to `bool::then`."##,
5125 }, 5561 },
5126 LintCompletion { 5562 Lint {
5127 label: "clippy::ifs_same_cond", 5563 label: "clippy::ifs_same_cond",
5128 description: r##"Checks for consecutive `if`s with the same condition."##, 5564 description: r##"Checks for consecutive `if`s with the same condition."##,
5129 }, 5565 },
5130 LintCompletion { 5566 Lint {
5131 label: "clippy::implicit_clone", 5567 label: "clippy::implicit_clone",
5132 description: r##"Checks for the usage of `_.to_owned()`, `vec.to_vec()`, or similar when calling `_.clone()` would be clearer."##, 5568 description: r##"Checks for the usage of `_.to_owned()`, `vec.to_vec()`, or similar when calling `_.clone()` would be clearer."##,
5133 }, 5569 },
5134 LintCompletion { 5570 Lint {
5135 label: "clippy::implicit_hasher", 5571 label: "clippy::implicit_hasher",
5136 description: r##"Checks for public `impl` or `fn` missing generalization\nover different hashers and implicitly defaulting to the default hashing\nalgorithm (`SipHash`)."##, 5572 description: r##"Checks for public `impl` or `fn` missing generalization\nover different hashers and implicitly defaulting to the default hashing\nalgorithm (`SipHash`)."##,
5137 }, 5573 },
5138 LintCompletion { 5574 Lint {
5139 label: "clippy::implicit_return", 5575 label: "clippy::implicit_return",
5140 description: r##"Checks for missing return statements at the end of a block."##, 5576 description: r##"Checks for missing return statements at the end of a block."##,
5141 }, 5577 },
5142 LintCompletion { 5578 Lint {
5143 label: "clippy::implicit_saturating_sub", 5579 label: "clippy::implicit_saturating_sub",
5144 description: r##"Checks for implicit saturating subtraction."##, 5580 description: r##"Checks for implicit saturating subtraction."##,
5145 }, 5581 },
5146 LintCompletion { 5582 Lint {
5147 label: "clippy::imprecise_flops", 5583 label: "clippy::imprecise_flops",
5148 description: r##"Looks for floating-point expressions that\ncan be expressed using built-in methods to improve accuracy\nat the cost of performance."##, 5584 description: r##"Looks for floating-point expressions that\ncan be expressed using built-in methods to improve accuracy\nat the cost of performance."##,
5149 }, 5585 },
5150 LintCompletion { 5586 Lint {
5151 label: "clippy::inconsistent_digit_grouping", 5587 label: "clippy::inconsistent_digit_grouping",
5152 description: r##"Warns if an integral or floating-point constant is\ngrouped inconsistently with underscores."##, 5588 description: r##"Warns if an integral or floating-point constant is\ngrouped inconsistently with underscores."##,
5153 }, 5589 },
5154 LintCompletion { 5590 Lint {
5155 label: "clippy::inconsistent_struct_constructor", 5591 label: "clippy::inconsistent_struct_constructor",
5156 description: r##"Checks for struct constructors where all fields are shorthand and\nthe order of the field init shorthand in the constructor is inconsistent\nwith the order in the struct definition."##, 5592 description: r##"Checks for struct constructors where all fields are shorthand and\nthe order of the field init shorthand in the constructor is inconsistent\nwith the order in the struct definition."##,
5157 }, 5593 },
5158 LintCompletion { 5594 Lint {
5159 label: "clippy::indexing_slicing", 5595 label: "clippy::indexing_slicing",
5160 description: r##"Checks for usage of indexing or slicing. Arrays are special cases, this lint\ndoes report on arrays if we can tell that slicing operations are in bounds and does not\nlint on constant `usize` indexing on arrays because that is handled by rustc's `const_err` lint."##, 5596 description: r##"Checks for usage of indexing or slicing. Arrays are special cases, this lint\ndoes report on arrays if we can tell that slicing operations are in bounds and does not\nlint on constant `usize` indexing on arrays because that is handled by rustc's `const_err` lint."##,
5161 }, 5597 },
5162 LintCompletion { 5598 Lint {
5163 label: "clippy::ineffective_bit_mask", 5599 label: "clippy::ineffective_bit_mask",
5164 description: r##"Checks for bit masks in comparisons which can be removed\nwithout changing the outcome. The basic structure can be seen in the\nfollowing table:\n\n|Comparison| Bit Op |Example |equals |\n|----------|---------|-----------|-------|\n|`>` / `<=`|`|` / `^`|`x | 2 > 3`|`x > 3`|\n|`<` / `>=`|`|` / `^`|`x ^ 1 < 4`|`x < 4`|"##, 5600 description: r##"Checks for bit masks in comparisons which can be removed\nwithout changing the outcome. The basic structure can be seen in the\nfollowing table:\n\n|Comparison| Bit Op |Example |equals |\n|----------|---------|-----------|-------|\n|`>` / `<=`|`|` / `^`|`x | 2 > 3`|`x > 3`|\n|`<` / `>=`|`|` / `^`|`x ^ 1 < 4`|`x < 4`|"##,
5165 }, 5601 },
5166 LintCompletion { 5602 Lint {
5167 label: "clippy::inefficient_to_string", 5603 label: "clippy::inefficient_to_string",
5168 description: r##"Checks for usage of `.to_string()` on an `&&T` where\n`T` implements `ToString` directly (like `&&str` or `&&String`)."##, 5604 description: r##"Checks for usage of `.to_string()` on an `&&T` where\n`T` implements `ToString` directly (like `&&str` or `&&String`)."##,
5169 }, 5605 },
5170 LintCompletion { 5606 Lint {
5171 label: "clippy::infallible_destructuring_match", 5607 label: "clippy::infallible_destructuring_match",
5172 description: r##"Checks for matches being used to destructure a single-variant enum\nor tuple struct where a `let` will suffice."##, 5608 description: r##"Checks for matches being used to destructure a single-variant enum\nor tuple struct where a `let` will suffice."##,
5173 }, 5609 },
5174 LintCompletion { 5610 Lint {
5175 label: "clippy::infinite_iter", 5611 label: "clippy::infinite_iter",
5176 description: r##"Checks for iteration that is guaranteed to be infinite."##, 5612 description: r##"Checks for iteration that is guaranteed to be infinite."##,
5177 }, 5613 },
5178 LintCompletion { 5614 Lint {
5179 label: "clippy::inherent_to_string", 5615 label: "clippy::inherent_to_string",
5180 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String`."##, 5616 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String`."##,
5181 }, 5617 },
5182 LintCompletion { 5618 Lint {
5183 label: "clippy::inherent_to_string_shadow_display", 5619 label: "clippy::inherent_to_string_shadow_display",
5184 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String` and if the type implementing this method also implements the `Display` trait."##, 5620 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String` and if the type implementing this method also implements the `Display` trait."##,
5185 }, 5621 },
5186 LintCompletion { 5622 Lint {
5187 label: "clippy::inline_always", 5623 label: "clippy::inline_always",
5188 description: r##"Checks for items annotated with `#[inline(always)]`,\nunless the annotated function is empty or simply panics."##, 5624 description: r##"Checks for items annotated with `#[inline(always)]`,\nunless the annotated function is empty or simply panics."##,
5189 }, 5625 },
5190 LintCompletion { 5626 Lint {
5191 label: "clippy::inline_asm_x86_att_syntax", 5627 label: "clippy::inline_asm_x86_att_syntax",
5192 description: r##"Checks for usage of AT&T x86 assembly syntax."##, 5628 description: r##"Checks for usage of AT&T x86 assembly syntax."##,
5193 }, 5629 },
5194 LintCompletion { 5630 Lint {
5195 label: "clippy::inline_asm_x86_intel_syntax", 5631 label: "clippy::inline_asm_x86_intel_syntax",
5196 description: r##"Checks for usage of Intel x86 assembly syntax."##, 5632 description: r##"Checks for usage of Intel x86 assembly syntax."##,
5197 }, 5633 },
5198 LintCompletion { 5634 Lint {
5199 label: "clippy::inline_fn_without_body", 5635 label: "clippy::inline_fn_without_body",
5200 description: r##"Checks for `#[inline]` on trait methods without bodies"##, 5636 description: r##"Checks for `#[inline]` on trait methods without bodies"##,
5201 }, 5637 },
5202 LintCompletion { 5638 Lint {
5203 label: "clippy::inspect_for_each", 5639 label: "clippy::inspect_for_each",
5204 description: r##"Checks for usage of `inspect().for_each()`."##, 5640 description: r##"Checks for usage of `inspect().for_each()`."##,
5205 }, 5641 },
5206 LintCompletion { 5642 Lint {
5207 label: "clippy::int_plus_one", 5643 label: "clippy::int_plus_one",
5208 description: r##"Checks for usage of `x >= y + 1` or `x - 1 >= y` (and `<=`) in a block"##, 5644 description: r##"Checks for usage of `x >= y + 1` or `x - 1 >= y` (and `<=`) in a block"##,
5209 }, 5645 },
5210 LintCompletion { 5646 Lint {
5211 label: "clippy::integer_arithmetic", 5647 label: "clippy::integer_arithmetic",
5212 description: r##"Checks for integer arithmetic operations which could overflow or panic.\n\nSpecifically, checks for any operators (`+`, `-`, `*`, `<<`, etc) which are capable\nof overflowing according to the [Rust\nReference](https://doc.rust-lang.org/reference/expressions/operator-expr.html#overflow),\nor which can panic (`/`, `%`). No bounds analysis or sophisticated reasoning is\nattempted."##, 5648 description: r##"Checks for integer arithmetic operations which could overflow or panic.\n\nSpecifically, checks for any operators (`+`, `-`, `*`, `<<`, etc) which are capable\nof overflowing according to the [Rust\nReference](https://doc.rust-lang.org/reference/expressions/operator-expr.html#overflow),\nor which can panic (`/`, `%`). No bounds analysis or sophisticated reasoning is\nattempted."##,
5213 }, 5649 },
5214 LintCompletion { 5650 Lint { label: "clippy::integer_division", description: r##"Checks for division of integers"## },
5215 label: "clippy::integer_division", 5651 Lint {
5216 description: r##"Checks for division of integers"##,
5217 },
5218 LintCompletion {
5219 label: "clippy::into_iter_on_ref", 5652 label: "clippy::into_iter_on_ref",
5220 description: r##"Checks for `into_iter` calls on references which should be replaced by `iter`\nor `iter_mut`."##, 5653 description: r##"Checks for `into_iter` calls on references which should be replaced by `iter`\nor `iter_mut`."##,
5221 }, 5654 },
5222 LintCompletion { 5655 Lint {
5223 label: "clippy::invalid_atomic_ordering", 5656 label: "clippy::invalid_atomic_ordering",
5224 description: r##"Checks for usage of invalid atomic\nordering in atomic loads/stores/exchanges/updates and\nmemory fences."##, 5657 description: r##"Checks for usage of invalid atomic\nordering in atomic loads/stores/exchanges/updates and\nmemory fences."##,
5225 }, 5658 },
5226 LintCompletion { 5659 Lint {
5227 label: "clippy::invalid_null_ptr_usage", 5660 label: "clippy::invalid_null_ptr_usage",
5228 description: r##"This lint checks for invalid usages of `ptr::null`."##, 5661 description: r##"This lint checks for invalid usages of `ptr::null`."##,
5229 }, 5662 },
5230 LintCompletion { 5663 Lint {
5231 label: "clippy::invalid_regex", 5664 label: "clippy::invalid_regex",
5232 description: r##"Checks [regex](https://crates.io/crates/regex) creation\n(with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`) for correct\nregex syntax."##, 5665 description: r##"Checks [regex](https://crates.io/crates/regex) creation\n(with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`) for correct\nregex syntax."##,
5233 }, 5666 },
5234 LintCompletion { 5667 Lint {
5235 label: "clippy::invalid_upcast_comparisons", 5668 label: "clippy::invalid_upcast_comparisons",
5236 description: r##"Checks for comparisons where the relation is always either\ntrue or false, but where one side has been upcast so that the comparison is\nnecessary. Only integer types are checked."##, 5669 description: r##"Checks for comparisons where the relation is always either\ntrue or false, but where one side has been upcast so that the comparison is\nnecessary. Only integer types are checked."##,
5237 }, 5670 },
5238 LintCompletion { 5671 Lint {
5239 label: "clippy::invisible_characters", 5672 label: "clippy::invisible_characters",
5240 description: r##"Checks for invisible Unicode characters in the code."##, 5673 description: r##"Checks for invisible Unicode characters in the code."##,
5241 }, 5674 },
5242 LintCompletion { 5675 Lint {
5243 label: "clippy::items_after_statements", 5676 label: "clippy::items_after_statements",
5244 description: r##"Checks for items declared after some statement in a block."##, 5677 description: r##"Checks for items declared after some statement in a block."##,
5245 }, 5678 },
5246 LintCompletion { 5679 Lint {
5247 label: "clippy::iter_cloned_collect", 5680 label: "clippy::iter_cloned_collect",
5248 description: r##"Checks for the use of `.cloned().collect()` on slice to\ncreate a `Vec`."##, 5681 description: r##"Checks for the use of `.cloned().collect()` on slice to\ncreate a `Vec`."##,
5249 }, 5682 },
5250 LintCompletion { 5683 Lint {
5251 label: "clippy::iter_count", 5684 label: "clippy::iter_count",
5252 description: r##"Checks for the use of `.iter().count()`."##, 5685 description: r##"Checks for the use of `.iter().count()`."##,
5253 }, 5686 },
5254 LintCompletion { 5687 Lint { label: "clippy::iter_next_loop", description: r##"Checks for loops on `x.next()`."## },
5255 label: "clippy::iter_next_loop", 5688 Lint {
5256 description: r##"Checks for loops on `x.next()`."##,
5257 },
5258 LintCompletion {
5259 label: "clippy::iter_next_slice", 5689 label: "clippy::iter_next_slice",
5260 description: r##"Checks for usage of `iter().next()` on a Slice or an Array"##, 5690 description: r##"Checks for usage of `iter().next()` on a Slice or an Array"##,
5261 }, 5691 },
5262 LintCompletion { 5692 Lint {
5263 label: "clippy::iter_nth", 5693 label: "clippy::iter_nth",
5264 description: r##"Checks for use of `.iter().nth()` (and the related\n`.iter_mut().nth()`) on standard library types with O(1) element access."##, 5694 description: r##"Checks for use of `.iter().nth()` (and the related\n`.iter_mut().nth()`) on standard library types with O(1) element access."##,
5265 }, 5695 },
5266 LintCompletion { 5696 Lint {
5267 label: "clippy::iter_nth_zero", 5697 label: "clippy::iter_nth_zero",
5268 description: r##"Checks for the use of `iter.nth(0)`."##, 5698 description: r##"Checks for the use of `iter.nth(0)`."##,
5269 }, 5699 },
5270 LintCompletion { 5700 Lint {
5271 label: "clippy::iter_skip_next", 5701 label: "clippy::iter_skip_next",
5272 description: r##"Checks for use of `.skip(x).next()` on iterators."##, 5702 description: r##"Checks for use of `.skip(x).next()` on iterators."##,
5273 }, 5703 },
5274 LintCompletion { 5704 Lint {
5275 label: "clippy::iterator_step_by_zero", 5705 label: "clippy::iterator_step_by_zero",
5276 description: r##"Checks for calling `.step_by(0)` on iterators which panics."##, 5706 description: r##"Checks for calling `.step_by(0)` on iterators which panics."##,
5277 }, 5707 },
5278 LintCompletion { 5708 Lint {
5279 label: "clippy::just_underscores_and_digits", 5709 label: "clippy::just_underscores_and_digits",
5280 description: r##"Checks if you have variables whose name consists of just\nunderscores and digits."##, 5710 description: r##"Checks if you have variables whose name consists of just\nunderscores and digits."##,
5281 }, 5711 },
5282 LintCompletion { 5712 Lint {
5283 label: "clippy::large_const_arrays", 5713 label: "clippy::large_const_arrays",
5284 description: r##"Checks for large `const` arrays that should\nbe defined as `static` instead."##, 5714 description: r##"Checks for large `const` arrays that should\nbe defined as `static` instead."##,
5285 }, 5715 },
5286 LintCompletion { 5716 Lint {
5287 label: "clippy::large_digit_groups", 5717 label: "clippy::large_digit_groups",
5288 description: r##"Warns if the digits of an integral or floating-point\nconstant are grouped into groups that\nare too large."##, 5718 description: r##"Warns if the digits of an integral or floating-point\nconstant are grouped into groups that\nare too large."##,
5289 }, 5719 },
5290 LintCompletion { 5720 Lint {
5291 label: "clippy::large_enum_variant", 5721 label: "clippy::large_enum_variant",
5292 description: r##"Checks for large size differences between variants on\n`enum`s."##, 5722 description: r##"Checks for large size differences between variants on\n`enum`s."##,
5293 }, 5723 },
5294 LintCompletion { 5724 Lint {
5295 label: "clippy::large_stack_arrays", 5725 label: "clippy::large_stack_arrays",
5296 description: r##"Checks for local arrays that may be too large."##, 5726 description: r##"Checks for local arrays that may be too large."##,
5297 }, 5727 },
5298 LintCompletion { 5728 Lint {
5299 label: "clippy::large_types_passed_by_value", 5729 label: "clippy::large_types_passed_by_value",
5300 description: r##"Checks for functions taking arguments by value, where\nthe argument type is `Copy` and large enough to be worth considering\npassing by reference. Does not trigger if the function is being exported,\nbecause that might induce API breakage, if the parameter is declared as mutable,\nor if the argument is a `self`."##, 5730 description: r##"Checks for functions taking arguments by value, where\nthe argument type is `Copy` and large enough to be worth considering\npassing by reference. Does not trigger if the function is being exported,\nbecause that might induce API breakage, if the parameter is declared as mutable,\nor if the argument is a `self`."##,
5301 }, 5731 },
5302 LintCompletion { 5732 Lint {
5303 label: "clippy::len_without_is_empty", 5733 label: "clippy::len_without_is_empty",
5304 description: r##"Checks for items that implement `.len()` but not\n`.is_empty()`."##, 5734 description: r##"Checks for items that implement `.len()` but not\n`.is_empty()`."##,
5305 }, 5735 },
5306 LintCompletion { 5736 Lint {
5307 label: "clippy::len_zero", 5737 label: "clippy::len_zero",
5308 description: r##"Checks for getting the length of something via `.len()`\njust to compare to zero, and suggests using `.is_empty()` where applicable."##, 5738 description: r##"Checks for getting the length of something via `.len()`\njust to compare to zero, and suggests using `.is_empty()` where applicable."##,
5309 }, 5739 },
5310 LintCompletion { 5740 Lint {
5311 label: "clippy::let_and_return", 5741 label: "clippy::let_and_return",
5312 description: r##"Checks for `let`-bindings, which are subsequently\nreturned."##, 5742 description: r##"Checks for `let`-bindings, which are subsequently\nreturned."##,
5313 }, 5743 },
5314 LintCompletion { 5744 Lint {
5315 label: "clippy::let_underscore_drop", 5745 label: "clippy::let_underscore_drop",
5316 description: r##"Checks for `let _ = <expr>`\nwhere expr has a type that implements `Drop`"##, 5746 description: r##"Checks for `let _ = <expr>`\nwhere expr has a type that implements `Drop`"##,
5317 }, 5747 },
5318 LintCompletion { 5748 Lint {
5319 label: "clippy::let_underscore_lock", 5749 label: "clippy::let_underscore_lock",
5320 description: r##"Checks for `let _ = sync_lock`"##, 5750 description: r##"Checks for `let _ = sync_lock`"##,
5321 }, 5751 },
5322 LintCompletion { 5752 Lint {
5323 label: "clippy::let_underscore_must_use", 5753 label: "clippy::let_underscore_must_use",
5324 description: r##"Checks for `let _ = <expr>`\nwhere expr is #[must_use]"##, 5754 description: r##"Checks for `let _ = <expr>`\nwhere expr is #[must_use]"##,
5325 }, 5755 },
5326 LintCompletion { 5756 Lint { label: "clippy::let_unit_value", description: r##"Checks for binding a unit value."## },
5327 label: "clippy::let_unit_value", 5757 Lint {
5328 description: r##"Checks for binding a unit value."##,
5329 },
5330 LintCompletion {
5331 label: "clippy::linkedlist", 5758 label: "clippy::linkedlist",
5332 description: r##"Checks for usage of any `LinkedList`, suggesting to use a\n`Vec` or a `VecDeque` (formerly called `RingBuf`)."##, 5759 description: r##"Checks for usage of any `LinkedList`, suggesting to use a\n`Vec` or a `VecDeque` (formerly called `RingBuf`)."##,
5333 }, 5760 },
5334 LintCompletion { 5761 Lint {
5335 label: "clippy::logic_bug", 5762 label: "clippy::logic_bug",
5336 description: r##"Checks for boolean expressions that contain terminals that\ncan be eliminated."##, 5763 description: r##"Checks for boolean expressions that contain terminals that\ncan be eliminated."##,
5337 }, 5764 },
5338 LintCompletion { 5765 Lint {
5339 label: "clippy::lossy_float_literal", 5766 label: "clippy::lossy_float_literal",
5340 description: r##"Checks for whole number float literals that\ncannot be represented as the underlying type without loss."##, 5767 description: r##"Checks for whole number float literals that\ncannot be represented as the underlying type without loss."##,
5341 }, 5768 },
5342 LintCompletion { 5769 Lint {
5343 label: "clippy::macro_use_imports", 5770 label: "clippy::macro_use_imports",
5344 description: r##"Checks for `#[macro_use] use...`."##, 5771 description: r##"Checks for `#[macro_use] use...`."##,
5345 }, 5772 },
5346 LintCompletion { 5773 Lint {
5347 label: "clippy::main_recursion", 5774 label: "clippy::main_recursion",
5348 description: r##"Checks for recursion using the entrypoint."##, 5775 description: r##"Checks for recursion using the entrypoint."##,
5349 }, 5776 },
5350 LintCompletion { 5777 Lint {
5351 label: "clippy::manual_async_fn", 5778 label: "clippy::manual_async_fn",
5352 description: r##"It checks for manual implementations of `async` functions."##, 5779 description: r##"It checks for manual implementations of `async` functions."##,
5353 }, 5780 },
5354 LintCompletion { 5781 Lint {
5355 label: "clippy::manual_filter_map", 5782 label: "clippy::manual_filter_map",
5356 description: r##"Checks for usage of `_.filter(_).map(_)` that can be written more simply\nas `filter_map(_)`."##, 5783 description: r##"Checks for usage of `_.filter(_).map(_)` that can be written more simply\nas `filter_map(_)`."##,
5357 }, 5784 },
5358 LintCompletion { 5785 Lint {
5359 label: "clippy::manual_find_map", 5786 label: "clippy::manual_find_map",
5360 description: r##"Checks for usage of `_.find(_).map(_)` that can be written more simply\nas `find_map(_)`."##, 5787 description: r##"Checks for usage of `_.find(_).map(_)` that can be written more simply\nas `find_map(_)`."##,
5361 }, 5788 },
5362 LintCompletion { 5789 Lint {
5363 label: "clippy::manual_flatten", 5790 label: "clippy::manual_flatten",
5364 description: r##"Check for unnecessary `if let` usage in a for loop\nwhere only the `Some` or `Ok` variant of the iterator element is used."##, 5791 description: r##"Check for unnecessary `if let` usage in a for loop\nwhere only the `Some` or `Ok` variant of the iterator element is used."##,
5365 }, 5792 },
5366 LintCompletion { 5793 Lint {
5367 label: "clippy::manual_map", 5794 label: "clippy::manual_map",
5368 description: r##"Checks for usages of `match` which could be implemented using `map`"##, 5795 description: r##"Checks for usages of `match` which could be implemented using `map`"##,
5369 }, 5796 },
5370 LintCompletion { 5797 Lint {
5371 label: "clippy::manual_memcpy", 5798 label: "clippy::manual_memcpy",
5372 description: r##"Checks for for-loops that manually copy items between\nslices that could be optimized by having a memcpy."##, 5799 description: r##"Checks for for-loops that manually copy items between\nslices that could be optimized by having a memcpy."##,
5373 }, 5800 },
5374 LintCompletion { 5801 Lint {
5375 label: "clippy::manual_non_exhaustive", 5802 label: "clippy::manual_non_exhaustive",
5376 description: r##"Checks for manual implementations of the non-exhaustive pattern."##, 5803 description: r##"Checks for manual implementations of the non-exhaustive pattern."##,
5377 }, 5804 },
5378 LintCompletion { 5805 Lint {
5379 label: "clippy::manual_ok_or", 5806 label: "clippy::manual_ok_or",
5380 description: r##"Finds patterns that reimplement `Option::ok_or`."##, 5807 description: r##"Finds patterns that reimplement `Option::ok_or`."##,
5381 }, 5808 },
5382 LintCompletion { 5809 Lint {
5383 label: "clippy::manual_range_contains", 5810 label: "clippy::manual_range_contains",
5384 description: r##"Checks for expressions like `x >= 3 && x < 8` that could\nbe more readably expressed as `(3..8).contains(x)`."##, 5811 description: r##"Checks for expressions like `x >= 3 && x < 8` that could\nbe more readably expressed as `(3..8).contains(x)`."##,
5385 }, 5812 },
5386 LintCompletion { 5813 Lint {
5387 label: "clippy::manual_saturating_arithmetic", 5814 label: "clippy::manual_saturating_arithmetic",
5388 description: r##"Checks for `.checked_add/sub(x).unwrap_or(MAX/MIN)`."##, 5815 description: r##"Checks for `.checked_add/sub(x).unwrap_or(MAX/MIN)`."##,
5389 }, 5816 },
5390 LintCompletion { 5817 Lint {
5391 label: "clippy::manual_str_repeat", 5818 label: "clippy::manual_str_repeat",
5392 description: r##"Checks for manual implementations of `str::repeat`"##, 5819 description: r##"Checks for manual implementations of `str::repeat`"##,
5393 }, 5820 },
5394 LintCompletion { 5821 Lint {
5395 label: "clippy::manual_strip", 5822 label: "clippy::manual_strip",
5396 description: r##"Suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing using\nthe pattern's length."##, 5823 description: r##"Suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing using\nthe pattern's length."##,
5397 }, 5824 },
5398 LintCompletion { 5825 Lint { label: "clippy::manual_swap", description: r##"Checks for manual swapping."## },
5399 label: "clippy::manual_swap", 5826 Lint {
5400 description: r##"Checks for manual swapping."##,
5401 },
5402 LintCompletion {
5403 label: "clippy::manual_unwrap_or", 5827 label: "clippy::manual_unwrap_or",
5404 description: r##"Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`."##, 5828 description: r##"Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`."##,
5405 }, 5829 },
5406 LintCompletion { 5830 Lint {
5407 label: "clippy::many_single_char_names", 5831 label: "clippy::many_single_char_names",
5408 description: r##"Checks for too many variables whose name consists of a\nsingle character."##, 5832 description: r##"Checks for too many variables whose name consists of a\nsingle character."##,
5409 }, 5833 },
5410 LintCompletion { 5834 Lint {
5411 label: "clippy::map_clone", 5835 label: "clippy::map_clone",
5412 description: r##"Checks for usage of `map(|x| x.clone())` or\ndereferencing closures for `Copy` types, on `Iterator` or `Option`,\nand suggests `cloned()` or `copied()` instead"##, 5836 description: r##"Checks for usage of `map(|x| x.clone())` or\ndereferencing closures for `Copy` types, on `Iterator` or `Option`,\nand suggests `cloned()` or `copied()` instead"##,
5413 }, 5837 },
5414 LintCompletion { 5838 Lint {
5415 label: "clippy::map_collect_result_unit", 5839 label: "clippy::map_collect_result_unit",
5416 description: r##"Checks for usage of `_.map(_).collect::<Result<(), _>()`."##, 5840 description: r##"Checks for usage of `_.map(_).collect::<Result<(), _>()`."##,
5417 }, 5841 },
5418 LintCompletion { 5842 Lint {
5419 label: "clippy::map_entry", 5843 label: "clippy::map_entry",
5420 description: r##"Checks for uses of `contains_key` + `insert` on `HashMap`\nor `BTreeMap`."##, 5844 description: r##"Checks for uses of `contains_key` + `insert` on `HashMap`\nor `BTreeMap`."##,
5421 }, 5845 },
5422 LintCompletion { 5846 Lint {
5423 label: "clippy::map_err_ignore", 5847 label: "clippy::map_err_ignore",
5424 description: r##"Checks for instances of `map_err(|_| Some::Enum)`"##, 5848 description: r##"Checks for instances of `map_err(|_| Some::Enum)`"##,
5425 }, 5849 },
5426 LintCompletion { 5850 Lint {
5427 label: "clippy::map_flatten", 5851 label: "clippy::map_flatten",
5428 description: r##"Checks for usage of `_.map(_).flatten(_)` on `Iterator` and `Option`"##, 5852 description: r##"Checks for usage of `_.map(_).flatten(_)` on `Iterator` and `Option`"##,
5429 }, 5853 },
5430 LintCompletion { 5854 Lint {
5431 label: "clippy::map_identity", 5855 label: "clippy::map_identity",
5432 description: r##"Checks for instances of `map(f)` where `f` is the identity function."##, 5856 description: r##"Checks for instances of `map(f)` where `f` is the identity function."##,
5433 }, 5857 },
5434 LintCompletion { 5858 Lint {
5435 label: "clippy::map_unwrap_or", 5859 label: "clippy::map_unwrap_or",
5436 description: r##"Checks for usage of `option.map(_).unwrap_or(_)` or `option.map(_).unwrap_or_else(_)` or\n`result.map(_).unwrap_or_else(_)`."##, 5860 description: r##"Checks for usage of `option.map(_).unwrap_or(_)` or `option.map(_).unwrap_or_else(_)` or\n`result.map(_).unwrap_or_else(_)`."##,
5437 }, 5861 },
5438 LintCompletion { 5862 Lint {
5439 label: "clippy::match_as_ref", 5863 label: "clippy::match_as_ref",
5440 description: r##"Checks for match which is used to add a reference to an\n`Option` value."##, 5864 description: r##"Checks for match which is used to add a reference to an\n`Option` value."##,
5441 }, 5865 },
5442 LintCompletion { 5866 Lint {
5443 label: "clippy::match_bool", 5867 label: "clippy::match_bool",
5444 description: r##"Checks for matches where match expression is a `bool`. It\nsuggests to replace the expression with an `if...else` block."##, 5868 description: r##"Checks for matches where match expression is a `bool`. It\nsuggests to replace the expression with an `if...else` block."##,
5445 }, 5869 },
5446 LintCompletion { 5870 Lint {
5447 label: "clippy::match_like_matches_macro", 5871 label: "clippy::match_like_matches_macro",
5448 description: r##"Checks for `match` or `if let` expressions producing a\n`bool` that could be written using `matches!`"##, 5872 description: r##"Checks for `match` or `if let` expressions producing a\n`bool` that could be written using `matches!`"##,
5449 }, 5873 },
5450 LintCompletion { 5874 Lint {
5451 label: "clippy::match_on_vec_items", 5875 label: "clippy::match_on_vec_items",
5452 description: r##"Checks for `match vec[idx]` or `match vec[n..m]`."##, 5876 description: r##"Checks for `match vec[idx]` or `match vec[n..m]`."##,
5453 }, 5877 },
5454 LintCompletion { 5878 Lint {
5455 label: "clippy::match_overlapping_arm", 5879 label: "clippy::match_overlapping_arm",
5456 description: r##"Checks for overlapping match arms."##, 5880 description: r##"Checks for overlapping match arms."##,
5457 }, 5881 },
5458 LintCompletion { 5882 Lint {
5459 label: "clippy::match_ref_pats", 5883 label: "clippy::match_ref_pats",
5460 description: r##"Checks for matches where all arms match a reference,\nsuggesting to remove the reference and deref the matched expression\ninstead. It also checks for `if let &foo = bar` blocks."##, 5884 description: r##"Checks for matches where all arms match a reference,\nsuggesting to remove the reference and deref the matched expression\ninstead. It also checks for `if let &foo = bar` blocks."##,
5461 }, 5885 },
5462 LintCompletion { 5886 Lint {
5463 label: "clippy::match_same_arms", 5887 label: "clippy::match_same_arms",
5464 description: r##"Checks for `match` with identical arm bodies."##, 5888 description: r##"Checks for `match` with identical arm bodies."##,
5465 }, 5889 },
5466 LintCompletion { 5890 Lint {
5467 label: "clippy::match_single_binding", 5891 label: "clippy::match_single_binding",
5468 description: r##"Checks for useless match that binds to only one value."##, 5892 description: r##"Checks for useless match that binds to only one value."##,
5469 }, 5893 },
5470 LintCompletion { 5894 Lint {
5471 label: "clippy::match_wild_err_arm", 5895 label: "clippy::match_wild_err_arm",
5472 description: r##"Checks for arm which matches all errors with `Err(_)`\nand take drastic actions like `panic!`."##, 5896 description: r##"Checks for arm which matches all errors with `Err(_)`\nand take drastic actions like `panic!`."##,
5473 }, 5897 },
5474 LintCompletion { 5898 Lint {
5475 label: "clippy::match_wildcard_for_single_variants", 5899 label: "clippy::match_wildcard_for_single_variants",
5476 description: r##"Checks for wildcard enum matches for a single variant."##, 5900 description: r##"Checks for wildcard enum matches for a single variant."##,
5477 }, 5901 },
5478 LintCompletion { 5902 Lint {
5479 label: "clippy::maybe_infinite_iter", 5903 label: "clippy::maybe_infinite_iter",
5480 description: r##"Checks for iteration that may be infinite."##, 5904 description: r##"Checks for iteration that may be infinite."##,
5481 }, 5905 },
5482 LintCompletion { 5906 Lint {
5483 label: "clippy::mem_discriminant_non_enum", 5907 label: "clippy::mem_discriminant_non_enum",
5484 description: r##"Checks for calls of `mem::discriminant()` on a non-enum type."##, 5908 description: r##"Checks for calls of `mem::discriminant()` on a non-enum type."##,
5485 }, 5909 },
5486 LintCompletion { 5910 Lint {
5487 label: "clippy::mem_forget", 5911 label: "clippy::mem_forget",
5488 description: r##"Checks for usage of `std::mem::forget(t)` where `t` is\n`Drop`."##, 5912 description: r##"Checks for usage of `std::mem::forget(t)` where `t` is\n`Drop`."##,
5489 }, 5913 },
5490 LintCompletion { 5914 Lint {
5491 label: "clippy::mem_replace_option_with_none", 5915 label: "clippy::mem_replace_option_with_none",
5492 description: r##"Checks for `mem::replace()` on an `Option` with\n`None`."##, 5916 description: r##"Checks for `mem::replace()` on an `Option` with\n`None`."##,
5493 }, 5917 },
5494 LintCompletion { 5918 Lint {
5495 label: "clippy::mem_replace_with_default", 5919 label: "clippy::mem_replace_with_default",
5496 description: r##"Checks for `std::mem::replace` on a value of type\n`T` with `T::default()`."##, 5920 description: r##"Checks for `std::mem::replace` on a value of type\n`T` with `T::default()`."##,
5497 }, 5921 },
5498 LintCompletion { 5922 Lint {
5499 label: "clippy::mem_replace_with_uninit", 5923 label: "clippy::mem_replace_with_uninit",
5500 description: r##"Checks for `mem::replace(&mut _, mem::uninitialized())`\nand `mem::replace(&mut _, mem::zeroed())`."##, 5924 description: r##"Checks for `mem::replace(&mut _, mem::uninitialized())`\nand `mem::replace(&mut _, mem::zeroed())`."##,
5501 }, 5925 },
5502 LintCompletion { 5926 Lint {
5503 label: "clippy::min_max", 5927 label: "clippy::min_max",
5504 description: r##"Checks for expressions where `std::cmp::min` and `max` are\nused to clamp values, but switched so that the result is constant."##, 5928 description: r##"Checks for expressions where `std::cmp::min` and `max` are\nused to clamp values, but switched so that the result is constant."##,
5505 }, 5929 },
5506 LintCompletion { 5930 Lint {
5507 label: "clippy::misaligned_transmute", 5931 label: "clippy::misaligned_transmute",
5508 description: r##"Nothing. This lint has been deprecated."##, 5932 description: r##"Nothing. This lint has been deprecated."##,
5509 }, 5933 },
5510 LintCompletion { 5934 Lint {
5511 label: "clippy::mismatched_target_os", 5935 label: "clippy::mismatched_target_os",
5512 description: r##"Checks for cfg attributes having operating systems used in target family position."##, 5936 description: r##"Checks for cfg attributes having operating systems used in target family position."##,
5513 }, 5937 },
5514 LintCompletion { 5938 Lint {
5515 label: "clippy::misrefactored_assign_op", 5939 label: "clippy::misrefactored_assign_op",
5516 description: r##"Checks for `a op= a op b` or `a op= b op a` patterns."##, 5940 description: r##"Checks for `a op= a op b` or `a op= b op a` patterns."##,
5517 }, 5941 },
5518 LintCompletion { 5942 Lint {
5519 label: "clippy::missing_const_for_fn", 5943 label: "clippy::missing_const_for_fn",
5520 description: r##"Suggests the use of `const` in functions and methods where possible."##, 5944 description: r##"Suggests the use of `const` in functions and methods where possible."##,
5521 }, 5945 },
5522 LintCompletion { 5946 Lint {
5523 label: "clippy::missing_docs_in_private_items", 5947 label: "clippy::missing_docs_in_private_items",
5524 description: r##"Warns if there is missing doc for any documentable item\n(public or private)."##, 5948 description: r##"Warns if there is missing doc for any documentable item\n(public or private)."##,
5525 }, 5949 },
5526 LintCompletion { 5950 Lint {
5527 label: "clippy::missing_errors_doc", 5951 label: "clippy::missing_errors_doc",
5528 description: r##"Checks the doc comments of publicly visible functions that\nreturn a `Result` type and warns if there is no `# Errors` section."##, 5952 description: r##"Checks the doc comments of publicly visible functions that\nreturn a `Result` type and warns if there is no `# Errors` section."##,
5529 }, 5953 },
5530 LintCompletion { 5954 Lint {
5531 label: "clippy::missing_inline_in_public_items", 5955 label: "clippy::missing_inline_in_public_items",
5532 description: r##"it lints if an exported function, method, trait method with default impl,\nor trait method impl is not `#[inline]`."##, 5956 description: r##"it lints if an exported function, method, trait method with default impl,\nor trait method impl is not `#[inline]`."##,
5533 }, 5957 },
5534 LintCompletion { 5958 Lint {
5535 label: "clippy::missing_panics_doc", 5959 label: "clippy::missing_panics_doc",
5536 description: r##"Checks the doc comments of publicly visible functions that\nmay panic and warns if there is no `# Panics` section."##, 5960 description: r##"Checks the doc comments of publicly visible functions that\nmay panic and warns if there is no `# Panics` section."##,
5537 }, 5961 },
5538 LintCompletion { 5962 Lint {
5539 label: "clippy::missing_safety_doc", 5963 label: "clippy::missing_safety_doc",
5540 description: r##"Checks for the doc comments of publicly visible\nunsafe functions and warns if there is no `# Safety` section."##, 5964 description: r##"Checks for the doc comments of publicly visible\nunsafe functions and warns if there is no `# Safety` section."##,
5541 }, 5965 },
5542 LintCompletion { 5966 Lint {
5543 label: "clippy::mistyped_literal_suffixes", 5967 label: "clippy::mistyped_literal_suffixes",
5544 description: r##"Warns for mistyped suffix in literals"##, 5968 description: r##"Warns for mistyped suffix in literals"##,
5545 }, 5969 },
5546 LintCompletion { 5970 Lint {
5547 label: "clippy::mixed_case_hex_literals", 5971 label: "clippy::mixed_case_hex_literals",
5548 description: r##"Warns on hexadecimal literals with mixed-case letter\ndigits."##, 5972 description: r##"Warns on hexadecimal literals with mixed-case letter\ndigits."##,
5549 }, 5973 },
5550 LintCompletion { 5974 Lint {
5551 label: "clippy::module_inception", 5975 label: "clippy::module_inception",
5552 description: r##"Checks for modules that have the same name as their\nparent module"##, 5976 description: r##"Checks for modules that have the same name as their\nparent module"##,
5553 }, 5977 },
5554 LintCompletion { 5978 Lint {
5555 label: "clippy::module_name_repetitions", 5979 label: "clippy::module_name_repetitions",
5556 description: r##"Detects type names that are prefixed or suffixed by the\ncontaining module's name."##, 5980 description: r##"Detects type names that are prefixed or suffixed by the\ncontaining module's name."##,
5557 }, 5981 },
5558 LintCompletion { 5982 Lint { label: "clippy::modulo_arithmetic", description: r##"Checks for modulo arithmetic."## },
5559 label: "clippy::modulo_arithmetic", 5983 Lint {
5560 description: r##"Checks for modulo arithmetic."##,
5561 },
5562 LintCompletion {
5563 label: "clippy::modulo_one", 5984 label: "clippy::modulo_one",
5564 description: r##"Checks for getting the remainder of a division by one or minus\none."##, 5985 description: r##"Checks for getting the remainder of a division by one or minus\none."##,
5565 }, 5986 },
5566 LintCompletion { 5987 Lint {
5567 label: "clippy::multiple_crate_versions", 5988 label: "clippy::multiple_crate_versions",
5568 description: r##"Checks to see if multiple versions of a crate are being\nused."##, 5989 description: r##"Checks to see if multiple versions of a crate are being\nused."##,
5569 }, 5990 },
5570 LintCompletion { 5991 Lint {
5571 label: "clippy::multiple_inherent_impl", 5992 label: "clippy::multiple_inherent_impl",
5572 description: r##"Checks for multiple inherent implementations of a struct"##, 5993 description: r##"Checks for multiple inherent implementations of a struct"##,
5573 }, 5994 },
5574 LintCompletion { 5995 Lint {
5575 label: "clippy::must_use_candidate", 5996 label: "clippy::must_use_candidate",
5576 description: r##"Checks for public functions that have no\n[`#[must_use]`] attribute, but return something not already marked\nmust-use, have no mutable arg and mutate no statics.\n\n[`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"##, 5997 description: r##"Checks for public functions that have no\n[`#[must_use]`] attribute, but return something not already marked\nmust-use, have no mutable arg and mutate no statics.\n\n[`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"##,
5577 }, 5998 },
5578 LintCompletion { 5999 Lint {
5579 label: "clippy::must_use_unit", 6000 label: "clippy::must_use_unit",
5580 description: r##"Checks for a [`#[must_use]`] attribute on\nunit-returning functions and methods.\n\n[`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"##, 6001 description: r##"Checks for a [`#[must_use]`] attribute on\nunit-returning functions and methods.\n\n[`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"##,
5581 }, 6002 },
5582 LintCompletion { 6003 Lint {
5583 label: "clippy::mut_from_ref", 6004 label: "clippy::mut_from_ref",
5584 description: r##"This lint checks for functions that take immutable\nreferences and return mutable ones."##, 6005 description: r##"This lint checks for functions that take immutable\nreferences and return mutable ones."##,
5585 }, 6006 },
5586 LintCompletion { 6007 Lint {
5587 label: "clippy::mut_mut", 6008 label: "clippy::mut_mut",
5588 description: r##"Checks for instances of `mut mut` references."##, 6009 description: r##"Checks for instances of `mut mut` references."##,
5589 }, 6010 },
5590 LintCompletion { 6011 Lint {
5591 label: "clippy::mut_mutex_lock", 6012 label: "clippy::mut_mutex_lock",
5592 description: r##"Checks for `&mut Mutex::lock` calls"##, 6013 description: r##"Checks for `&mut Mutex::lock` calls"##,
5593 }, 6014 },
5594 LintCompletion { 6015 Lint {
5595 label: "clippy::mut_range_bound", 6016 label: "clippy::mut_range_bound",
5596 description: r##"Checks for loops which have a range bound that is a mutable variable"##, 6017 description: r##"Checks for loops which have a range bound that is a mutable variable"##,
5597 }, 6018 },
5598 LintCompletion { 6019 Lint {
5599 label: "clippy::mutable_key_type", 6020 label: "clippy::mutable_key_type",
5600 description: r##"Checks for sets/maps with mutable key types."##, 6021 description: r##"Checks for sets/maps with mutable key types."##,
5601 }, 6022 },
5602 LintCompletion { 6023 Lint {
5603 label: "clippy::mutex_atomic", 6024 label: "clippy::mutex_atomic",
5604 description: r##"Checks for usages of `Mutex<X>` where an atomic will do."##, 6025 description: r##"Checks for usages of `Mutex<X>` where an atomic will do."##,
5605 }, 6026 },
5606 LintCompletion { 6027 Lint {
5607 label: "clippy::mutex_integer", 6028 label: "clippy::mutex_integer",
5608 description: r##"Checks for usages of `Mutex<X>` where `X` is an integral\ntype."##, 6029 description: r##"Checks for usages of `Mutex<X>` where `X` is an integral\ntype."##,
5609 }, 6030 },
5610 LintCompletion { 6031 Lint { label: "clippy::naive_bytecount", description: r##"Checks for naive byte counts"## },
5611 label: "clippy::naive_bytecount", 6032 Lint {
5612 description: r##"Checks for naive byte counts"##,
5613 },
5614 LintCompletion {
5615 label: "clippy::needless_arbitrary_self_type", 6033 label: "clippy::needless_arbitrary_self_type",
5616 description: r##"The lint checks for `self` in fn parameters that\nspecify the `Self`-type explicitly"##, 6034 description: r##"The lint checks for `self` in fn parameters that\nspecify the `Self`-type explicitly"##,
5617 }, 6035 },
5618 LintCompletion { 6036 Lint {
5619 label: "clippy::needless_bitwise_bool", 6037 label: "clippy::needless_bitwise_bool",
5620 description: r##"Checks for uses of bitwise and/or operators between booleans, where performance may be improved by using\na lazy and."##, 6038 description: r##"Checks for uses of bitwise and/or operators between booleans, where performance may be improved by using\na lazy and."##,
5621 }, 6039 },
5622 LintCompletion { 6040 Lint {
5623 label: "clippy::needless_bool", 6041 label: "clippy::needless_bool",
5624 description: r##"Checks for expressions of the form `if c { true } else {\nfalse }` (or vice versa) and suggests using the condition directly."##, 6042 description: r##"Checks for expressions of the form `if c { true } else {\nfalse }` (or vice versa) and suggests using the condition directly."##,
5625 }, 6043 },
5626 LintCompletion { 6044 Lint {
5627 label: "clippy::needless_borrow", 6045 label: "clippy::needless_borrow",
5628 description: r##"Checks for address of operations (`&`) that are going to\nbe dereferenced immediately by the compiler."##, 6046 description: r##"Checks for address of operations (`&`) that are going to\nbe dereferenced immediately by the compiler."##,
5629 }, 6047 },
5630 LintCompletion { 6048 Lint {
5631 label: "clippy::needless_borrowed_reference", 6049 label: "clippy::needless_borrowed_reference",
5632 description: r##"Checks for bindings that destructure a reference and borrow the inner\nvalue with `&ref`."##, 6050 description: r##"Checks for bindings that destructure a reference and borrow the inner\nvalue with `&ref`."##,
5633 }, 6051 },
5634 LintCompletion { 6052 Lint {
5635 label: "clippy::needless_collect", 6053 label: "clippy::needless_collect",
5636 description: r##"Checks for functions collecting an iterator when collect\nis not needed."##, 6054 description: r##"Checks for functions collecting an iterator when collect\nis not needed."##,
5637 }, 6055 },
5638 LintCompletion { 6056 Lint {
5639 label: "clippy::needless_continue", 6057 label: "clippy::needless_continue",
5640 description: r##"The lint checks for `if`-statements appearing in loops\nthat contain a `continue` statement in either their main blocks or their\n`else`-blocks, when omitting the `else`-block possibly with some\nrearrangement of code can make the code easier to understand."##, 6058 description: r##"The lint checks for `if`-statements appearing in loops\nthat contain a `continue` statement in either their main blocks or their\n`else`-blocks, when omitting the `else`-block possibly with some\nrearrangement of code can make the code easier to understand."##,
5641 }, 6059 },
5642 LintCompletion { 6060 Lint {
5643 label: "clippy::needless_doctest_main", 6061 label: "clippy::needless_doctest_main",
5644 description: r##"Checks for `fn main() { .. }` in doctests"##, 6062 description: r##"Checks for `fn main() { .. }` in doctests"##,
5645 }, 6063 },
5646 LintCompletion { 6064 Lint {
5647 label: "clippy::needless_for_each", 6065 label: "clippy::needless_for_each",
5648 description: r##"Checks for usage of `for_each` that would be more simply written as a\n`for` loop."##, 6066 description: r##"Checks for usage of `for_each` that would be more simply written as a\n`for` loop."##,
5649 }, 6067 },
5650 LintCompletion { 6068 Lint {
5651 label: "clippy::needless_lifetimes", 6069 label: "clippy::needless_lifetimes",
5652 description: r##"Checks for lifetime annotations which can be removed by\nrelying on lifetime elision."##, 6070 description: r##"Checks for lifetime annotations which can be removed by\nrelying on lifetime elision."##,
5653 }, 6071 },
5654 LintCompletion { 6072 Lint {
5655 label: "clippy::needless_pass_by_value", 6073 label: "clippy::needless_pass_by_value",
5656 description: r##"Checks for functions taking arguments by value, but not\nconsuming them in its\nbody."##, 6074 description: r##"Checks for functions taking arguments by value, but not\nconsuming them in its\nbody."##,
5657 }, 6075 },
5658 LintCompletion { 6076 Lint {
5659 label: "clippy::needless_question_mark", 6077 label: "clippy::needless_question_mark",
5660 description: r##"Suggests alternatives for useless applications of `?` in terminating expressions"##, 6078 description: r##"Suggests alternatives for useless applications of `?` in terminating expressions"##,
5661 }, 6079 },
5662 LintCompletion { 6080 Lint {
5663 label: "clippy::needless_range_loop", 6081 label: "clippy::needless_range_loop",
5664 description: r##"Checks for looping over the range of `0..len` of some\ncollection just to get the values by index."##, 6082 description: r##"Checks for looping over the range of `0..len` of some\ncollection just to get the values by index."##,
5665 }, 6083 },
5666 LintCompletion { 6084 Lint {
5667 label: "clippy::needless_return", 6085 label: "clippy::needless_return",
5668 description: r##"Checks for return statements at the end of a block."##, 6086 description: r##"Checks for return statements at the end of a block."##,
5669 }, 6087 },
5670 LintCompletion { 6088 Lint {
5671 label: "clippy::needless_update", 6089 label: "clippy::needless_update",
5672 description: r##"Checks for needlessly including a base struct on update\nwhen all fields are changed anyway.\n\nThis lint is not applied to structs marked with\n[non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html)."##, 6090 description: r##"Checks for needlessly including a base struct on update\nwhen all fields are changed anyway.\n\nThis lint is not applied to structs marked with\n[non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html)."##,
5673 }, 6091 },
5674 LintCompletion { 6092 Lint {
5675 label: "clippy::neg_cmp_op_on_partial_ord", 6093 label: "clippy::neg_cmp_op_on_partial_ord",
5676 description: r##"Checks for the usage of negated comparison operators on types which only implement\n`PartialOrd` (e.g., `f64`)."##, 6094 description: r##"Checks for the usage of negated comparison operators on types which only implement\n`PartialOrd` (e.g., `f64`)."##,
5677 }, 6095 },
5678 LintCompletion { 6096 Lint {
5679 label: "clippy::neg_multiply", 6097 label: "clippy::neg_multiply",
5680 description: r##"Checks for multiplication by -1 as a form of negation."##, 6098 description: r##"Checks for multiplication by -1 as a form of negation."##,
5681 }, 6099 },
5682 LintCompletion { 6100 Lint {
5683 label: "clippy::never_loop", 6101 label: "clippy::never_loop",
5684 description: r##"Checks for loops that will always `break`, `return` or\n`continue` an outer loop."##, 6102 description: r##"Checks for loops that will always `break`, `return` or\n`continue` an outer loop."##,
5685 }, 6103 },
5686 LintCompletion { 6104 Lint {
5687 label: "clippy::new_ret_no_self", 6105 label: "clippy::new_ret_no_self",
5688 description: r##"Checks for `new` not returning a type that contains `Self`."##, 6106 description: r##"Checks for `new` not returning a type that contains `Self`."##,
5689 }, 6107 },
5690 LintCompletion { 6108 Lint {
5691 label: "clippy::new_without_default", 6109 label: "clippy::new_without_default",
5692 description: r##"Checks for types with a `fn new() -> Self` method and no\nimplementation of\n[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html)."##, 6110 description: r##"Checks for types with a `fn new() -> Self` method and no\nimplementation of\n[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html)."##,
5693 }, 6111 },
5694 LintCompletion { 6112 Lint {
5695 label: "clippy::no_effect", 6113 label: "clippy::no_effect",
5696 description: r##"Checks for statements which have no effect."##, 6114 description: r##"Checks for statements which have no effect."##,
5697 }, 6115 },
5698 LintCompletion { 6116 Lint {
5699 label: "clippy::non_ascii_literal", 6117 label: "clippy::non_ascii_literal",
5700 description: r##"Checks for non-ASCII characters in string literals."##, 6118 description: r##"Checks for non-ASCII characters in string literals."##,
5701 }, 6119 },
5702 LintCompletion { 6120 Lint {
5703 label: "clippy::non_octal_unix_permissions", 6121 label: "clippy::non_octal_unix_permissions",
5704 description: r##"Checks for non-octal values used to set Unix file permissions."##, 6122 description: r##"Checks for non-octal values used to set Unix file permissions."##,
5705 }, 6123 },
5706 LintCompletion { 6124 Lint {
5707 label: "clippy::nonminimal_bool", 6125 label: "clippy::nonminimal_bool",
5708 description: r##"Checks for boolean expressions that can be written more\nconcisely."##, 6126 description: r##"Checks for boolean expressions that can be written more\nconcisely."##,
5709 }, 6127 },
5710 LintCompletion { 6128 Lint {
5711 label: "clippy::nonsensical_open_options", 6129 label: "clippy::nonsensical_open_options",
5712 description: r##"Checks for duplicate open options as well as combinations\nthat make no sense."##, 6130 description: r##"Checks for duplicate open options as well as combinations\nthat make no sense."##,
5713 }, 6131 },
5714 LintCompletion { 6132 Lint {
5715 label: "clippy::not_unsafe_ptr_arg_deref", 6133 label: "clippy::not_unsafe_ptr_arg_deref",
5716 description: r##"Checks for public functions that dereference raw pointer\narguments but are not marked `unsafe`."##, 6134 description: r##"Checks for public functions that dereference raw pointer\narguments but are not marked `unsafe`."##,
5717 }, 6135 },
5718 LintCompletion { 6136 Lint { label: "clippy::ok_expect", description: r##"Checks for usage of `ok().expect(..)`."## },
5719 label: "clippy::ok_expect", 6137 Lint {
5720 description: r##"Checks for usage of `ok().expect(..)`."##,
5721 },
5722 LintCompletion {
5723 label: "clippy::op_ref", 6138 label: "clippy::op_ref",
5724 description: r##"Checks for arguments to `==` which have their address\ntaken to satisfy a bound\nand suggests to dereference the other argument instead"##, 6139 description: r##"Checks for arguments to `==` which have their address\ntaken to satisfy a bound\nand suggests to dereference the other argument instead"##,
5725 }, 6140 },
5726 LintCompletion { 6141 Lint {
5727 label: "clippy::option_as_ref_deref", 6142 label: "clippy::option_as_ref_deref",
5728 description: r##"Checks for usage of `_.as_ref().map(Deref::deref)` or it's aliases (such as String::as_str)."##, 6143 description: r##"Checks for usage of `_.as_ref().map(Deref::deref)` or it's aliases (such as String::as_str)."##,
5729 }, 6144 },
5730 LintCompletion { 6145 Lint {
5731 label: "clippy::option_env_unwrap", 6146 label: "clippy::option_env_unwrap",
5732 description: r##"Checks for usage of `option_env!(...).unwrap()` and\nsuggests usage of the `env!` macro."##, 6147 description: r##"Checks for usage of `option_env!(...).unwrap()` and\nsuggests usage of the `env!` macro."##,
5733 }, 6148 },
5734 LintCompletion { 6149 Lint {
5735 label: "clippy::option_filter_map", 6150 label: "clippy::option_filter_map",
5736 description: r##"Checks for indirect collection of populated `Option`"##, 6151 description: r##"Checks for indirect collection of populated `Option`"##,
5737 }, 6152 },
5738 LintCompletion { 6153 Lint {
5739 label: "clippy::option_if_let_else", 6154 label: "clippy::option_if_let_else",
5740 description: r##"Lints usage of `if let Some(v) = ... { y } else { x }` which is more\nidiomatically done with `Option::map_or` (if the else bit is a pure\nexpression) or `Option::map_or_else` (if the else bit is an impure\nexpression)."##, 6155 description: r##"Lints usage of `if let Some(v) = ... { y } else { x }` which is more\nidiomatically done with `Option::map_or` (if the else bit is a pure\nexpression) or `Option::map_or_else` (if the else bit is an impure\nexpression)."##,
5741 }, 6156 },
5742 LintCompletion { 6157 Lint {
5743 label: "clippy::option_map_or_none", 6158 label: "clippy::option_map_or_none",
5744 description: r##"Checks for usage of `_.map_or(None, _)`."##, 6159 description: r##"Checks for usage of `_.map_or(None, _)`."##,
5745 }, 6160 },
5746 LintCompletion { 6161 Lint {
5747 label: "clippy::option_map_unit_fn", 6162 label: "clippy::option_map_unit_fn",
5748 description: r##"Checks for usage of `option.map(f)` where f is a function\nor closure that returns the unit type `()`."##, 6163 description: r##"Checks for usage of `option.map(f)` where f is a function\nor closure that returns the unit type `()`."##,
5749 }, 6164 },
5750 LintCompletion { 6165 Lint {
5751 label: "clippy::option_option", 6166 label: "clippy::option_option",
5752 description: r##"Checks for use of `Option<Option<_>>` in function signatures and type\ndefinitions"##, 6167 description: r##"Checks for use of `Option<Option<_>>` in function signatures and type\ndefinitions"##,
5753 }, 6168 },
5754 LintCompletion { 6169 Lint {
5755 label: "clippy::or_fun_call", 6170 label: "clippy::or_fun_call",
5756 description: r##"Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`,\netc., and suggests to use `or_else`, `unwrap_or_else`, etc., or\n`unwrap_or_default` instead."##, 6171 description: r##"Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`,\netc., and suggests to use `or_else`, `unwrap_or_else`, etc., or\n`unwrap_or_default` instead."##,
5757 }, 6172 },
5758 LintCompletion { 6173 Lint {
5759 label: "clippy::out_of_bounds_indexing", 6174 label: "clippy::out_of_bounds_indexing",
5760 description: r##"Checks for out of bounds array indexing with a constant\nindex."##, 6175 description: r##"Checks for out of bounds array indexing with a constant\nindex."##,
5761 }, 6176 },
5762 LintCompletion { 6177 Lint {
5763 label: "clippy::overflow_check_conditional", 6178 label: "clippy::overflow_check_conditional",
5764 description: r##"Detects classic underflow/overflow checks."##, 6179 description: r##"Detects classic underflow/overflow checks."##,
5765 }, 6180 },
5766 LintCompletion { label: "clippy::panic", description: r##"Checks for usage of `panic!`."## }, 6181 Lint { label: "clippy::panic", description: r##"Checks for usage of `panic!`."## },
5767 LintCompletion { 6182 Lint {
5768 label: "clippy::panic_in_result_fn", 6183 label: "clippy::panic_in_result_fn",
5769 description: r##"Checks for usage of `panic!`, `unimplemented!`, `todo!`, `unreachable!` or assertions in a function of type result."##, 6184 description: r##"Checks for usage of `panic!`, `unimplemented!`, `todo!`, `unreachable!` or assertions in a function of type result."##,
5770 }, 6185 },
5771 LintCompletion { 6186 Lint {
5772 label: "clippy::panicking_unwrap", 6187 label: "clippy::panicking_unwrap",
5773 description: r##"Checks for calls of `unwrap[_err]()` that will always fail."##, 6188 description: r##"Checks for calls of `unwrap[_err]()` that will always fail."##,
5774 }, 6189 },
5775 LintCompletion { 6190 Lint {
5776 label: "clippy::partialeq_ne_impl", 6191 label: "clippy::partialeq_ne_impl",
5777 description: r##"Checks for manual re-implementations of `PartialEq::ne`."##, 6192 description: r##"Checks for manual re-implementations of `PartialEq::ne`."##,
5778 }, 6193 },
5779 LintCompletion { 6194 Lint {
5780 label: "clippy::path_buf_push_overwrite", 6195 label: "clippy::path_buf_push_overwrite",
5781 description: r##"* Checks for [push](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.push)\ncalls on `PathBuf` that can cause overwrites."##, 6196 description: r##"* Checks for [push](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.push)\ncalls on `PathBuf` that can cause overwrites."##,
5782 }, 6197 },
5783 LintCompletion { 6198 Lint {
5784 label: "clippy::pattern_type_mismatch", 6199 label: "clippy::pattern_type_mismatch",
5785 description: r##"Checks for patterns that aren't exact representations of the types\nthey are applied to.\n\nTo satisfy this lint, you will have to adjust either the expression that is matched\nagainst or the pattern itself, as well as the bindings that are introduced by the\nadjusted patterns. For matching you will have to either dereference the expression\nwith the `*` operator, or amend the patterns to explicitly match against `&<pattern>`\nor `&mut <pattern>` depending on the reference mutability. For the bindings you need\nto use the inverse. You can leave them as plain bindings if you wish for the value\nto be copied, but you must use `ref mut <variable>` or `ref <variable>` to construct\na reference into the matched structure.\n\nIf you are looking for a way to learn about ownership semantics in more detail, it\nis recommended to look at IDE options available to you to highlight types, lifetimes\nand reference semantics in your code. The available tooling would expose these things\nin a general way even outside of the various pattern matching mechanics. Of course\nthis lint can still be used to highlight areas of interest and ensure a good understanding\nof ownership semantics."##, 6200 description: r##"Checks for patterns that aren't exact representations of the types\nthey are applied to.\n\nTo satisfy this lint, you will have to adjust either the expression that is matched\nagainst or the pattern itself, as well as the bindings that are introduced by the\nadjusted patterns. For matching you will have to either dereference the expression\nwith the `*` operator, or amend the patterns to explicitly match against `&<pattern>`\nor `&mut <pattern>` depending on the reference mutability. For the bindings you need\nto use the inverse. You can leave them as plain bindings if you wish for the value\nto be copied, but you must use `ref mut <variable>` or `ref <variable>` to construct\na reference into the matched structure.\n\nIf you are looking for a way to learn about ownership semantics in more detail, it\nis recommended to look at IDE options available to you to highlight types, lifetimes\nand reference semantics in your code. The available tooling would expose these things\nin a general way even outside of the various pattern matching mechanics. Of course\nthis lint can still be used to highlight areas of interest and ensure a good understanding\nof ownership semantics."##,
5786 }, 6201 },
5787 LintCompletion { 6202 Lint {
5788 label: "clippy::possible_missing_comma", 6203 label: "clippy::possible_missing_comma",
5789 description: r##"Checks for possible missing comma in an array. It lints if\nan array element is a binary operator expression and it lies on two lines."##, 6204 description: r##"Checks for possible missing comma in an array. It lints if\nan array element is a binary operator expression and it lies on two lines."##,
5790 }, 6205 },
5791 LintCompletion { 6206 Lint {
5792 label: "clippy::precedence", 6207 label: "clippy::precedence",
5793 description: r##"Checks for operations where precedence may be unclear\nand suggests to add parentheses. Currently it catches the following:\n* mixed usage of arithmetic and bit shifting/combining operators without\nparentheses\n* a \"negative\" numeric literal (which is really a unary `-` followed by a\nnumeric literal)\n followed by a method call"##, 6208 description: r##"Checks for operations where precedence may be unclear\nand suggests to add parentheses. Currently it catches the following:\n* mixed usage of arithmetic and bit shifting/combining operators without\nparentheses\n* a \"negative\" numeric literal (which is really a unary `-` followed by a\nnumeric literal)\n followed by a method call"##,
5794 }, 6209 },
5795 LintCompletion { 6210 Lint {
5796 label: "clippy::print_literal", 6211 label: "clippy::print_literal",
5797 description: r##"This lint warns about the use of literals as `print!`/`println!` args."##, 6212 description: r##"This lint warns about the use of literals as `print!`/`println!` args."##,
5798 }, 6213 },
5799 LintCompletion { 6214 Lint {
5800 label: "clippy::print_stderr", 6215 label: "clippy::print_stderr",
5801 description: r##"Checks for printing on *stderr*. The purpose of this lint\nis to catch debugging remnants."##, 6216 description: r##"Checks for printing on *stderr*. The purpose of this lint\nis to catch debugging remnants."##,
5802 }, 6217 },
5803 LintCompletion { 6218 Lint {
5804 label: "clippy::print_stdout", 6219 label: "clippy::print_stdout",
5805 description: r##"Checks for printing on *stdout*. The purpose of this lint\nis to catch debugging remnants."##, 6220 description: r##"Checks for printing on *stdout*. The purpose of this lint\nis to catch debugging remnants."##,
5806 }, 6221 },
5807 LintCompletion { 6222 Lint {
5808 label: "clippy::print_with_newline", 6223 label: "clippy::print_with_newline",
5809 description: r##"This lint warns when you use `print!()` with a format\nstring that ends in a newline."##, 6224 description: r##"This lint warns when you use `print!()` with a format\nstring that ends in a newline."##,
5810 }, 6225 },
5811 LintCompletion { 6226 Lint {
5812 label: "clippy::println_empty_string", 6227 label: "clippy::println_empty_string",
5813 description: r##"This lint warns when you use `println!(\"\")` to\nprint a newline."##, 6228 description: r##"This lint warns when you use `println!(\"\")` to\nprint a newline."##,
5814 }, 6229 },
5815 LintCompletion { 6230 Lint {
5816 label: "clippy::ptr_arg", 6231 label: "clippy::ptr_arg",
5817 description: r##"This lint checks for function arguments of type `&String`\nor `&Vec` unless the references are mutable. It will also suggest you\nreplace `.clone()` calls with the appropriate `.to_owned()`/`to_string()`\ncalls."##, 6232 description: r##"This lint checks for function arguments of type `&String`\nor `&Vec` unless the references are mutable. It will also suggest you\nreplace `.clone()` calls with the appropriate `.to_owned()`/`to_string()`\ncalls."##,
5818 }, 6233 },
5819 LintCompletion { 6234 Lint {
5820 label: "clippy::ptr_as_ptr", 6235 label: "clippy::ptr_as_ptr",
5821 description: r##"Checks for `as` casts between raw pointers without changing its mutability,\nnamely `*const T` to `*const U` and `*mut T` to `*mut U`."##, 6236 description: r##"Checks for `as` casts between raw pointers without changing its mutability,\nnamely `*const T` to `*const U` and `*mut T` to `*mut U`."##,
5822 }, 6237 },
5823 LintCompletion { 6238 Lint { label: "clippy::ptr_eq", description: r##"Use `std::ptr::eq` when applicable"## },
5824 label: "clippy::ptr_eq", 6239 Lint {
5825 description: r##"Use `std::ptr::eq` when applicable"##,
5826 },
5827 LintCompletion {
5828 label: "clippy::ptr_offset_with_cast", 6240 label: "clippy::ptr_offset_with_cast",
5829 description: r##"Checks for usage of the `offset` pointer method with a `usize` casted to an\n`isize`."##, 6241 description: r##"Checks for usage of the `offset` pointer method with a `usize` casted to an\n`isize`."##,
5830 }, 6242 },
5831 LintCompletion { 6243 Lint {
5832 label: "clippy::pub_enum_variant_names", 6244 label: "clippy::pub_enum_variant_names",
5833 description: r##"Nothing. This lint has been deprecated."##, 6245 description: r##"Nothing. This lint has been deprecated."##,
5834 }, 6246 },
5835 LintCompletion { 6247 Lint {
5836 label: "clippy::question_mark", 6248 label: "clippy::question_mark",
5837 description: r##"Checks for expressions that could be replaced by the question mark operator."##, 6249 description: r##"Checks for expressions that could be replaced by the question mark operator."##,
5838 }, 6250 },
5839 LintCompletion { 6251 Lint {
5840 label: "clippy::range_minus_one", 6252 label: "clippy::range_minus_one",
5841 description: r##"Checks for inclusive ranges where 1 is subtracted from\nthe upper bound, e.g., `x..=(y-1)`."##, 6253 description: r##"Checks for inclusive ranges where 1 is subtracted from\nthe upper bound, e.g., `x..=(y-1)`."##,
5842 }, 6254 },
5843 LintCompletion { 6255 Lint {
5844 label: "clippy::range_plus_one", 6256 label: "clippy::range_plus_one",
5845 description: r##"Checks for exclusive ranges where 1 is added to the\nupper bound, e.g., `x..(y+1)`."##, 6257 description: r##"Checks for exclusive ranges where 1 is added to the\nupper bound, e.g., `x..(y+1)`."##,
5846 }, 6258 },
5847 LintCompletion { 6259 Lint {
5848 label: "clippy::range_step_by_zero", 6260 label: "clippy::range_step_by_zero",
5849 description: r##"Nothing. This lint has been deprecated."##, 6261 description: r##"Nothing. This lint has been deprecated."##,
5850 }, 6262 },
5851 LintCompletion { 6263 Lint {
5852 label: "clippy::range_zip_with_len", 6264 label: "clippy::range_zip_with_len",
5853 description: r##"Checks for zipping a collection with the range of\n`0.._.len()`."##, 6265 description: r##"Checks for zipping a collection with the range of\n`0.._.len()`."##,
5854 }, 6266 },
5855 LintCompletion { 6267 Lint {
5856 label: "clippy::rc_buffer", 6268 label: "clippy::rc_buffer",
5857 description: r##"Checks for `Rc<T>` and `Arc<T>` when `T` is a mutable buffer type such as `String` or `Vec`."##, 6269 description: r##"Checks for `Rc<T>` and `Arc<T>` when `T` is a mutable buffer type such as `String` or `Vec`."##,
5858 }, 6270 },
5859 LintCompletion { 6271 Lint {
5860 label: "clippy::redundant_allocation", 6272 label: "clippy::redundant_allocation",
5861 description: r##"Checks for use of redundant allocations anywhere in the code."##, 6273 description: r##"Checks for use of redundant allocations anywhere in the code."##,
5862 }, 6274 },
5863 LintCompletion { 6275 Lint {
5864 label: "clippy::redundant_clone", 6276 label: "clippy::redundant_clone",
5865 description: r##"Checks for a redundant `clone()` (and its relatives) which clones an owned\nvalue that is going to be dropped without further use."##, 6277 description: r##"Checks for a redundant `clone()` (and its relatives) which clones an owned\nvalue that is going to be dropped without further use."##,
5866 }, 6278 },
5867 LintCompletion { 6279 Lint {
5868 label: "clippy::redundant_closure", 6280 label: "clippy::redundant_closure",
5869 description: r##"Checks for closures which just call another function where\nthe function can be called directly. `unsafe` functions or calls where types\nget adjusted are ignored."##, 6281 description: r##"Checks for closures which just call another function where\nthe function can be called directly. `unsafe` functions or calls where types\nget adjusted are ignored."##,
5870 }, 6282 },
5871 LintCompletion { 6283 Lint {
5872 label: "clippy::redundant_closure_call", 6284 label: "clippy::redundant_closure_call",
5873 description: r##"Detects closures called in the same expression where they\nare defined."##, 6285 description: r##"Detects closures called in the same expression where they\nare defined."##,
5874 }, 6286 },
5875 LintCompletion { 6287 Lint {
5876 label: "clippy::redundant_closure_for_method_calls", 6288 label: "clippy::redundant_closure_for_method_calls",
5877 description: r##"Checks for closures which only invoke a method on the closure\nargument and can be replaced by referencing the method directly."##, 6289 description: r##"Checks for closures which only invoke a method on the closure\nargument and can be replaced by referencing the method directly."##,
5878 }, 6290 },
5879 LintCompletion { 6291 Lint {
5880 label: "clippy::redundant_else", 6292 label: "clippy::redundant_else",
5881 description: r##"Checks for `else` blocks that can be removed without changing semantics."##, 6293 description: r##"Checks for `else` blocks that can be removed without changing semantics."##,
5882 }, 6294 },
5883 LintCompletion { 6295 Lint {
5884 label: "clippy::redundant_field_names", 6296 label: "clippy::redundant_field_names",
5885 description: r##"Checks for fields in struct literals where shorthands\ncould be used."##, 6297 description: r##"Checks for fields in struct literals where shorthands\ncould be used."##,
5886 }, 6298 },
5887 LintCompletion { 6299 Lint {
5888 label: "clippy::redundant_pattern", 6300 label: "clippy::redundant_pattern",
5889 description: r##"Checks for patterns in the form `name @ _`."##, 6301 description: r##"Checks for patterns in the form `name @ _`."##,
5890 }, 6302 },
5891 LintCompletion { 6303 Lint {
5892 label: "clippy::redundant_pattern_matching", 6304 label: "clippy::redundant_pattern_matching",
5893 description: r##"Lint for redundant pattern matching over `Result`, `Option`,\n`std::task::Poll` or `std::net::IpAddr`"##, 6305 description: r##"Lint for redundant pattern matching over `Result`, `Option`,\n`std::task::Poll` or `std::net::IpAddr`"##,
5894 }, 6306 },
5895 LintCompletion { 6307 Lint {
5896 label: "clippy::redundant_pub_crate", 6308 label: "clippy::redundant_pub_crate",
5897 description: r##"Checks for items declared `pub(crate)` that are not crate visible because they\nare inside a private module."##, 6309 description: r##"Checks for items declared `pub(crate)` that are not crate visible because they\nare inside a private module."##,
5898 }, 6310 },
5899 LintCompletion { 6311 Lint {
5900 label: "clippy::redundant_slicing", 6312 label: "clippy::redundant_slicing",
5901 description: r##"Checks for redundant slicing expressions which use the full range, and\ndo not change the type."##, 6313 description: r##"Checks for redundant slicing expressions which use the full range, and\ndo not change the type."##,
5902 }, 6314 },
5903 LintCompletion { 6315 Lint {
5904 label: "clippy::redundant_static_lifetimes", 6316 label: "clippy::redundant_static_lifetimes",
5905 description: r##"Checks for constants and statics with an explicit `'static` lifetime."##, 6317 description: r##"Checks for constants and statics with an explicit `'static` lifetime."##,
5906 }, 6318 },
5907 LintCompletion { 6319 Lint {
5908 label: "clippy::ref_binding_to_reference", 6320 label: "clippy::ref_binding_to_reference",
5909 description: r##"Checks for `ref` bindings which create a reference to a reference."##, 6321 description: r##"Checks for `ref` bindings which create a reference to a reference."##,
5910 }, 6322 },
5911 LintCompletion { 6323 Lint {
5912 label: "clippy::ref_in_deref", 6324 label: "clippy::ref_in_deref",
5913 description: r##"Checks for references in expressions that use\nauto dereference."##, 6325 description: r##"Checks for references in expressions that use\nauto dereference."##,
5914 }, 6326 },
5915 LintCompletion { 6327 Lint {
5916 label: "clippy::ref_option_ref", 6328 label: "clippy::ref_option_ref",
5917 description: r##"Checks for usage of `&Option<&T>`."##, 6329 description: r##"Checks for usage of `&Option<&T>`."##,
5918 }, 6330 },
5919 LintCompletion { 6331 Lint {
5920 label: "clippy::regex_macro", 6332 label: "clippy::regex_macro",
5921 description: r##"Nothing. This lint has been deprecated."##, 6333 description: r##"Nothing. This lint has been deprecated."##,
5922 }, 6334 },
5923 LintCompletion { 6335 Lint {
5924 label: "clippy::repeat_once", 6336 label: "clippy::repeat_once",
5925 description: r##"Checks for usage of `.repeat(1)` and suggest the following method for each types.\n- `.to_string()` for `str`\n- `.clone()` for `String`\n- `.to_vec()` for `slice`"##, 6337 description: r##"Checks for usage of `.repeat(1)` and suggest the following method for each types.\n- `.to_string()` for `str`\n- `.clone()` for `String`\n- `.to_vec()` for `slice`"##,
5926 }, 6338 },
5927 LintCompletion { 6339 Lint {
5928 label: "clippy::replace_consts", 6340 label: "clippy::replace_consts",
5929 description: r##"Nothing. This lint has been deprecated."##, 6341 description: r##"Nothing. This lint has been deprecated."##,
5930 }, 6342 },
5931 LintCompletion { 6343 Lint {
5932 label: "clippy::rest_pat_in_fully_bound_structs", 6344 label: "clippy::rest_pat_in_fully_bound_structs",
5933 description: r##"Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched."##, 6345 description: r##"Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched."##,
5934 }, 6346 },
5935 LintCompletion { 6347 Lint {
5936 label: "clippy::result_map_or_into_option", 6348 label: "clippy::result_map_or_into_option",
5937 description: r##"Checks for usage of `_.map_or(None, Some)`."##, 6349 description: r##"Checks for usage of `_.map_or(None, Some)`."##,
5938 }, 6350 },
5939 LintCompletion { 6351 Lint {
5940 label: "clippy::result_map_unit_fn", 6352 label: "clippy::result_map_unit_fn",
5941 description: r##"Checks for usage of `result.map(f)` where f is a function\nor closure that returns the unit type `()`."##, 6353 description: r##"Checks for usage of `result.map(f)` where f is a function\nor closure that returns the unit type `()`."##,
5942 }, 6354 },
5943 LintCompletion { 6355 Lint {
5944 label: "clippy::result_unit_err", 6356 label: "clippy::result_unit_err",
5945 description: r##"Checks for public functions that return a `Result`\nwith an `Err` type of `()`. It suggests using a custom type that\nimplements `std::error::Error`."##, 6357 description: r##"Checks for public functions that return a `Result`\nwith an `Err` type of `()`. It suggests using a custom type that\nimplements `std::error::Error`."##,
5946 }, 6358 },
5947 LintCompletion { 6359 Lint {
5948 label: "clippy::reversed_empty_ranges", 6360 label: "clippy::reversed_empty_ranges",
5949 description: r##"Checks for range expressions `x..y` where both `x` and `y`\nare constant and `x` is greater or equal to `y`."##, 6361 description: r##"Checks for range expressions `x..y` where both `x` and `y`\nare constant and `x` is greater or equal to `y`."##,
5950 }, 6362 },
5951 LintCompletion { 6363 Lint {
5952 label: "clippy::same_functions_in_if_condition", 6364 label: "clippy::same_functions_in_if_condition",
5953 description: r##"Checks for consecutive `if`s with the same function call."##, 6365 description: r##"Checks for consecutive `if`s with the same function call."##,
5954 }, 6366 },
5955 LintCompletion { 6367 Lint {
5956 label: "clippy::same_item_push", 6368 label: "clippy::same_item_push",
5957 description: r##"Checks whether a for loop is being used to push a constant\nvalue into a Vec."##, 6369 description: r##"Checks whether a for loop is being used to push a constant\nvalue into a Vec."##,
5958 }, 6370 },
5959 LintCompletion { 6371 Lint {
5960 label: "clippy::search_is_some", 6372 label: "clippy::search_is_some",
5961 description: r##"Checks for an iterator or string search (such as `find()`,\n`position()`, or `rposition()`) followed by a call to `is_some()` or `is_none()`."##, 6373 description: r##"Checks for an iterator or string search (such as `find()`,\n`position()`, or `rposition()`) followed by a call to `is_some()` or `is_none()`."##,
5962 }, 6374 },
5963 LintCompletion { 6375 Lint {
5964 label: "clippy::self_assignment", 6376 label: "clippy::self_assignment",
5965 description: r##"Checks for explicit self-assignments."##, 6377 description: r##"Checks for explicit self-assignments."##,
5966 }, 6378 },
5967 LintCompletion { 6379 Lint {
5968 label: "clippy::semicolon_if_nothing_returned", 6380 label: "clippy::semicolon_if_nothing_returned",
5969 description: r##"Looks for blocks of expressions and fires if the last expression returns\n`()` but is not followed by a semicolon."##, 6381 description: r##"Looks for blocks of expressions and fires if the last expression returns\n`()` but is not followed by a semicolon."##,
5970 }, 6382 },
5971 LintCompletion { 6383 Lint {
5972 label: "clippy::serde_api_misuse", 6384 label: "clippy::serde_api_misuse",
5973 description: r##"Checks for mis-uses of the serde API."##, 6385 description: r##"Checks for mis-uses of the serde API."##,
5974 }, 6386 },
5975 LintCompletion { 6387 Lint {
5976 label: "clippy::shadow_reuse", 6388 label: "clippy::shadow_reuse",
5977 description: r##"Checks for bindings that shadow other bindings already in\nscope, while reusing the original value."##, 6389 description: r##"Checks for bindings that shadow other bindings already in\nscope, while reusing the original value."##,
5978 }, 6390 },
5979 LintCompletion { 6391 Lint {
5980 label: "clippy::shadow_same", 6392 label: "clippy::shadow_same",
5981 description: r##"Checks for bindings that shadow other bindings already in\nscope, while just changing reference level or mutability."##, 6393 description: r##"Checks for bindings that shadow other bindings already in\nscope, while just changing reference level or mutability."##,
5982 }, 6394 },
5983 LintCompletion { 6395 Lint {
5984 label: "clippy::shadow_unrelated", 6396 label: "clippy::shadow_unrelated",
5985 description: r##"Checks for bindings that shadow other bindings already in\nscope, either without a initialization or with one that does not even use\nthe original value."##, 6397 description: r##"Checks for bindings that shadow other bindings already in\nscope, either without a initialization or with one that does not even use\nthe original value."##,
5986 }, 6398 },
5987 LintCompletion { 6399 Lint {
5988 label: "clippy::short_circuit_statement", 6400 label: "clippy::short_circuit_statement",
5989 description: r##"Checks for the use of short circuit boolean conditions as\na\nstatement."##, 6401 description: r##"Checks for the use of short circuit boolean conditions as\na\nstatement."##,
5990 }, 6402 },
5991 LintCompletion { 6403 Lint {
5992 label: "clippy::should_assert_eq", 6404 label: "clippy::should_assert_eq",
5993 description: r##"Nothing. This lint has been deprecated."##, 6405 description: r##"Nothing. This lint has been deprecated."##,
5994 }, 6406 },
5995 LintCompletion { 6407 Lint {
5996 label: "clippy::should_implement_trait", 6408 label: "clippy::should_implement_trait",
5997 description: r##"Checks for methods that should live in a trait\nimplementation of a `std` trait (see [llogiq's blog\npost](http://llogiq.github.io/2015/07/30/traits.html) for further\ninformation) instead of an inherent implementation."##, 6409 description: r##"Checks for methods that should live in a trait\nimplementation of a `std` trait (see [llogiq's blog\npost](http://llogiq.github.io/2015/07/30/traits.html) for further\ninformation) instead of an inherent implementation."##,
5998 }, 6410 },
5999 LintCompletion { 6411 Lint {
6000 label: "clippy::similar_names", 6412 label: "clippy::similar_names",
6001 description: r##"Checks for names that are very similar and thus confusing."##, 6413 description: r##"Checks for names that are very similar and thus confusing."##,
6002 }, 6414 },
6003 LintCompletion { 6415 Lint {
6004 label: "clippy::single_char_add_str", 6416 label: "clippy::single_char_add_str",
6005 description: r##"Warns when using `push_str`/`insert_str` with a single-character string literal\nwhere `push`/`insert` with a `char` would work fine."##, 6417 description: r##"Warns when using `push_str`/`insert_str` with a single-character string literal\nwhere `push`/`insert` with a `char` would work fine."##,
6006 }, 6418 },
6007 LintCompletion { 6419 Lint {
6008 label: "clippy::single_char_pattern", 6420 label: "clippy::single_char_pattern",
6009 description: r##"Checks for string methods that receive a single-character\n`str` as an argument, e.g., `_.split(\"x\")`."##, 6421 description: r##"Checks for string methods that receive a single-character\n`str` as an argument, e.g., `_.split(\"x\")`."##,
6010 }, 6422 },
6011 LintCompletion { 6423 Lint {
6012 label: "clippy::single_component_path_imports", 6424 label: "clippy::single_component_path_imports",
6013 description: r##"Checking for imports with single component use path."##, 6425 description: r##"Checking for imports with single component use path."##,
6014 }, 6426 },
6015 LintCompletion { 6427 Lint {
6016 label: "clippy::single_element_loop", 6428 label: "clippy::single_element_loop",
6017 description: r##"Checks whether a for loop has a single element."##, 6429 description: r##"Checks whether a for loop has a single element."##,
6018 }, 6430 },
6019 LintCompletion { 6431 Lint {
6020 label: "clippy::single_match", 6432 label: "clippy::single_match",
6021 description: r##"Checks for matches with a single arm where an `if let`\nwill usually suffice."##, 6433 description: r##"Checks for matches with a single arm where an `if let`\nwill usually suffice."##,
6022 }, 6434 },
6023 LintCompletion { 6435 Lint {
6024 label: "clippy::single_match_else", 6436 label: "clippy::single_match_else",
6025 description: r##"Checks for matches with two arms where an `if let else` will\nusually suffice."##, 6437 description: r##"Checks for matches with two arms where an `if let else` will\nusually suffice."##,
6026 }, 6438 },
6027 LintCompletion { 6439 Lint {
6028 label: "clippy::size_of_in_element_count", 6440 label: "clippy::size_of_in_element_count",
6029 description: r##"Detects expressions where\n`size_of::<T>` or `size_of_val::<T>` is used as a\ncount of elements of type `T`"##, 6441 description: r##"Detects expressions where\n`size_of::<T>` or `size_of_val::<T>` is used as a\ncount of elements of type `T`"##,
6030 }, 6442 },
6031 LintCompletion { 6443 Lint {
6032 label: "clippy::skip_while_next", 6444 label: "clippy::skip_while_next",
6033 description: r##"Checks for usage of `_.skip_while(condition).next()`."##, 6445 description: r##"Checks for usage of `_.skip_while(condition).next()`."##,
6034 }, 6446 },
6035 LintCompletion { 6447 Lint {
6036 label: "clippy::slow_vector_initialization", 6448 label: "clippy::slow_vector_initialization",
6037 description: r##"Checks slow zero-filled vector initialization"##, 6449 description: r##"Checks slow zero-filled vector initialization"##,
6038 }, 6450 },
6039 LintCompletion { 6451 Lint {
6040 label: "clippy::stable_sort_primitive", 6452 label: "clippy::stable_sort_primitive",
6041 description: r##"When sorting primitive values (integers, bools, chars, as well\nas arrays, slices, and tuples of such items), it is better to\nuse an unstable sort than a stable sort."##, 6453 description: r##"When sorting primitive values (integers, bools, chars, as well\nas arrays, slices, and tuples of such items), it is better to\nuse an unstable sort than a stable sort."##,
6042 }, 6454 },
6043 LintCompletion { 6455 Lint {
6044 label: "clippy::str_to_string", 6456 label: "clippy::str_to_string",
6045 description: r##"This lint checks for `.to_string()` method calls on values of type `&str`."##, 6457 description: r##"This lint checks for `.to_string()` method calls on values of type `&str`."##,
6046 }, 6458 },
6047 LintCompletion { 6459 Lint {
6048 label: "clippy::string_add", 6460 label: "clippy::string_add",
6049 description: r##"Checks for all instances of `x + _` where `x` is of type\n`String`, but only if [`string_add_assign`](#string_add_assign) does *not*\nmatch."##, 6461 description: r##"Checks for all instances of `x + _` where `x` is of type\n`String`, but only if [`string_add_assign`](#string_add_assign) does *not*\nmatch."##,
6050 }, 6462 },
6051 LintCompletion { 6463 Lint {
6052 label: "clippy::string_add_assign", 6464 label: "clippy::string_add_assign",
6053 description: r##"Checks for string appends of the form `x = x + y` (without\n`let`!)."##, 6465 description: r##"Checks for string appends of the form `x = x + y` (without\n`let`!)."##,
6054 }, 6466 },
6055 LintCompletion { 6467 Lint {
6056 label: "clippy::string_extend_chars", 6468 label: "clippy::string_extend_chars",
6057 description: r##"Checks for the use of `.extend(s.chars())` where s is a\n`&str` or `String`."##, 6469 description: r##"Checks for the use of `.extend(s.chars())` where s is a\n`&str` or `String`."##,
6058 }, 6470 },
6059 LintCompletion { 6471 Lint {
6060 label: "clippy::string_from_utf8_as_bytes", 6472 label: "clippy::string_from_utf8_as_bytes",
6061 description: r##"Check if the string is transformed to byte array and casted back to string."##, 6473 description: r##"Check if the string is transformed to byte array and casted back to string."##,
6062 }, 6474 },
6063 LintCompletion { 6475 Lint {
6064 label: "clippy::string_lit_as_bytes", 6476 label: "clippy::string_lit_as_bytes",
6065 description: r##"Checks for the `as_bytes` method called on string literals\nthat contain only ASCII characters."##, 6477 description: r##"Checks for the `as_bytes` method called on string literals\nthat contain only ASCII characters."##,
6066 }, 6478 },
6067 LintCompletion { 6479 Lint {
6068 label: "clippy::string_to_string", 6480 label: "clippy::string_to_string",
6069 description: r##"This lint checks for `.to_string()` method calls on values of type `String`."##, 6481 description: r##"This lint checks for `.to_string()` method calls on values of type `String`."##,
6070 }, 6482 },
6071 LintCompletion { 6483 Lint {
6072 label: "clippy::struct_excessive_bools", 6484 label: "clippy::struct_excessive_bools",
6073 description: r##"Checks for excessive\nuse of bools in structs."##, 6485 description: r##"Checks for excessive\nuse of bools in structs."##,
6074 }, 6486 },
6075 LintCompletion { 6487 Lint {
6076 label: "clippy::suboptimal_flops", 6488 label: "clippy::suboptimal_flops",
6077 description: r##"Looks for floating-point expressions that\ncan be expressed using built-in methods to improve both\naccuracy and performance."##, 6489 description: r##"Looks for floating-point expressions that\ncan be expressed using built-in methods to improve both\naccuracy and performance."##,
6078 }, 6490 },
6079 LintCompletion { 6491 Lint {
6080 label: "clippy::suspicious_arithmetic_impl", 6492 label: "clippy::suspicious_arithmetic_impl",
6081 description: r##"Lints for suspicious operations in impls of arithmetic operators, e.g.\nsubtracting elements in an Add impl."##, 6493 description: r##"Lints for suspicious operations in impls of arithmetic operators, e.g.\nsubtracting elements in an Add impl."##,
6082 }, 6494 },
6083 LintCompletion { 6495 Lint {
6084 label: "clippy::suspicious_assignment_formatting", 6496 label: "clippy::suspicious_assignment_formatting",
6085 description: r##"Checks for use of the non-existent `=*`, `=!` and `=-`\noperators."##, 6497 description: r##"Checks for use of the non-existent `=*`, `=!` and `=-`\noperators."##,
6086 }, 6498 },
6087 LintCompletion { 6499 Lint {
6088 label: "clippy::suspicious_else_formatting", 6500 label: "clippy::suspicious_else_formatting",
6089 description: r##"Checks for formatting of `else`. It lints if the `else`\nis followed immediately by a newline or the `else` seems to be missing."##, 6501 description: r##"Checks for formatting of `else`. It lints if the `else`\nis followed immediately by a newline or the `else` seems to be missing."##,
6090 }, 6502 },
6091 LintCompletion { 6503 Lint {
6092 label: "clippy::suspicious_map", 6504 label: "clippy::suspicious_map",
6093 description: r##"Checks for calls to `map` followed by a `count`."##, 6505 description: r##"Checks for calls to `map` followed by a `count`."##,
6094 }, 6506 },
6095 LintCompletion { 6507 Lint {
6096 label: "clippy::suspicious_op_assign_impl", 6508 label: "clippy::suspicious_op_assign_impl",
6097 description: r##"Lints for suspicious operations in impls of OpAssign, e.g.\nsubtracting elements in an AddAssign impl."##, 6509 description: r##"Lints for suspicious operations in impls of OpAssign, e.g.\nsubtracting elements in an AddAssign impl."##,
6098 }, 6510 },
6099 LintCompletion { 6511 Lint {
6100 label: "clippy::suspicious_operation_groupings", 6512 label: "clippy::suspicious_operation_groupings",
6101 description: r##"Checks for unlikely usages of binary operators that are almost\ncertainly typos and/or copy/paste errors, given the other usages\nof binary operators nearby."##, 6513 description: r##"Checks for unlikely usages of binary operators that are almost\ncertainly typos and/or copy/paste errors, given the other usages\nof binary operators nearby."##,
6102 }, 6514 },
6103 LintCompletion { 6515 Lint {
6104 label: "clippy::suspicious_splitn", 6516 label: "clippy::suspicious_splitn",
6105 description: r##"Checks for calls to [`splitn`]\n(https://doc.rust-lang.org/std/primitive.str.html#method.splitn) and\nrelated functions with either zero or one splits."##, 6517 description: r##"Checks for calls to [`splitn`]\n(https://doc.rust-lang.org/std/primitive.str.html#method.splitn) and\nrelated functions with either zero or one splits."##,
6106 }, 6518 },
6107 LintCompletion { 6519 Lint {
6108 label: "clippy::suspicious_unary_op_formatting", 6520 label: "clippy::suspicious_unary_op_formatting",
6109 description: r##"Checks the formatting of a unary operator on the right hand side\nof a binary operator. It lints if there is no space between the binary and unary operators,\nbut there is a space between the unary and its operand."##, 6521 description: r##"Checks the formatting of a unary operator on the right hand side\nof a binary operator. It lints if there is no space between the binary and unary operators,\nbut there is a space between the unary and its operand."##,
6110 }, 6522 },
6111 LintCompletion { 6523 Lint {
6112 label: "clippy::tabs_in_doc_comments", 6524 label: "clippy::tabs_in_doc_comments",
6113 description: r##"Checks doc comments for usage of tab characters."##, 6525 description: r##"Checks doc comments for usage of tab characters."##,
6114 }, 6526 },
6115 LintCompletion { 6527 Lint {
6116 label: "clippy::temporary_assignment", 6528 label: "clippy::temporary_assignment",
6117 description: r##"Checks for construction of a structure or tuple just to\nassign a value in it."##, 6529 description: r##"Checks for construction of a structure or tuple just to\nassign a value in it."##,
6118 }, 6530 },
6119 LintCompletion { 6531 Lint {
6120 label: "clippy::to_digit_is_some", 6532 label: "clippy::to_digit_is_some",
6121 description: r##"Checks for `.to_digit(..).is_some()` on `char`s."##, 6533 description: r##"Checks for `.to_digit(..).is_some()` on `char`s."##,
6122 }, 6534 },
6123 LintCompletion { 6535 Lint {
6124 label: "clippy::to_string_in_display", 6536 label: "clippy::to_string_in_display",
6125 description: r##"Checks for uses of `to_string()` in `Display` traits."##, 6537 description: r##"Checks for uses of `to_string()` in `Display` traits."##,
6126 }, 6538 },
6127 LintCompletion { label: "clippy::todo", description: r##"Checks for usage of `todo!`."## }, 6539 Lint { label: "clippy::todo", description: r##"Checks for usage of `todo!`."## },
6128 LintCompletion { 6540 Lint {
6129 label: "clippy::too_many_arguments", 6541 label: "clippy::too_many_arguments",
6130 description: r##"Checks for functions with too many parameters."##, 6542 description: r##"Checks for functions with too many parameters."##,
6131 }, 6543 },
6132 LintCompletion { 6544 Lint {
6133 label: "clippy::too_many_lines", 6545 label: "clippy::too_many_lines",
6134 description: r##"Checks for functions with a large amount of lines."##, 6546 description: r##"Checks for functions with a large amount of lines."##,
6135 }, 6547 },
6136 LintCompletion { 6548 Lint {
6137 label: "clippy::toplevel_ref_arg", 6549 label: "clippy::toplevel_ref_arg",
6138 description: r##"Checks for function arguments and let bindings denoted as\n`ref`."##, 6550 description: r##"Checks for function arguments and let bindings denoted as\n`ref`."##,
6139 }, 6551 },
6140 LintCompletion { 6552 Lint {
6141 label: "clippy::trait_duplication_in_bounds", 6553 label: "clippy::trait_duplication_in_bounds",
6142 description: r##"Checks for cases where generics are being used and multiple\nsyntax specifications for trait bounds are used simultaneously."##, 6554 description: r##"Checks for cases where generics are being used and multiple\nsyntax specifications for trait bounds are used simultaneously."##,
6143 }, 6555 },
6144 LintCompletion { 6556 Lint {
6145 label: "clippy::transmute_bytes_to_str", 6557 label: "clippy::transmute_bytes_to_str",
6146 description: r##"Checks for transmutes from a `&[u8]` to a `&str`."##, 6558 description: r##"Checks for transmutes from a `&[u8]` to a `&str`."##,
6147 }, 6559 },
6148 LintCompletion { 6560 Lint {
6149 label: "clippy::transmute_float_to_int", 6561 label: "clippy::transmute_float_to_int",
6150 description: r##"Checks for transmutes from a float to an integer."##, 6562 description: r##"Checks for transmutes from a float to an integer."##,
6151 }, 6563 },
6152 LintCompletion { 6564 Lint {
6153 label: "clippy::transmute_int_to_bool", 6565 label: "clippy::transmute_int_to_bool",
6154 description: r##"Checks for transmutes from an integer to a `bool`."##, 6566 description: r##"Checks for transmutes from an integer to a `bool`."##,
6155 }, 6567 },
6156 LintCompletion { 6568 Lint {
6157 label: "clippy::transmute_int_to_char", 6569 label: "clippy::transmute_int_to_char",
6158 description: r##"Checks for transmutes from an integer to a `char`."##, 6570 description: r##"Checks for transmutes from an integer to a `char`."##,
6159 }, 6571 },
6160 LintCompletion { 6572 Lint {
6161 label: "clippy::transmute_int_to_float", 6573 label: "clippy::transmute_int_to_float",
6162 description: r##"Checks for transmutes from an integer to a float."##, 6574 description: r##"Checks for transmutes from an integer to a float."##,
6163 }, 6575 },
6164 LintCompletion { 6576 Lint {
6165 label: "clippy::transmute_ptr_to_ptr", 6577 label: "clippy::transmute_ptr_to_ptr",
6166 description: r##"Checks for transmutes from a pointer to a pointer, or\nfrom a reference to a reference."##, 6578 description: r##"Checks for transmutes from a pointer to a pointer, or\nfrom a reference to a reference."##,
6167 }, 6579 },
6168 LintCompletion { 6580 Lint {
6169 label: "clippy::transmute_ptr_to_ref", 6581 label: "clippy::transmute_ptr_to_ref",
6170 description: r##"Checks for transmutes from a pointer to a reference."##, 6582 description: r##"Checks for transmutes from a pointer to a reference."##,
6171 }, 6583 },
6172 LintCompletion { 6584 Lint {
6173 label: "clippy::transmutes_expressible_as_ptr_casts", 6585 label: "clippy::transmutes_expressible_as_ptr_casts",
6174 description: r##"Checks for transmutes that could be a pointer cast."##, 6586 description: r##"Checks for transmutes that could be a pointer cast."##,
6175 }, 6587 },
6176 LintCompletion { 6588 Lint {
6177 label: "clippy::transmuting_null", 6589 label: "clippy::transmuting_null",
6178 description: r##"Checks for transmute calls which would receive a null pointer."##, 6590 description: r##"Checks for transmute calls which would receive a null pointer."##,
6179 }, 6591 },
6180 LintCompletion { 6592 Lint {
6181 label: "clippy::trivial_regex", 6593 label: "clippy::trivial_regex",
6182 description: r##"Checks for trivial [regex](https://crates.io/crates/regex)\ncreation (with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`)."##, 6594 description: r##"Checks for trivial [regex](https://crates.io/crates/regex)\ncreation (with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`)."##,
6183 }, 6595 },
6184 LintCompletion { 6596 Lint {
6185 label: "clippy::trivially_copy_pass_by_ref", 6597 label: "clippy::trivially_copy_pass_by_ref",
6186 description: r##"Checks for functions taking arguments by reference, where\nthe argument type is `Copy` and small enough to be more efficient to always\npass by value."##, 6598 description: r##"Checks for functions taking arguments by reference, where\nthe argument type is `Copy` and small enough to be more efficient to always\npass by value."##,
6187 }, 6599 },
6188 LintCompletion { 6600 Lint { label: "clippy::try_err", description: r##"Checks for usages of `Err(x)?`."## },
6189 label: "clippy::try_err", 6601 Lint {
6190 description: r##"Checks for usages of `Err(x)?`."##,
6191 },
6192 LintCompletion {
6193 label: "clippy::type_complexity", 6602 label: "clippy::type_complexity",
6194 description: r##"Checks for types used in structs, parameters and `let`\ndeclarations above a certain complexity threshold."##, 6603 description: r##"Checks for types used in structs, parameters and `let`\ndeclarations above a certain complexity threshold."##,
6195 }, 6604 },
6196 LintCompletion { 6605 Lint {
6197 label: "clippy::type_repetition_in_bounds", 6606 label: "clippy::type_repetition_in_bounds",
6198 description: r##"This lint warns about unnecessary type repetitions in trait bounds"##, 6607 description: r##"This lint warns about unnecessary type repetitions in trait bounds"##,
6199 }, 6608 },
6200 LintCompletion { 6609 Lint {
6201 label: "clippy::undropped_manually_drops", 6610 label: "clippy::undropped_manually_drops",
6202 description: r##"Prevents the safe `std::mem::drop` function from being called on `std::mem::ManuallyDrop`."##, 6611 description: r##"Prevents the safe `std::mem::drop` function from being called on `std::mem::ManuallyDrop`."##,
6203 }, 6612 },
6204 LintCompletion { 6613 Lint {
6205 label: "clippy::unicode_not_nfc", 6614 label: "clippy::unicode_not_nfc",
6206 description: r##"Checks for string literals that contain Unicode in a form\nthat is not equal to its\n[NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms)."##, 6615 description: r##"Checks for string literals that contain Unicode in a form\nthat is not equal to its\n[NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms)."##,
6207 }, 6616 },
6208 LintCompletion { 6617 Lint {
6209 label: "clippy::unimplemented", 6618 label: "clippy::unimplemented",
6210 description: r##"Checks for usage of `unimplemented!`."##, 6619 description: r##"Checks for usage of `unimplemented!`."##,
6211 }, 6620 },
6212 LintCompletion { 6621 Lint {
6213 label: "clippy::uninit_assumed_init", 6622 label: "clippy::uninit_assumed_init",
6214 description: r##"Checks for `MaybeUninit::uninit().assume_init()`."##, 6623 description: r##"Checks for `MaybeUninit::uninit().assume_init()`."##,
6215 }, 6624 },
6216 LintCompletion { 6625 Lint {
6217 label: "clippy::unit_arg", 6626 label: "clippy::unit_arg",
6218 description: r##"Checks for passing a unit value as an argument to a function without using a\nunit literal (`()`)."##, 6627 description: r##"Checks for passing a unit value as an argument to a function without using a\nunit literal (`()`)."##,
6219 }, 6628 },
6220 LintCompletion { 6629 Lint {
6221 label: "clippy::unit_cmp", 6630 label: "clippy::unit_cmp",
6222 description: r##"Checks for comparisons to unit. This includes all binary\ncomparisons (like `==` and `<`) and asserts."##, 6631 description: r##"Checks for comparisons to unit. This includes all binary\ncomparisons (like `==` and `<`) and asserts."##,
6223 }, 6632 },
6224 LintCompletion { 6633 Lint {
6225 label: "clippy::unit_return_expecting_ord", 6634 label: "clippy::unit_return_expecting_ord",
6226 description: r##"Checks for functions that expect closures of type\nFn(...) -> Ord where the implemented closure returns the unit type.\nThe lint also suggests to remove the semi-colon at the end of the statement if present."##, 6635 description: r##"Checks for functions that expect closures of type\nFn(...) -> Ord where the implemented closure returns the unit type.\nThe lint also suggests to remove the semi-colon at the end of the statement if present."##,
6227 }, 6636 },
6228 LintCompletion { 6637 Lint {
6229 label: "clippy::unnecessary_cast", 6638 label: "clippy::unnecessary_cast",
6230 description: r##"Checks for casts to the same type, casts of int literals to integer types\nand casts of float literals to float types."##, 6639 description: r##"Checks for casts to the same type, casts of int literals to integer types\nand casts of float literals to float types."##,
6231 }, 6640 },
6232 LintCompletion { 6641 Lint {
6233 label: "clippy::unnecessary_filter_map", 6642 label: "clippy::unnecessary_filter_map",
6234 description: r##"Checks for `filter_map` calls which could be replaced by `filter` or `map`.\nMore specifically it checks if the closure provided is only performing one of the\nfilter or map operations and suggests the appropriate option."##, 6643 description: r##"Checks for `filter_map` calls which could be replaced by `filter` or `map`.\nMore specifically it checks if the closure provided is only performing one of the\nfilter or map operations and suggests the appropriate option."##,
6235 }, 6644 },
6236 LintCompletion { 6645 Lint {
6237 label: "clippy::unnecessary_fold", 6646 label: "clippy::unnecessary_fold",
6238 description: r##"Checks for using `fold` when a more succinct alternative exists.\nSpecifically, this checks for `fold`s which could be replaced by `any`, `all`,\n`sum` or `product`."##, 6647 description: r##"Checks for using `fold` when a more succinct alternative exists.\nSpecifically, this checks for `fold`s which could be replaced by `any`, `all`,\n`sum` or `product`."##,
6239 }, 6648 },
6240 LintCompletion { 6649 Lint {
6241 label: "clippy::unnecessary_lazy_evaluations", 6650 label: "clippy::unnecessary_lazy_evaluations",
6242 description: r##"As the counterpart to `or_fun_call`, this lint looks for unnecessary\nlazily evaluated closures on `Option` and `Result`.\n\nThis lint suggests changing the following functions, when eager evaluation results in\nsimpler code:\n - `unwrap_or_else` to `unwrap_or`\n - `and_then` to `and`\n - `or_else` to `or`\n - `get_or_insert_with` to `get_or_insert`\n - `ok_or_else` to `ok_or`"##, 6651 description: r##"As the counterpart to `or_fun_call`, this lint looks for unnecessary\nlazily evaluated closures on `Option` and `Result`.\n\nThis lint suggests changing the following functions, when eager evaluation results in\nsimpler code:\n - `unwrap_or_else` to `unwrap_or`\n - `and_then` to `and`\n - `or_else` to `or`\n - `get_or_insert_with` to `get_or_insert`\n - `ok_or_else` to `ok_or`"##,
6243 }, 6652 },
6244 LintCompletion { 6653 Lint {
6245 label: "clippy::unnecessary_mut_passed", 6654 label: "clippy::unnecessary_mut_passed",
6246 description: r##"Detects passing a mutable reference to a function that only\nrequires an immutable reference."##, 6655 description: r##"Detects passing a mutable reference to a function that only\nrequires an immutable reference."##,
6247 }, 6656 },
6248 LintCompletion { 6657 Lint {
6249 label: "clippy::unnecessary_operation", 6658 label: "clippy::unnecessary_operation",
6250 description: r##"Checks for expression statements that can be reduced to a\nsub-expression."##, 6659 description: r##"Checks for expression statements that can be reduced to a\nsub-expression."##,
6251 }, 6660 },
6252 LintCompletion { 6661 Lint {
6253 label: "clippy::unnecessary_self_imports", 6662 label: "clippy::unnecessary_self_imports",
6254 description: r##"Checks for imports ending in `::{self}`."##, 6663 description: r##"Checks for imports ending in `::{self}`."##,
6255 }, 6664 },
6256 LintCompletion { 6665 Lint {
6257 label: "clippy::unnecessary_sort_by", 6666 label: "clippy::unnecessary_sort_by",
6258 description: r##"Detects uses of `Vec::sort_by` passing in a closure\nwhich compares the two arguments, either directly or indirectly."##, 6667 description: r##"Detects uses of `Vec::sort_by` passing in a closure\nwhich compares the two arguments, either directly or indirectly."##,
6259 }, 6668 },
6260 LintCompletion { 6669 Lint {
6261 label: "clippy::unnecessary_unwrap", 6670 label: "clippy::unnecessary_unwrap",
6262 description: r##"Checks for calls of `unwrap[_err]()` that cannot fail."##, 6671 description: r##"Checks for calls of `unwrap[_err]()` that cannot fail."##,
6263 }, 6672 },
6264 LintCompletion { 6673 Lint {
6265 label: "clippy::unnecessary_wraps", 6674 label: "clippy::unnecessary_wraps",
6266 description: r##"Checks for private functions that only return `Ok` or `Some`."##, 6675 description: r##"Checks for private functions that only return `Ok` or `Some`."##,
6267 }, 6676 },
6268 LintCompletion { 6677 Lint {
6269 label: "clippy::unneeded_field_pattern", 6678 label: "clippy::unneeded_field_pattern",
6270 description: r##"Checks for structure field patterns bound to wildcards."##, 6679 description: r##"Checks for structure field patterns bound to wildcards."##,
6271 }, 6680 },
6272 LintCompletion { 6681 Lint {
6273 label: "clippy::unneeded_wildcard_pattern", 6682 label: "clippy::unneeded_wildcard_pattern",
6274 description: r##"Checks for tuple patterns with a wildcard\npattern (`_`) is next to a rest pattern (`..`).\n\n_NOTE_: While `_, ..` means there is at least one element left, `..`\nmeans there are 0 or more elements left. This can make a difference\nwhen refactoring, but shouldn't result in errors in the refactored code,\nsince the wildcard pattern isn't used anyway."##, 6683 description: r##"Checks for tuple patterns with a wildcard\npattern (`_`) is next to a rest pattern (`..`).\n\n_NOTE_: While `_, ..` means there is at least one element left, `..`\nmeans there are 0 or more elements left. This can make a difference\nwhen refactoring, but shouldn't result in errors in the refactored code,\nsince the wildcard pattern isn't used anyway."##,
6275 }, 6684 },
6276 LintCompletion { 6685 Lint {
6277 label: "clippy::unnested_or_patterns", 6686 label: "clippy::unnested_or_patterns",
6278 description: r##"Checks for unnested or-patterns, e.g., `Some(0) | Some(2)` and\nsuggests replacing the pattern with a nested one, `Some(0 | 2)`.\n\nAnother way to think of this is that it rewrites patterns in\n*disjunctive normal form (DNF)* into *conjunctive normal form (CNF)*."##, 6687 description: r##"Checks for unnested or-patterns, e.g., `Some(0) | Some(2)` and\nsuggests replacing the pattern with a nested one, `Some(0 | 2)`.\n\nAnother way to think of this is that it rewrites patterns in\n*disjunctive normal form (DNF)* into *conjunctive normal form (CNF)*."##,
6279 }, 6688 },
6280 LintCompletion { 6689 Lint { label: "clippy::unreachable", description: r##"Checks for usage of `unreachable!`."## },
6281 label: "clippy::unreachable", 6690 Lint {
6282 description: r##"Checks for usage of `unreachable!`."##,
6283 },
6284 LintCompletion {
6285 label: "clippy::unreadable_literal", 6691 label: "clippy::unreadable_literal",
6286 description: r##"Warns if a long integral or floating-point constant does\nnot contain underscores."##, 6692 description: r##"Warns if a long integral or floating-point constant does\nnot contain underscores."##,
6287 }, 6693 },
6288 LintCompletion { 6694 Lint {
6289 label: "clippy::unsafe_derive_deserialize", 6695 label: "clippy::unsafe_derive_deserialize",
6290 description: r##"Checks for deriving `serde::Deserialize` on a type that\nhas methods using `unsafe`."##, 6696 description: r##"Checks for deriving `serde::Deserialize` on a type that\nhas methods using `unsafe`."##,
6291 }, 6697 },
6292 LintCompletion { 6698 Lint {
6293 label: "clippy::unsafe_removed_from_name", 6699 label: "clippy::unsafe_removed_from_name",
6294 description: r##"Checks for imports that remove \"unsafe\" from an item's\nname."##, 6700 description: r##"Checks for imports that remove \"unsafe\" from an item's\nname."##,
6295 }, 6701 },
6296 LintCompletion { 6702 Lint {
6297 label: "clippy::unsafe_vector_initialization", 6703 label: "clippy::unsafe_vector_initialization",
6298 description: r##"Nothing. This lint has been deprecated."##, 6704 description: r##"Nothing. This lint has been deprecated."##,
6299 }, 6705 },
6300 LintCompletion { 6706 Lint {
6301 label: "clippy::unseparated_literal_suffix", 6707 label: "clippy::unseparated_literal_suffix",
6302 description: r##"Warns if literal suffixes are not separated by an\nunderscore."##, 6708 description: r##"Warns if literal suffixes are not separated by an\nunderscore."##,
6303 }, 6709 },
6304 LintCompletion { 6710 Lint {
6305 label: "clippy::unsound_collection_transmute", 6711 label: "clippy::unsound_collection_transmute",
6306 description: r##"Checks for transmutes between collections whose\ntypes have different ABI, size or alignment."##, 6712 description: r##"Checks for transmutes between collections whose\ntypes have different ABI, size or alignment."##,
6307 }, 6713 },
6308 LintCompletion { 6714 Lint {
6309 label: "clippy::unstable_as_mut_slice", 6715 label: "clippy::unstable_as_mut_slice",
6310 description: r##"Nothing. This lint has been deprecated."##, 6716 description: r##"Nothing. This lint has been deprecated."##,
6311 }, 6717 },
6312 LintCompletion { 6718 Lint {
6313 label: "clippy::unstable_as_slice", 6719 label: "clippy::unstable_as_slice",
6314 description: r##"Nothing. This lint has been deprecated."##, 6720 description: r##"Nothing. This lint has been deprecated."##,
6315 }, 6721 },
6316 LintCompletion { 6722 Lint {
6317 label: "clippy::unused_async", 6723 label: "clippy::unused_async",
6318 description: r##"Checks for functions that are declared `async` but have no `.await`s inside of them."##, 6724 description: r##"Checks for functions that are declared `async` but have no `.await`s inside of them."##,
6319 }, 6725 },
6320 LintCompletion { 6726 Lint {
6321 label: "clippy::unused_collect", 6727 label: "clippy::unused_collect",
6322 description: r##"Nothing. This lint has been deprecated."##, 6728 description: r##"Nothing. This lint has been deprecated."##,
6323 }, 6729 },
6324 LintCompletion { 6730 Lint {
6325 label: "clippy::unused_io_amount", 6731 label: "clippy::unused_io_amount",
6326 description: r##"Checks for unused written/read amount."##, 6732 description: r##"Checks for unused written/read amount."##,
6327 }, 6733 },
6328 LintCompletion { 6734 Lint {
6329 label: "clippy::unused_self", 6735 label: "clippy::unused_self",
6330 description: r##"Checks methods that contain a `self` argument but don't use it"##, 6736 description: r##"Checks methods that contain a `self` argument but don't use it"##,
6331 }, 6737 },
6332 LintCompletion { 6738 Lint {
6333 label: "clippy::unused_unit", 6739 label: "clippy::unused_unit",
6334 description: r##"Checks for unit (`()`) expressions that can be removed."##, 6740 description: r##"Checks for unit (`()`) expressions that can be removed."##,
6335 }, 6741 },
6336 LintCompletion { 6742 Lint {
6337 label: "clippy::unusual_byte_groupings", 6743 label: "clippy::unusual_byte_groupings",
6338 description: r##"Warns if hexadecimal or binary literals are not grouped\nby nibble or byte."##, 6744 description: r##"Warns if hexadecimal or binary literals are not grouped\nby nibble or byte."##,
6339 }, 6745 },
6340 LintCompletion { 6746 Lint {
6341 label: "clippy::unwrap_in_result", 6747 label: "clippy::unwrap_in_result",
6342 description: r##"Checks for functions of type Result that contain `expect()` or `unwrap()`"##, 6748 description: r##"Checks for functions of type Result that contain `expect()` or `unwrap()`"##,
6343 }, 6749 },
6344 LintCompletion { 6750 Lint {
6345 label: "clippy::unwrap_used", 6751 label: "clippy::unwrap_used",
6346 description: r##"Checks for `.unwrap()` calls on `Option`s and on `Result`s."##, 6752 description: r##"Checks for `.unwrap()` calls on `Option`s and on `Result`s."##,
6347 }, 6753 },
6348 LintCompletion { 6754 Lint {
6349 label: "clippy::upper_case_acronyms", 6755 label: "clippy::upper_case_acronyms",
6350 description: r##"Checks for fully capitalized names and optionally names containing a capitalized acronym."##, 6756 description: r##"Checks for fully capitalized names and optionally names containing a capitalized acronym."##,
6351 }, 6757 },
6352 LintCompletion { 6758 Lint {
6353 label: "clippy::use_debug", 6759 label: "clippy::use_debug",
6354 description: r##"Checks for use of `Debug` formatting. The purpose of this\nlint is to catch debugging remnants."##, 6760 description: r##"Checks for use of `Debug` formatting. The purpose of this\nlint is to catch debugging remnants."##,
6355 }, 6761 },
6356 LintCompletion { 6762 Lint {
6357 label: "clippy::use_self", 6763 label: "clippy::use_self",
6358 description: r##"Checks for unnecessary repetition of structure name when a\nreplacement with `Self` is applicable."##, 6764 description: r##"Checks for unnecessary repetition of structure name when a\nreplacement with `Self` is applicable."##,
6359 }, 6765 },
6360 LintCompletion { 6766 Lint {
6361 label: "clippy::used_underscore_binding", 6767 label: "clippy::used_underscore_binding",
6362 description: r##"Checks for the use of bindings with a single leading\nunderscore."##, 6768 description: r##"Checks for the use of bindings with a single leading\nunderscore."##,
6363 }, 6769 },
6364 LintCompletion { 6770 Lint {
6365 label: "clippy::useless_asref", 6771 label: "clippy::useless_asref",
6366 description: r##"Checks for usage of `.as_ref()` or `.as_mut()` where the\ntypes before and after the call are the same."##, 6772 description: r##"Checks for usage of `.as_ref()` or `.as_mut()` where the\ntypes before and after the call are the same."##,
6367 }, 6773 },
6368 LintCompletion { 6774 Lint {
6369 label: "clippy::useless_attribute", 6775 label: "clippy::useless_attribute",
6370 description: r##"Checks for `extern crate` and `use` items annotated with\nlint attributes.\n\nThis lint permits `#[allow(unused_imports)]`, `#[allow(deprecated)]`,\n`#[allow(unreachable_pub)]`, `#[allow(clippy::wildcard_imports)]` and\n`#[allow(clippy::enum_glob_use)]` on `use` items and `#[allow(unused_imports)]` on\n`extern crate` items with a `#[macro_use]` attribute."##, 6776 description: r##"Checks for `extern crate` and `use` items annotated with\nlint attributes.\n\nThis lint permits `#[allow(unused_imports)]`, `#[allow(deprecated)]`,\n`#[allow(unreachable_pub)]`, `#[allow(clippy::wildcard_imports)]` and\n`#[allow(clippy::enum_glob_use)]` on `use` items and `#[allow(unused_imports)]` on\n`extern crate` items with a `#[macro_use]` attribute."##,
6371 }, 6777 },
6372 LintCompletion { 6778 Lint {
6373 label: "clippy::useless_conversion", 6779 label: "clippy::useless_conversion",
6374 description: r##"Checks for `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` calls\nwhich uselessly convert to the same type."##, 6780 description: r##"Checks for `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` calls\nwhich uselessly convert to the same type."##,
6375 }, 6781 },
6376 LintCompletion { 6782 Lint {
6377 label: "clippy::useless_format", 6783 label: "clippy::useless_format",
6378 description: r##"Checks for the use of `format!(\"string literal with no\nargument\")` and `format!(\"{}\", foo)` where `foo` is a string."##, 6784 description: r##"Checks for the use of `format!(\"string literal with no\nargument\")` and `format!(\"{}\", foo)` where `foo` is a string."##,
6379 }, 6785 },
6380 LintCompletion { 6786 Lint {
6381 label: "clippy::useless_let_if_seq", 6787 label: "clippy::useless_let_if_seq",
6382 description: r##"Checks for variable declarations immediately followed by a\nconditional affectation."##, 6788 description: r##"Checks for variable declarations immediately followed by a\nconditional affectation."##,
6383 }, 6789 },
6384 LintCompletion { 6790 Lint {
6385 label: "clippy::useless_transmute", 6791 label: "clippy::useless_transmute",
6386 description: r##"Checks for transmutes to the original type of the object\nand transmutes that could be a cast."##, 6792 description: r##"Checks for transmutes to the original type of the object\nand transmutes that could be a cast."##,
6387 }, 6793 },
6388 LintCompletion { 6794 Lint {
6389 label: "clippy::useless_vec", 6795 label: "clippy::useless_vec",
6390 description: r##"Checks for usage of `&vec![..]` when using `&[..]` would\nbe possible."##, 6796 description: r##"Checks for usage of `&vec![..]` when using `&[..]` would\nbe possible."##,
6391 }, 6797 },
6392 LintCompletion { 6798 Lint {
6393 label: "clippy::vec_box", 6799 label: "clippy::vec_box",
6394 description: r##"Checks for use of `Vec<Box<T>>` where T: Sized anywhere in the code.\nCheck the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##, 6800 description: r##"Checks for use of `Vec<Box<T>>` where T: Sized anywhere in the code.\nCheck the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
6395 }, 6801 },
6396 LintCompletion { 6802 Lint {
6397 label: "clippy::vec_init_then_push", 6803 label: "clippy::vec_init_then_push",
6398 description: r##"Checks for calls to `push` immediately after creating a new `Vec`."##, 6804 description: r##"Checks for calls to `push` immediately after creating a new `Vec`."##,
6399 }, 6805 },
6400 LintCompletion { 6806 Lint {
6401 label: "clippy::vec_resize_to_zero", 6807 label: "clippy::vec_resize_to_zero",
6402 description: r##"Finds occurrences of `Vec::resize(0, an_int)`"##, 6808 description: r##"Finds occurrences of `Vec::resize(0, an_int)`"##,
6403 }, 6809 },
6404 LintCompletion { 6810 Lint {
6405 label: "clippy::verbose_bit_mask", 6811 label: "clippy::verbose_bit_mask",
6406 description: r##"Checks for bit masks that can be replaced by a call\nto `trailing_zeros`"##, 6812 description: r##"Checks for bit masks that can be replaced by a call\nto `trailing_zeros`"##,
6407 }, 6813 },
6408 LintCompletion { 6814 Lint {
6409 label: "clippy::verbose_file_reads", 6815 label: "clippy::verbose_file_reads",
6410 description: r##"Checks for use of File::read_to_end and File::read_to_string."##, 6816 description: r##"Checks for use of File::read_to_end and File::read_to_string."##,
6411 }, 6817 },
6412 LintCompletion { 6818 Lint {
6413 label: "clippy::vtable_address_comparisons", 6819 label: "clippy::vtable_address_comparisons",
6414 description: r##"Checks for comparisons with an address of a trait vtable."##, 6820 description: r##"Checks for comparisons with an address of a trait vtable."##,
6415 }, 6821 },
6416 LintCompletion { 6822 Lint {
6417 label: "clippy::while_immutable_condition", 6823 label: "clippy::while_immutable_condition",
6418 description: r##"Checks whether variables used within while loop condition\ncan be (and are) mutated in the body."##, 6824 description: r##"Checks whether variables used within while loop condition\ncan be (and are) mutated in the body."##,
6419 }, 6825 },
6420 LintCompletion { 6826 Lint {
6421 label: "clippy::while_let_loop", 6827 label: "clippy::while_let_loop",
6422 description: r##"Detects `loop + match` combinations that are easier\nwritten as a `while let` loop."##, 6828 description: r##"Detects `loop + match` combinations that are easier\nwritten as a `while let` loop."##,
6423 }, 6829 },
6424 LintCompletion { 6830 Lint {
6425 label: "clippy::while_let_on_iterator", 6831 label: "clippy::while_let_on_iterator",
6426 description: r##"Checks for `while let` expressions on iterators."##, 6832 description: r##"Checks for `while let` expressions on iterators."##,
6427 }, 6833 },
6428 LintCompletion { 6834 Lint {
6429 label: "clippy::wildcard_dependencies", 6835 label: "clippy::wildcard_dependencies",
6430 description: r##"Checks for wildcard dependencies in the `Cargo.toml`."##, 6836 description: r##"Checks for wildcard dependencies in the `Cargo.toml`."##,
6431 }, 6837 },
6432 LintCompletion { 6838 Lint {
6433 label: "clippy::wildcard_enum_match_arm", 6839 label: "clippy::wildcard_enum_match_arm",
6434 description: r##"Checks for wildcard enum matches using `_`."##, 6840 description: r##"Checks for wildcard enum matches using `_`."##,
6435 }, 6841 },
6436 LintCompletion { 6842 Lint {
6437 label: "clippy::wildcard_imports", 6843 label: "clippy::wildcard_imports",
6438 description: r##"Checks for wildcard imports `use _::*`."##, 6844 description: r##"Checks for wildcard imports `use _::*`."##,
6439 }, 6845 },
6440 LintCompletion { 6846 Lint {
6441 label: "clippy::wildcard_in_or_patterns", 6847 label: "clippy::wildcard_in_or_patterns",
6442 description: r##"Checks for wildcard pattern used with others patterns in same match arm."##, 6848 description: r##"Checks for wildcard pattern used with others patterns in same match arm."##,
6443 }, 6849 },
6444 LintCompletion { 6850 Lint {
6445 label: "clippy::write_literal", 6851 label: "clippy::write_literal",
6446 description: r##"This lint warns about the use of literals as `write!`/`writeln!` args."##, 6852 description: r##"This lint warns about the use of literals as `write!`/`writeln!` args."##,
6447 }, 6853 },
6448 LintCompletion { 6854 Lint {
6449 label: "clippy::write_with_newline", 6855 label: "clippy::write_with_newline",
6450 description: r##"This lint warns when you use `write!()` with a format\nstring that\nends in a newline."##, 6856 description: r##"This lint warns when you use `write!()` with a format\nstring that\nends in a newline."##,
6451 }, 6857 },
6452 LintCompletion { 6858 Lint {
6453 label: "clippy::writeln_empty_string", 6859 label: "clippy::writeln_empty_string",
6454 description: r##"This lint warns when you use `writeln!(buf, \"\")` to\nprint a newline."##, 6860 description: r##"This lint warns when you use `writeln!(buf, \"\")` to\nprint a newline."##,
6455 }, 6861 },
6456 LintCompletion { 6862 Lint {
6457 label: "clippy::wrong_pub_self_convention", 6863 label: "clippy::wrong_pub_self_convention",
6458 description: r##"Nothing. This lint has been deprecated."##, 6864 description: r##"Nothing. This lint has been deprecated."##,
6459 }, 6865 },
6460 LintCompletion { 6866 Lint {
6461 label: "clippy::wrong_self_convention", 6867 label: "clippy::wrong_self_convention",
6462 description: r##"Checks for methods with certain name prefixes and which\ndoesn't match how self is taken. The actual rules are:\n\n|Prefix |Postfix |`self` taken | `self` type |\n|-------|------------|-----------------------|--------------|\n|`as_` | none |`&self` or `&mut self` | any |\n|`from_`| none | none | any |\n|`into_`| none |`self` | any |\n|`is_` | none |`&self` or none | any |\n|`to_` | `_mut` |`&mut self` | any |\n|`to_` | not `_mut` |`self` | `Copy` |\n|`to_` | not `_mut` |`&self` | not `Copy` |\n\nNote: Clippy doesn't trigger methods with `to_` prefix in:\n- Traits definition.\nClippy can not tell if a type that implements a trait is `Copy` or not.\n- Traits implementation, when `&self` is taken.\nThe method signature is controlled by the trait and often `&self` is required for all types that implement the trait\n(see e.g. the `std::string::ToString` trait).\n\nPlease find more info here:\nhttps://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv"##, 6868 description: r##"Checks for methods with certain name prefixes and which\ndoesn't match how self is taken. The actual rules are:\n\n|Prefix |Postfix |`self` taken | `self` type |\n|-------|------------|-----------------------|--------------|\n|`as_` | none |`&self` or `&mut self` | any |\n|`from_`| none | none | any |\n|`into_`| none |`self` | any |\n|`is_` | none |`&self` or none | any |\n|`to_` | `_mut` |`&mut self` | any |\n|`to_` | not `_mut` |`self` | `Copy` |\n|`to_` | not `_mut` |`&self` | not `Copy` |\n\nNote: Clippy doesn't trigger methods with `to_` prefix in:\n- Traits definition.\nClippy can not tell if a type that implements a trait is `Copy` or not.\n- Traits implementation, when `&self` is taken.\nThe method signature is controlled by the trait and often `&self` is required for all types that implement the trait\n(see e.g. the `std::string::ToString` trait).\n\nPlease find more info here:\nhttps://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv"##,
6463 }, 6869 },
6464 LintCompletion { 6870 Lint {
6465 label: "clippy::wrong_transmute", 6871 label: "clippy::wrong_transmute",
6466 description: r##"Checks for transmutes that can't ever be correct on any\narchitecture."##, 6872 description: r##"Checks for transmutes that can't ever be correct on any\narchitecture."##,
6467 }, 6873 },
6468 LintCompletion { 6874 Lint { label: "clippy::zero_divided_by_zero", description: r##"Checks for `0.0 / 0.0`."## },
6469 label: "clippy::zero_divided_by_zero", 6875 Lint {
6470 description: r##"Checks for `0.0 / 0.0`."##,
6471 },
6472 LintCompletion {
6473 label: "clippy::zero_prefixed_literal", 6876 label: "clippy::zero_prefixed_literal",
6474 description: r##"Warns if an integral constant literal starts with `0`."##, 6877 description: r##"Warns if an integral constant literal starts with `0`."##,
6475 }, 6878 },
6476 LintCompletion { 6879 Lint {
6477 label: "clippy::zero_ptr", 6880 label: "clippy::zero_ptr",
6478 description: r##"Catch casts from `0` to some pointer type"##, 6881 description: r##"Catch casts from `0` to some pointer type"##,
6479 }, 6882 },
6480 LintCompletion { 6883 Lint {
6481 label: "clippy::zero_sized_map_values", 6884 label: "clippy::zero_sized_map_values",
6482 description: r##"Checks for maps with zero-sized value types anywhere in the code."##, 6885 description: r##"Checks for maps with zero-sized value types anywhere in the code."##,
6483 }, 6886 },
6484 LintCompletion { 6887 Lint {
6485 label: "clippy::zst_offset", 6888 label: "clippy::zst_offset",
6486 description: r##"Checks for `offset(_)`, `wrapping_`{`add`, `sub`}, etc. on raw pointers to\nzero-sized types"##, 6889 description: r##"Checks for `offset(_)`, `wrapping_`{`add`, `sub`}, etc. on raw pointers to\nzero-sized types"##,
6487 }, 6890 },
diff --git a/xtask/src/codegen/gen_lint_completions.rs b/xtask/src/codegen/gen_lint_completions.rs
index f5736d1b5..d56b23218 100644
--- a/xtask/src/codegen/gen_lint_completions.rs
+++ b/xtask/src/codegen/gen_lint_completions.rs
@@ -12,23 +12,54 @@ pub(crate) fn generate_lint_completions() -> Result<()> {
12 cmd!("git clone --depth=1 https://github.com/rust-lang/rust ./target/rust").run()?; 12 cmd!("git clone --depth=1 https://github.com/rust-lang/rust ./target/rust").run()?;
13 } 13 }
14 14
15 let mut contents = String::from("use crate::completions::attribute::LintCompletion;\n\n"); 15 let mut contents = String::from(
16 generate_descriptor(&mut contents, "./target/rust/src/doc/unstable-book/src".into())?; 16 r#"pub struct Lint {
17 pub label: &'static str,
18 pub description: &'static str,
19}
20
21"#,
22 );
23 generate_lint_descriptor(&mut contents)?;
24 contents.push('\n');
25
26 generate_feature_descriptor(&mut contents, "./target/rust/src/doc/unstable-book/src".into())?;
17 contents.push('\n'); 27 contents.push('\n');
18 28
19 cmd!("curl http://rust-lang.github.io/rust-clippy/master/lints.json --output ./target/clippy_lints.json").run()?; 29 cmd!("curl http://rust-lang.github.io/rust-clippy/master/lints.json --output ./target/clippy_lints.json").run()?;
20 generate_descriptor_clippy(&mut contents, &Path::new("./target/clippy_lints.json"))?; 30 generate_descriptor_clippy(&mut contents, &Path::new("./target/clippy_lints.json"))?;
21 let contents = reformat(&contents)?; 31 let contents = reformat(&contents)?;
22 32
23 let destination = 33 let destination = project_root().join("crates/ide_db/src/helpers/generated_lints.rs");
24 project_root().join("crates/ide_completion/src/generated_lint_completions.rs");
25 ensure_file_contents(destination.as_path(), &contents)?; 34 ensure_file_contents(destination.as_path(), &contents)?;
26 35
27 Ok(()) 36 Ok(())
28} 37}
29 38
30fn generate_descriptor(buf: &mut String, src_dir: PathBuf) -> Result<()> { 39fn generate_lint_descriptor(buf: &mut String) -> Result<()> {
31 buf.push_str(r#"pub const FEATURES: &[LintCompletion] = &["#); 40 let stdout = cmd!("rustc -W help").read()?;
41 let start = stdout.find("---- ------- -------").ok_or_else(|| anyhow::format_err!(""))?;
42 let end =
43 stdout.rfind("Lint groups provided by rustc:").ok_or_else(|| anyhow::format_err!(""))?;
44 buf.push_str(r#"pub const DEFAULT_LINTS: &[Lint] = &["#);
45 buf.push('\n');
46 let mut lints = stdout[start..end]
47 .lines()
48 .filter(|l| !l.is_empty())
49 .flat_map(|line| {
50 let (name, rest) = line.trim().split_once(char::is_whitespace)?;
51 let (_default_level, description) = rest.trim().split_once(char::is_whitespace)?;
52 Some((name.trim(), description.trim()))
53 })
54 .collect::<Vec<_>>();
55 lints.sort_by(|(ident, _), (ident2, _)| ident.cmp(ident2));
56 lints.into_iter().for_each(|(name, description)| push_lint_completion(buf, name, description));
57 buf.push_str("];\n");
58 Ok(())
59}
60
61fn generate_feature_descriptor(buf: &mut String, src_dir: PathBuf) -> Result<()> {
62 buf.push_str(r#"pub const FEATURES: &[Lint] = &["#);
32 buf.push('\n'); 63 buf.push('\n');
33 let mut vec = ["language-features", "library-features"] 64 let mut vec = ["language-features", "library-features"]
34 .iter() 65 .iter()
@@ -46,9 +77,8 @@ fn generate_descriptor(buf: &mut String, src_dir: PathBuf) -> Result<()> {
46 }) 77 })
47 .collect::<Vec<_>>(); 78 .collect::<Vec<_>>();
48 vec.sort_by(|(feature_ident, _), (feature_ident2, _)| feature_ident.cmp(feature_ident2)); 79 vec.sort_by(|(feature_ident, _), (feature_ident2, _)| feature_ident.cmp(feature_ident2));
49 vec.into_iter().for_each(|(feature_ident, doc)| { 80 vec.into_iter()
50 push_lint_completion(buf, &feature_ident, &doc); 81 .for_each(|(feature_ident, doc)| push_lint_completion(buf, &feature_ident, &doc));
51 });
52 buf.push_str("];\n"); 82 buf.push_str("];\n");
53 Ok(()) 83 Ok(())
54} 84}
@@ -90,7 +120,7 @@ fn generate_descriptor_clippy(buf: &mut String, path: &Path) -> Result<()> {
90 } 120 }
91 } 121 }
92 clippy_lints.sort_by(|lint, lint2| lint.id.cmp(&lint2.id)); 122 clippy_lints.sort_by(|lint, lint2| lint.id.cmp(&lint2.id));
93 buf.push_str(r#"pub const CLIPPY_LINTS: &[LintCompletion] = &["#); 123 buf.push_str(r#"pub const CLIPPY_LINTS: &[Lint] = &["#);
94 buf.push('\n'); 124 buf.push('\n');
95 clippy_lints.into_iter().for_each(|clippy_lint| { 125 clippy_lints.into_iter().for_each(|clippy_lint| {
96 let lint_ident = format!("clippy::{}", clippy_lint.id); 126 let lint_ident = format!("clippy::{}", clippy_lint.id);
@@ -106,7 +136,7 @@ fn generate_descriptor_clippy(buf: &mut String, path: &Path) -> Result<()> {
106fn push_lint_completion(buf: &mut String, label: &str, description: &str) { 136fn push_lint_completion(buf: &mut String, label: &str, description: &str) {
107 writeln!( 137 writeln!(
108 buf, 138 buf,
109 r###" LintCompletion {{ 139 r###" Lint {{
110 label: "{}", 140 label: "{}",
111 description: r##"{}"## 141 description: r##"{}"##
112 }},"###, 142 }},"###,