]> git.lizzy.rs Git - rust.git/commitdiff
Added `clippy::version` attribute to all normal lints
authorxFrednet <xFrednet@gmail.com>
Thu, 21 Oct 2021 19:06:26 +0000 (21:06 +0200)
committerxFrednet <xFrednet@gmail.com>
Wed, 10 Nov 2021 18:48:31 +0000 (19:48 +0100)
So, some context for this, well, more a story. I'm not used to scripting, I've never really scripted anything, even if it's a valuable skill. I just never really needed it. Now, `@flip1995` correctly suggested using a script for this in `rust-clippy#7813`...

And I decided to write a script using nushell because why not? This was a mistake... I spend way more time on this than I would like to admit. It has definitely been more than 4 hours. It shouldn't take that long, but me being new to scripting and nushell just wasn't a good mixture... Anyway, here is the script that creates another script which adds the versions. Fun...

Just execute this on the `gh-pages` branch and the resulting `replacer.sh` in `clippy_lints` and it should all work.

```nu
mv v0.0.212 rust-1.00.0;
mv beta rust-1.57.0;
mv master rust-1.58.0;

let paths = (open ./rust-1.58.0/lints.json | select id id_span | flatten | select id path);
let versions = (
    ls | where name =~ "rust-" | select name | format {name}/lints.json |
    each { open $it | select id | insert version $it | str substring "5,11" version} |
    group-by id | rotate counter-clockwise id version |
    update version {get version | first 1} | flatten | select id version);
$paths | each { |row|
    let version = ($versions | where id == ($row.id) | format {version})
    let idu = ($row.id | str upcase)
    $"sed -i '0,/($idu),/{s/pub ($idu),/#[clippy::version = "($version)"]\n    pub ($idu),/}' ($row.path)"
} | str collect ";" | str find-replace --all '1.00.0' 'pre 1.29.0' | save "replacer.sh";
```

And this still has some problems, but at this point I just want to be done -.-

235 files changed:
clippy_lints/src/absurd_extreme_comparisons.rs
clippy_lints/src/approx_const.rs
clippy_lints/src/arithmetic.rs
clippy_lints/src/as_conversions.rs
clippy_lints/src/asm_syntax.rs
clippy_lints/src/assertions_on_constants.rs
clippy_lints/src/assign_ops.rs
clippy_lints/src/async_yields_async.rs
clippy_lints/src/attrs.rs
clippy_lints/src/await_holding_invalid.rs
clippy_lints/src/bit_mask.rs
clippy_lints/src/blacklisted_name.rs
clippy_lints/src/blocks_in_if_conditions.rs
clippy_lints/src/bool_assert_comparison.rs
clippy_lints/src/booleans.rs
clippy_lints/src/bytecount.rs
clippy_lints/src/cargo_common_metadata.rs
clippy_lints/src/case_sensitive_file_extension_comparisons.rs
clippy_lints/src/casts/mod.rs
clippy_lints/src/checked_conversions.rs
clippy_lints/src/cognitive_complexity.rs
clippy_lints/src/collapsible_if.rs
clippy_lints/src/collapsible_match.rs
clippy_lints/src/comparison_chain.rs
clippy_lints/src/copies.rs
clippy_lints/src/copy_iterator.rs
clippy_lints/src/create_dir.rs
clippy_lints/src/dbg_macro.rs
clippy_lints/src/default.rs
clippy_lints/src/default_numeric_fallback.rs
clippy_lints/src/dereference.rs
clippy_lints/src/derivable_impls.rs
clippy_lints/src/derive.rs
clippy_lints/src/disallowed_method.rs
clippy_lints/src/disallowed_script_idents.rs
clippy_lints/src/disallowed_type.rs
clippy_lints/src/doc.rs
clippy_lints/src/double_comparison.rs
clippy_lints/src/double_parens.rs
clippy_lints/src/drop_forget_ref.rs
clippy_lints/src/duration_subsec.rs
clippy_lints/src/else_if_without_else.rs
clippy_lints/src/empty_enum.rs
clippy_lints/src/entry.rs
clippy_lints/src/enum_clike.rs
clippy_lints/src/enum_variants.rs
clippy_lints/src/eq_op.rs
clippy_lints/src/equatable_if_let.rs
clippy_lints/src/erasing_op.rs
clippy_lints/src/escape.rs
clippy_lints/src/eta_reduction.rs
clippy_lints/src/eval_order_dependence.rs
clippy_lints/src/excessive_bools.rs
clippy_lints/src/exhaustive_items.rs
clippy_lints/src/exit.rs
clippy_lints/src/explicit_write.rs
clippy_lints/src/fallible_impl_from.rs
clippy_lints/src/feature_name.rs
clippy_lints/src/float_equality_without_abs.rs
clippy_lints/src/float_literal.rs
clippy_lints/src/floating_point_arithmetic.rs
clippy_lints/src/format.rs
clippy_lints/src/format_args.rs
clippy_lints/src/formatting.rs
clippy_lints/src/from_over_into.rs
clippy_lints/src/from_str_radix_10.rs
clippy_lints/src/functions/mod.rs
clippy_lints/src/future_not_send.rs
clippy_lints/src/get_last_with_len.rs
clippy_lints/src/identity_op.rs
clippy_lints/src/if_let_mutex.rs
clippy_lints/src/if_not_else.rs
clippy_lints/src/if_then_some_else_none.rs
clippy_lints/src/implicit_hasher.rs
clippy_lints/src/implicit_return.rs
clippy_lints/src/implicit_saturating_sub.rs
clippy_lints/src/inconsistent_struct_constructor.rs
clippy_lints/src/indexing_slicing.rs
clippy_lints/src/infinite_iter.rs
clippy_lints/src/inherent_impl.rs
clippy_lints/src/inherent_to_string.rs
clippy_lints/src/inline_fn_without_body.rs
clippy_lints/src/int_plus_one.rs
clippy_lints/src/integer_division.rs
clippy_lints/src/invalid_upcast_comparisons.rs
clippy_lints/src/items_after_statements.rs
clippy_lints/src/iter_not_returning_iterator.rs
clippy_lints/src/large_const_arrays.rs
clippy_lints/src/large_enum_variant.rs
clippy_lints/src/large_stack_arrays.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/let_if_seq.rs
clippy_lints/src/let_underscore.rs
clippy_lints/src/lifetimes.rs
clippy_lints/src/literal_representation.rs
clippy_lints/src/loops/mod.rs
clippy_lints/src/macro_use.rs
clippy_lints/src/main_recursion.rs
clippy_lints/src/manual_assert.rs
clippy_lints/src/manual_async_fn.rs
clippy_lints/src/manual_map.rs
clippy_lints/src/manual_non_exhaustive.rs
clippy_lints/src/manual_ok_or.rs
clippy_lints/src/manual_strip.rs
clippy_lints/src/manual_unwrap_or.rs
clippy_lints/src/map_clone.rs
clippy_lints/src/map_err_ignore.rs
clippy_lints/src/map_unit_fn.rs
clippy_lints/src/match_on_vec_items.rs
clippy_lints/src/match_result_ok.rs
clippy_lints/src/match_str_case_mismatch.rs
clippy_lints/src/matches.rs
clippy_lints/src/mem_forget.rs
clippy_lints/src/mem_replace.rs
clippy_lints/src/methods/mod.rs
clippy_lints/src/minmax.rs
clippy_lints/src/misc.rs
clippy_lints/src/misc_early/mod.rs
clippy_lints/src/missing_const_for_fn.rs
clippy_lints/src/missing_doc.rs
clippy_lints/src/missing_enforced_import_rename.rs
clippy_lints/src/missing_inline.rs
clippy_lints/src/module_style.rs
clippy_lints/src/modulo_arithmetic.rs
clippy_lints/src/multiple_crate_versions.rs
clippy_lints/src/mut_key.rs
clippy_lints/src/mut_mut.rs
clippy_lints/src/mut_mutex_lock.rs
clippy_lints/src/mut_reference.rs
clippy_lints/src/mutable_debug_assertion.rs
clippy_lints/src/mutex_atomic.rs
clippy_lints/src/needless_arbitrary_self_type.rs
clippy_lints/src/needless_bitwise_bool.rs
clippy_lints/src/needless_bool.rs
clippy_lints/src/needless_borrow.rs
clippy_lints/src/needless_borrowed_ref.rs
clippy_lints/src/needless_continue.rs
clippy_lints/src/needless_for_each.rs
clippy_lints/src/needless_option_as_deref.rs
clippy_lints/src/needless_pass_by_value.rs
clippy_lints/src/needless_question_mark.rs
clippy_lints/src/needless_update.rs
clippy_lints/src/neg_cmp_op_on_partial_ord.rs
clippy_lints/src/neg_multiply.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/no_effect.rs
clippy_lints/src/non_copy_const.rs
clippy_lints/src/non_expressive_names.rs
clippy_lints/src/non_octal_unix_permissions.rs
clippy_lints/src/non_send_fields_in_send_ty.rs
clippy_lints/src/nonstandard_macro_braces.rs
clippy_lints/src/open_options.rs
clippy_lints/src/option_env_unwrap.rs
clippy_lints/src/option_if_let_else.rs
clippy_lints/src/overflow_check_conditional.rs
clippy_lints/src/panic_in_result_fn.rs
clippy_lints/src/panic_unimplemented.rs
clippy_lints/src/partialeq_ne_impl.rs
clippy_lints/src/pass_by_ref_or_value.rs
clippy_lints/src/path_buf_push_overwrite.rs
clippy_lints/src/pattern_type_mismatch.rs
clippy_lints/src/precedence.rs
clippy_lints/src/ptr.rs
clippy_lints/src/ptr_eq.rs
clippy_lints/src/ptr_offset_with_cast.rs
clippy_lints/src/question_mark.rs
clippy_lints/src/ranges.rs
clippy_lints/src/redundant_clone.rs
clippy_lints/src/redundant_closure_call.rs
clippy_lints/src/redundant_else.rs
clippy_lints/src/redundant_field_names.rs
clippy_lints/src/redundant_pub_crate.rs
clippy_lints/src/redundant_slicing.rs
clippy_lints/src/redundant_static_lifetimes.rs
clippy_lints/src/ref_option_ref.rs
clippy_lints/src/reference.rs
clippy_lints/src/regex.rs
clippy_lints/src/repeat_once.rs
clippy_lints/src/returns.rs
clippy_lints/src/same_name_method.rs
clippy_lints/src/self_assignment.rs
clippy_lints/src/self_named_constructors.rs
clippy_lints/src/semicolon_if_nothing_returned.rs
clippy_lints/src/serde_api.rs
clippy_lints/src/shadow.rs
clippy_lints/src/single_component_path_imports.rs
clippy_lints/src/size_of_in_element_count.rs
clippy_lints/src/slow_vector_initialization.rs
clippy_lints/src/stable_sort_primitive.rs
clippy_lints/src/strings.rs
clippy_lints/src/strlen_on_c_strings.rs
clippy_lints/src/suspicious_operation_groupings.rs
clippy_lints/src/suspicious_trait_impl.rs
clippy_lints/src/swap.rs
clippy_lints/src/tabs_in_doc_comments.rs
clippy_lints/src/temporary_assignment.rs
clippy_lints/src/to_digit_is_some.rs
clippy_lints/src/to_string_in_display.rs
clippy_lints/src/trailing_empty_array.rs
clippy_lints/src/trait_bounds.rs
clippy_lints/src/transmute/mod.rs
clippy_lints/src/transmuting_null.rs
clippy_lints/src/try_err.rs
clippy_lints/src/types/mod.rs
clippy_lints/src/undocumented_unsafe_blocks.rs
clippy_lints/src/undropped_manually_drops.rs
clippy_lints/src/unicode.rs
clippy_lints/src/uninit_vec.rs
clippy_lints/src/unit_hash.rs
clippy_lints/src/unit_return_expecting_ord.rs
clippy_lints/src/unit_types/mod.rs
clippy_lints/src/unnamed_address.rs
clippy_lints/src/unnecessary_self_imports.rs
clippy_lints/src/unnecessary_sort_by.rs
clippy_lints/src/unnecessary_wraps.rs
clippy_lints/src/unnested_or_patterns.rs
clippy_lints/src/unsafe_removed_from_name.rs
clippy_lints/src/unused_async.rs
clippy_lints/src/unused_io_amount.rs
clippy_lints/src/unused_self.rs
clippy_lints/src/unused_unit.rs
clippy_lints/src/unwrap.rs
clippy_lints/src/unwrap_in_result.rs
clippy_lints/src/upper_case_acronyms.rs
clippy_lints/src/use_self.rs
clippy_lints/src/useless_conversion.rs
clippy_lints/src/vec.rs
clippy_lints/src/vec_init_then_push.rs
clippy_lints/src/vec_resize_to_zero.rs
clippy_lints/src/verbose_file_reads.rs
clippy_lints/src/wildcard_dependencies.rs
clippy_lints/src/wildcard_imports.rs
clippy_lints/src/write.rs
clippy_lints/src/zero_div_zero.rs
clippy_lints/src/zero_sized_map_values.rs

index 1483f3f9185aeb741d4f76b4b29ad18250c6263d..7665aa8380b3c396594f5af3a066bd9b72eef463 100644 (file)
@@ -36,6 +36,7 @@
     /// if vec.len() <= 0 {}
     /// if 100 > i32::MAX {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ABSURD_EXTREME_COMPARISONS,
     correctness,
     "a comparison with a maximum or minimum value that is always true or false"
index fb54ac1ec511981595402d73dfd3bba329b3e903..12435eefbc4eeaf89816d09a1493c8049f85c61b 100644 (file)
@@ -33,6 +33,7 @@
     /// let x = std::f32::consts::PI;
     /// let y = std::f64::consts::FRAC_1_PI;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub APPROX_CONSTANT,
     correctness,
     "the approximate of a known float constant (in `std::fXX::consts`)"
index 36fe7b7a8675441943a430129f70e00f90bc875c..e0c1d6ab6e12235577859c606f9e572dcbaf9f0f 100644 (file)
@@ -25,6 +25,7 @@
     /// # let a = 0;
     /// a + 1;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INTEGER_ARITHMETIC,
     restriction,
     "any integer arithmetic expression which could overflow or panic"
@@ -43,6 +44,7 @@
     /// # let a = 0.0;
     /// a + 1.0;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FLOAT_ARITHMETIC,
     restriction,
     "any floating-point arithmetic statement"
index 0be460d67a75f3e8bbb248782978eed3ba1a79fb..53704da1046bcf236a5a511c0b83a5557b6ba4ab 100644 (file)
@@ -38,6 +38,7 @@
     /// f(a.try_into().expect("Unexpected u16 overflow in f"));
     /// ```
     ///
+    #[clippy::version = "1.41.0"]
     pub AS_CONVERSIONS,
     restriction,
     "using a potentially dangerous silent `as` conversion"
index 825832eb79dab8e15bc49ed42a73fac97338223e..0322698f029556d3e0fc341ddc3e4f2df3f9db42 100644 (file)
@@ -75,6 +75,7 @@ fn check_expr_asm_syntax(lint: &'static Lint, cx: &EarlyContext<'_>, expr: &Expr
     /// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
     /// # }
     /// ```
+    #[clippy::version = "1.49.0"]
     pub INLINE_ASM_X86_INTEL_SYNTAX,
     restriction,
     "prefer AT&T x86 assembly syntax"
@@ -111,6 +112,7 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
     /// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
     /// # }
     /// ```
+    #[clippy::version = "1.49.0"]
     pub INLINE_ASM_X86_ATT_SYNTAX,
     restriction,
     "prefer Intel x86 assembly syntax"
index d834a1d317a0f1d7e9d3344fb764cc3a2ab866d4..521fc84ee9c375ae3d74416afd0b8a60bb1fc86c 100644 (file)
@@ -26,6 +26,7 @@
     /// const B: bool = false;
     /// assert!(B)
     /// ```
+    #[clippy::version = "1.34.0"]
     pub ASSERTIONS_ON_CONSTANTS,
     style,
     "`assert!(true)` / `assert!(false)` will be optimized out by the compiler, and should probably be replaced by a `panic!()` or `unreachable!()`"
index 2097a1feff9f362025189849c3f93ae48d8233f2..e16f4369da9fcdd488063d232f2f70890e86bef4 100644 (file)
@@ -34,6 +34,7 @@
     /// // Good
     /// a += b;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ASSIGN_OP_PATTERN,
     style,
     "assigning the result of an operation on a variable to that same variable"
@@ -60,6 +61,7 @@
     /// // ...
     /// a += a + b;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MISREFACTORED_ASSIGN_OP,
     suspicious,
     "having a variable on both sides of an assign op"
index 182736a5a205a6ab3178ef7de4e83af150df74e8..0619490e73c4361da3284406b0b8bdceff50a128 100644 (file)
@@ -34,6 +34,7 @@
     ///   };
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub ASYNC_YIELDS_ASYNC,
     correctness,
     "async blocks that return a type that can be awaited"
index 9c5db18336fc1d3c6ea72241d979e7f0fe9e854f..1edb7c950e7b1d0bd141654178cf032d731b3a59 100644 (file)
@@ -66,6 +66,7 @@
     /// #[inline(always)]
     /// fn not_quite_hot_code(..) { ... }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INLINE_ALWAYS,
     pedantic,
     "use of `#[inline(always)]`"
     /// #[macro_use]
     /// extern crate baz;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USELESS_ATTRIBUTE,
     correctness,
     "use of lint attributes on `extern crate` items"
     /// #[deprecated(since = "forever")]
     /// fn something_else() { /* ... */ }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DEPRECATED_SEMVER,
     correctness,
     "use of `#[deprecated(since = \"x\")]` where x is not semver"
     /// #[allow(dead_code)]
     /// fn this_is_fine_too() { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EMPTY_LINE_AFTER_OUTER_ATTR,
     nursery,
     "empty line after outer attribute"
     /// ```rust
     /// #![deny(clippy::as_conversions)]
     /// ```
+    #[clippy::version = "1.47.0"]
     pub BLANKET_CLIPPY_RESTRICTION_LINTS,
     suspicious,
     "enabling the complete restriction group"
     /// #[rustfmt::skip]
     /// fn main() { }
     /// ```
+    #[clippy::version = "1.32.0"]
     pub DEPRECATED_CFG_ATTR,
     complexity,
     "usage of `cfg_attr(rustfmt)` instead of tool attributes"
     /// fn conditional() { }
     /// ```
     /// Check the [Rust Reference](https://doc.rust-lang.org/reference/conditional-compilation.html#target_os) for more details.
+    #[clippy::version = "1.45.0"]
     pub MISMATCHED_TARGET_OS,
     correctness,
     "usage of `cfg(operating_system)` instead of `cfg(target_os = \"operating_system\")`"
index 28615b9217cd342df10851a1a308409f6c36a693..1cc3418d4748c98728116538fba64a80949abefc 100644 (file)
@@ -47,6 +47,7 @@
     ///   bar.await;
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub AWAIT_HOLDING_LOCK,
     pedantic,
     "Inside an async function, holding a MutexGuard while calling await"
@@ -88,6 +89,7 @@
     ///   bar.await;
     /// }
     /// ```
+    #[clippy::version = "1.49.0"]
     pub AWAIT_HOLDING_REFCELL_REF,
     pedantic,
     "Inside an async function, holding a RefCell ref while calling await"
index 11346e7c96af98b4f074eca91afd0de745ce4cba..0977cf22b2c4e00343756b8ef381f66291ae24f5 100644 (file)
@@ -41,6 +41,7 @@
     /// # let x = 1;
     /// if (x & 1 == 2) { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BAD_BIT_MASK,
     correctness,
     "expressions of the form `_ & mask == select` that will only ever return `true` or `false`"
@@ -73,6 +74,7 @@
     /// # let x = 1;
     /// if (x | 1 > 3) {  }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INEFFECTIVE_BIT_MASK,
     correctness,
     "expressions where a bit mask will be rendered useless by a comparison, e.g., `(x | 1) > 2`"
@@ -95,6 +97,7 @@
     /// # let x = 1;
     /// if x & 0b1111 == 0 { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub VERBOSE_BIT_MASK,
     pedantic,
     "expressions where a bit mask is less readable than the corresponding method call"
index 916c78c982ae4e63863ada1ecd1d928cf74aab7e..1600fb25d89e24cec4b9935477b1d19f25a4987d 100644 (file)
@@ -17,6 +17,7 @@
     /// ```rust
     /// let foo = 3.14;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BLACKLISTED_NAME,
     style,
     "usage of a blacklisted/placeholder name"
index 47e5b0d583dabcee654d1613e6057a06459f5112..b59f49357df241c9f6a0cd33a9cebb26d142aeee 100644 (file)
@@ -41,6 +41,7 @@
     /// let res = { let x = somefunc(); x };
     /// if res { /* ... */ }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub BLOCKS_IN_IF_CONDITIONS,
     style,
     "useless or complex blocks that can be eliminated in conditions"
index cdc192a47e48abebb325f95437ce48a1ee00dee6..a59abc6630671e3a6f88bb3594cdfa9eab91b87d 100644 (file)
@@ -23,6 +23,7 @@
     /// // Good
     /// assert!(!"a".is_empty());
     /// ```
+    #[clippy::version = "1.53.0"]
     pub BOOL_ASSERT_COMPARISON,
     style,
     "Using a boolean as comparison value in an assert_* macro when there is no need"
index a1e6b7224ff3a897ee0c7a5dd442807c105b3ce3..51835ee7488fb01fe3090b45633eb0039dbb6743 100644 (file)
@@ -31,6 +31,7 @@
     /// if a && true  // should be: if a
     /// if !(a == b)  // should be: if a != b
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NONMINIMAL_BOOL,
     complexity,
     "boolean expressions that can be written more concisely"
@@ -52,6 +53,7 @@
     /// if a && b || a { ... }
     /// ```
     /// The `b` is unnecessary, the expression is equivalent to `if a`.
+    #[clippy::version = "pre 1.29.0"]
     pub LOGIC_BUG,
     correctness,
     "boolean expressions that contain terminals which can be eliminated"
index a07cd5e5f4e53940be988f8fe12b8f968174d755..a938ada9d2aaa61aa6c6e3bbfb354c0d7f9013a0 100644 (file)
@@ -30,6 +30,7 @@
     /// # let vec = vec![1_u8];
     /// &vec.iter().filter(|x| **x == 0u8).count(); // use bytecount::count instead
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NAIVE_BYTECOUNT,
     pedantic,
     "use of naive `<slice>.filter(|&x| x == y).count()` to count byte values"
index ff619c59b6e2412da3d5ef45ddacb137848bebe6..23f79fdc68238ec24ecb1fe5dd2c6e7c08dd3279 100644 (file)
@@ -42,6 +42,7 @@
     /// keywords = ["clippy", "lint", "plugin"]
     /// categories = ["development-tools", "development-tools::cargo-plugins"]
     /// ```
+    #[clippy::version = "1.32.0"]
     pub CARGO_COMMON_METADATA,
     cargo,
     "common metadata is defined in `Cargo.toml`"
index c876553c165beb916409a9bb3a159a9d79974192..3f286dd9e2fca893b849ce17450b909caf4d3d02 100644 (file)
@@ -27,6 +27,7 @@
     ///     filename.rsplit('.').next().map(|ext| ext.eq_ignore_ascii_case("rs")) == Some(true)
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS,
     pedantic,
     "Checks for calls to ends_with with case-sensitive file extensions"
index 233abd178943e9bc20b2685c68fd55f03d46a9c3..c674327486cb9582011aa756371ba1a052ee91af 100644 (file)
@@ -40,6 +40,7 @@
     /// let x = u64::MAX;
     /// x as f64;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CAST_PRECISION_LOSS,
     pedantic,
     "casts that cause loss of precision, e.g., `x as f32` where `x: u64`"
@@ -61,6 +62,7 @@
     /// let y: i8 = -1;
     /// y as u128; // will return 18446744073709551615
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CAST_SIGN_LOSS,
     pedantic,
     "casts from signed types to unsigned types, e.g., `x as u32` where `x: i32`"
@@ -83,6 +85,7 @@
     ///     x as u8
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CAST_POSSIBLE_TRUNCATION,
     pedantic,
     "casts that may cause truncation of the value, e.g., `x as u8` where `x: u32`, or `x as i32` where `x: f32`"
     /// ```rust
     /// u32::MAX as i32; // will yield a value of `-1`
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CAST_POSSIBLE_WRAP,
     pedantic,
     "casts that may cause wrapping around the value, e.g., `x as i32` where `x: u32` and `x > i32::MAX`"
     ///     u64::from(x)
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CAST_LOSSLESS,
     pedantic,
     "casts using `as` that are known to be lossless, e.g., `x as u64` where `x: u8`"
     /// let _ = 2_i32;
     /// let _ = 0.5_f32;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNNECESSARY_CAST,
     complexity,
     "cast to the same type, e.g., `x as i32` where `x: i32`"
     /// (&1u8 as *const u8).cast::<u16>();
     /// (&mut 1u8 as *mut u8).cast::<u16>();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CAST_PTR_ALIGNMENT,
     pedantic,
     "cast from a pointer to a more-strictly-aligned pointer"
     /// fn fun2() -> i32 { 1 }
     /// let a = fun2 as usize;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FN_TO_NUMERIC_CAST,
     style,
     "casting a function pointer to a numeric type other than usize"
     /// let fn_ptr = fn2 as usize;
     /// let fn_ptr_truncated = fn_ptr as i32;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
     style,
     "casting a function pointer to a numeric type not wide enough to store the address"
     /// }
     /// let _ = fn3 as fn() -> u16;
     /// ```
+    #[clippy::version = "1.58.0"]
     pub FN_TO_NUMERIC_CAST_ANY,
     restriction,
     "casting a function pointer to any integer type"
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.33.0"]
     pub CAST_REF_TO_MUT,
     correctness,
     "a cast of reference to a mutable pointer"
     /// ```rust,ignore
     /// b'x'
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CHAR_LIT_AS_U8,
     complexity,
     "casting a character literal to `u8` truncates"
     /// let _ = ptr.cast::<i32>();
     /// let _ = mut_ptr.cast::<i32>();
     /// ```
+    #[clippy::version = "1.51.0"]
     pub PTR_AS_PTR,
     pedantic,
     "casting using `as` from and to raw pointers that doesn't change its mutability, where `pointer::cast` could take the place of `as`"
index 842bbf006cca979da67bbec6f2e42280508edd67..ffe6340bd77a58efe1ecf0588c306139b400b722 100644 (file)
@@ -36,6 +36,7 @@
     /// i32::try_from(foo).is_ok()
     /// # ;
     /// ```
+    #[clippy::version = "1.37.0"]
     pub CHECKED_CONVERSIONS,
     pedantic,
     "`try_from` could replace manual bounds checking when casting"
index 1ccb8c5d880f441388349d77e7475006182f117a..84a2373efe15b0adadd14d9361d18638ad084545 100644 (file)
@@ -27,6 +27,7 @@
     ///
     /// ### Example
     /// No. You'll see it when you get the warning.
+    #[clippy::version = "1.35.0"]
     pub COGNITIVE_COMPLEXITY,
     nursery,
     "functions that should be split up into multiple functions"
index 4aa8798071568d1c01f2f6a95663007d98c885f6..f03f34e5a4b381e0fc238a252dcafb5d914bf2f4 100644 (file)
@@ -47,6 +47,7 @@
     ///     â€¦
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub COLLAPSIBLE_IF,
     style,
     "nested `if`s that can be collapsed (e.g., `if x { if y { ... } }`"
@@ -82,6 +83,7 @@
     ///     â€¦
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub COLLAPSIBLE_ELSE_IF,
     style,
     "nested `else`-`if` expressions that can be collapsed (e.g., `else { if x { ... } }`)"
index a4693fa213bc4a110470615ba12b9912754fe297..626f9971f01e7d678cbc69c22a00d09841109cf7 100644 (file)
@@ -41,6 +41,7 @@
     ///     };
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub COLLAPSIBLE_MATCH,
     style,
     "Nested `match` or `if let` expressions where the patterns may be \"collapsed\" together."
index 597a3c67024e547b74cb77911492d26aae6bf0e5..399d11472b09b2a6f49b8346c65a09cdb8368267 100644 (file)
@@ -49,6 +49,7 @@
     ///      }
     /// }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub COMPARISON_CHAIN,
     style,
     "`if`s that can be rewritten with `match` and `cmp`"
index f57da62da5f4b728abca063bfc6c70afb8ff5184..d07bc23235b0f37bdadf0811097775129c8e3802 100644 (file)
@@ -41,6 +41,7 @@
     ///     â€¦
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub IFS_SAME_COND,
     correctness,
     "consecutive `if`s with the same condition"
@@ -88,6 +89,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.41.0"]
     pub SAME_FUNCTIONS_IN_IF_CONDITION,
     pedantic,
     "consecutive `if`s with the same function call"
     ///     42
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub IF_SAME_THEN_ELSE,
     correctness,
     "`if` with the same `then` and `else` blocks"
     ///     42
     /// };
     /// ```
+    #[clippy::version = "1.53.0"]
     pub BRANCHES_SHARING_CODE,
     nursery,
     "`if` statement with shared code in all blocks"
index c2e9e8b3ab7f39d226f32df4449cfef0190cacbe..026683f6006246e040ee445bd8f910df5db5c38d 100644 (file)
@@ -28,6 +28,7 @@
     /// let a: Vec<_> = my_iterator.take(1).collect();
     /// let b: Vec<_> = my_iterator.collect();
     /// ```
+    #[clippy::version = "1.30.0"]
     pub COPY_ITERATOR,
     pedantic,
     "implementing `Iterator` on a `Copy` type"
index e4ee27724831d7e733ee52d2da5d4e42e71c9f1e..6bc4054a5abca5237a689d5d5c46ffa8e0c72b05 100644 (file)
@@ -23,6 +23,7 @@
     /// ```rust
     /// std::fs::create_dir_all("foo");
     /// ```
+    #[clippy::version = "1.48.0"]
     pub CREATE_DIR,
     restriction,
     "calling `std::fs::create_dir` instead of `std::fs::create_dir_all`"
index bab4a696f831ec859c986e74ffec7ec644c03343..1aae4c81c73c0b3e85da93aa9651fb3672fb45c5 100644 (file)
@@ -23,6 +23,7 @@
     /// // Good
     /// true
     /// ```
+    #[clippy::version = "1.34.0"]
     pub DBG_MACRO,
     restriction,
     "`dbg!` macro is intended as a debugging tool"
index 54647ba823e7e9b3763258d29c7f6a6b7a38c707..a0b137efe221a3bc8113a2936403bbce99f9b874 100644 (file)
@@ -29,6 +29,7 @@
     /// // Good
     /// let s = String::default();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DEFAULT_TRAIT_ACCESS,
     pedantic,
     "checks for literal calls to `Default::default()`"
@@ -62,6 +63,7 @@
     ///     .. Default::default()
     /// };
     /// ```
+    #[clippy::version = "1.49.0"]
     pub FIELD_REASSIGN_WITH_DEFAULT,
     style,
     "binding initialized with Default should have its fields set in the initializer"
index 3f1b7ea6214d4fb969bf3ccb412c46d2d713f367..3573ea5f02671becbce4b4f1ddd00559fe9c84c9 100644 (file)
@@ -46,6 +46,7 @@
     /// let i = 10i32;
     /// let f = 1.23f64;
     /// ```
+    #[clippy::version = "1.52.0"]
     pub DEFAULT_NUMERIC_FALLBACK,
     restriction,
     "usage of unconstrained numeric literals which may cause default numeric fallback."
index 975353add087f4bfaebed55d8db414877e44e0b0..bbaae94d3ddbe108ff5dd0a24b20d68f35937234 100644 (file)
@@ -34,6 +34,7 @@
     /// ```rust,ignore
     /// let _ = d.unwrap().deref();
     /// ```
+    #[clippy::version = "1.44.0"]
     pub EXPLICIT_DEREF_METHODS,
     pedantic,
     "Explicit use of deref or deref_mut method while not in a method chain."
index 01ec306e5e1898eb0ae7ae9ad1fecbc8a6a968a7..d0fab2b48fb074beba10b3e7b864d64eaab74549 100644 (file)
@@ -46,6 +46,7 @@
     /// has exactly equal bounds, and therefore this lint is disabled for types with
     /// generic parameters.
     ///
+    #[clippy::version = "1.57.0"]
     pub DERIVABLE_IMPLS,
     complexity,
     "manual implementation of the `Default` trait which is equal to a derive"
index 24ac5917dcb0521350e0072234bee02982e58f7a..4b232a26e5d0f69eae482e72c590ac0e2d834fb7 100644 (file)
@@ -38,6 +38,7 @@
     ///     ...
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DERIVE_HASH_XOR_EQ,
     correctness,
     "deriving `Hash` but implementing `PartialEq` explicitly"
@@ -88,6 +89,7 @@
     /// #[derive(Ord, PartialOrd, PartialEq, Eq)]
     /// struct Foo;
     /// ```
+    #[clippy::version = "1.47.0"]
     pub DERIVE_ORD_XOR_PARTIAL_ORD,
     correctness,
     "deriving `Ord` but implementing `PartialOrd` explicitly"
     ///     // ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXPL_IMPL_CLONE_ON_COPY,
     pedantic,
     "implementing `Clone` explicitly on `Copy` types"
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub UNSAFE_DERIVE_DESERIALIZE,
     pedantic,
     "deriving `serde::Deserialize` on a type that has methods using `unsafe`"
index 22d726cdcb7b6cda63ecf67592aaec7afef19e22..c2217353b323783214e7e86b199884d38c886163 100644 (file)
@@ -47,6 +47,7 @@
     /// let mut xs = Vec::new(); // Vec::new is _not_ disallowed in the config.
     /// xs.push(123); // Vec::push is _not_ disallowed in the config.
     /// ```
+    #[clippy::version = "1.49.0"]
     pub DISALLOWED_METHOD,
     nursery,
     "use of a disallowed method call"
index 6d38d30cd0bab5f63804b3509e373ffd1d0bc67c..3c3f3631849e58dc1b44a8da92edf70d84dff02d 100644 (file)
@@ -38,6 +38,7 @@
     /// let zähler = 10; // OK, it's still latin.
     /// let ã‚«ã‚¦ãƒ³ã‚¿ = 10; // Will spawn the lint.
     /// ```
+    #[clippy::version = "1.55.0"]
     pub DISALLOWED_SCRIPT_IDENTS,
     restriction,
     "usage of non-allowed Unicode scripts"
index 48f781516f4228c2aecdb5f738d76c47942772ff..7e784ca224499b733c7059346a61659dd5d34148 100644 (file)
@@ -42,6 +42,7 @@
     /// // A similar type that is allowed by the config
     /// use std::collections::HashMap;
     /// ```
+    #[clippy::version = "1.55.0"]
     pub DISALLOWED_TYPE,
     nursery,
     "use of a disallowed type"
index 87ad5178ff0887d8971b220844b528659a251b8f..249cf260309be5cb6f022a062b002e8c2e3c4e47 100644 (file)
@@ -67,6 +67,7 @@
     /// /// [SmallVec]: SmallVec
     /// fn main() {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DOC_MARKDOWN,
     pedantic,
     "presence of `_`, `::` or camel-case outside backticks in documentation"
     ///     unimplemented!();
     /// }
     /// ```
+    #[clippy::version = "1.39.0"]
     pub MISSING_SAFETY_DOC,
     style,
     "`pub unsafe fn` without `# Safety` docs"
     ///     unimplemented!();
     /// }
     /// ```
+    #[clippy::version = "1.41.0"]
     pub MISSING_ERRORS_DOC,
     pedantic,
     "`pub fn` returns `Result` without `# Errors` in doc comment"
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.52.0"]
     pub MISSING_PANICS_DOC,
     pedantic,
     "`pub fn` may panic without `# Panics` in doc comment"
     ///     unimplemented!();
     /// }
     /// ``````
+    #[clippy::version = "1.40.0"]
     pub NEEDLESS_DOCTEST_MAIN,
     style,
     "presence of `fn main() {` in code examples"
index 6520bb91fafd214d20f8d5b33a38574efe31c207..176092e5b28003da7671dc77cf1fc03bd40004d5 100644 (file)
@@ -31,6 +31,7 @@
     /// # let y = 2;
     /// if x <= y {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DOUBLE_COMPARISONS,
     complexity,
     "unnecessary double comparisons that can be simplified"
index d0d87b6df9a2d2f73d1f0ef83e6c8b02019bf753..e10f740d24a4193d4c141b7c1f1e96a12239353f 100644 (file)
@@ -32,6 +32,7 @@
     /// // Good
     /// foo(0);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DOUBLE_PARENS,
     complexity,
     "Warn on unnecessary double parentheses"
index 0f3dc866afb6e339d8ee8eb47223f59a12f7e7ec..a8f8e3d8a42c0bba557b0dc04fdbb9b2f9730a6b 100644 (file)
@@ -25,6 +25,7 @@
     /// // still locked
     /// operation_that_requires_mutex_to_be_unlocked();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DROP_REF,
     correctness,
     "calls to `std::mem::drop` with a reference instead of an owned value"
@@ -46,6 +47,7 @@
     /// let x = Box::new(1);
     /// std::mem::forget(&x) // Should have been forget(x), x will still be dropped
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FORGET_REF,
     correctness,
     "calls to `std::mem::forget` with a reference instead of an owned value"
@@ -67,6 +69,7 @@
     /// std::mem::drop(x) // A copy of x is passed to the function, leaving the
     ///                   // original unaffected
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DROP_COPY,
     correctness,
     "calls to `std::mem::drop` with a value that implements Copy"
@@ -94,6 +97,7 @@
     /// std::mem::forget(x) // A copy of x is passed to the function, leaving the
     ///                     // original unaffected
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FORGET_COPY,
     correctness,
     "calls to `std::mem::forget` with a value that implements Copy"
index 3774de625213deefd94ba4dc911677748df5d242..3070d105014f561ea5274b09c733af42b1f4bbad 100644 (file)
@@ -33,6 +33,7 @@
     /// let _micros = dur.subsec_micros();
     /// let _millis = dur.subsec_millis();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DURATION_SUBSEC,
     complexity,
     "checks for calculation of subsecond microseconds or milliseconds"
index b64246515f34f79fab343e868120c52060605f1e..92c56c762aad61624155680f632f127a5f1c683d 100644 (file)
@@ -40,6 +40,7 @@
     ///     // We don't care about zero.
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ELSE_IF_WITHOUT_ELSE,
     restriction,
     "`if` expression with an `else if`, but without a final `else` branch"
index 3453c2da2784fa646fd69b6cdadd106727a43ba9..af9e65e636135d8fb186f7390bb89d8047e46230 100644 (file)
@@ -34,6 +34,7 @@
     ///
     /// struct Test(!);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EMPTY_ENUM,
     pedantic,
     "enum with no variants"
index 57fd24bd4f04d81ca9263a905b84b258a100ae59..3d92eb16870e3d88c8d9460507d4b15cb20c4236 100644 (file)
@@ -54,6 +54,7 @@
     /// # let v = 1;
     /// map.entry(k).or_insert(v);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MAP_ENTRY,
     perf,
     "use of `contains_key` followed by `insert` on a `HashMap` or `BTreeMap`"
index a2c3c7a7b49208c07299ce023af744625e935fd9..3b6661c817be7677fe01941e096af0e4f786c1ac 100644 (file)
@@ -28,6 +28,7 @@
     ///     Y = 0,
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ENUM_CLIKE_UNPORTABLE_VARIANT,
     correctness,
     "C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`"
index 404b67c8f29f2817a9e6f58c3fc55d3b588075e4..fc3a35efaf84db0afa05bffedd3e8f92245a75ef 100644 (file)
@@ -34,6 +34,7 @@
     ///     Battenberg,
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ENUM_VARIANT_NAMES,
     style,
     "enums where all variants share a prefix/postfix"
@@ -59,6 +60,7 @@
     ///     struct BlackForest;
     /// }
     /// ```
+    #[clippy::version = "1.33.0"]
     pub MODULE_NAME_REPETITIONS,
     pedantic,
     "type names prefixed/postfixed with their containing module's name"
@@ -89,6 +91,7 @@
     ///     ...
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MODULE_INCEPTION,
     style,
     "modules that have the same name as their parent module"
index c034c849b55a09541ea324da1eb1b20617c2417b..101234605273393b13d7754d8ff28e0e1ee37725 100644 (file)
@@ -34,6 +34,7 @@
     /// # let b = 4;
     /// assert_eq!(a, a);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EQ_OP,
     correctness,
     "equal operands on both sides of a comparison or bitwise combination (e.g., `x == x`)"
@@ -59,6 +60,7 @@
     /// // Good
     /// x == *y
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OP_REF,
     style,
     "taking a reference to satisfy the type constraints on `==`"
index e8b1d6f6edaaaeb27b1a41daf89a9cd1e0580248..8905cc0de45779408368701d73cb92f5b80196d1 100644 (file)
@@ -32,6 +32,7 @@
     ///     do_thing();
     /// }
     /// ```
+    #[clippy::version = "1.57.0"]
     pub EQUATABLE_IF_LET,
     nursery,
     "using pattern matching instead of equality"
index d0944c37cf5f76b42948e55fe2e18070fc6681c4..d49cec26be5f02c6933c72e50227b5c8501b05ad 100644 (file)
@@ -21,6 +21,7 @@
     /// 0 * x;
     /// x & 0;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ERASING_OP,
     correctness,
     "using erasing operations, e.g., `x * 0` or `y & 0`"
index 75b1c882c233628ca4e4fd89f769dc1fc25b6e81..bc5d2f6278dee7e9c05fd58ce40fc0b80b7d16af 100644 (file)
@@ -41,6 +41,7 @@ pub struct BoxedLocal {
     /// foo(x);
     /// println!("{}", x);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BOXED_LOCAL,
     perf,
     "using `Box<T>` where unnecessary"
index 8def6529b3bc72e9f0d2c10d5d867d3ebafe7c63..5a4b424710440f03b947c4b03cabb337839df59d 100644 (file)
@@ -39,6 +39,7 @@
     /// ```
     /// where `foo(_)` is a plain function that takes the exact argument type of
     /// `x`.
+    #[clippy::version = "pre 1.29.0"]
     pub REDUNDANT_CLOSURE,
     style,
     "redundant closures, i.e., `|a| foo(a)` (which can be written as just `foo`)"
@@ -60,6 +61,7 @@
     /// ```rust,ignore
     /// Some('a').map(char::to_uppercase);
     /// ```
+    #[clippy::version = "1.35.0"]
     pub REDUNDANT_CLOSURE_FOR_METHOD_CALLS,
     pedantic,
     "redundant closures for method calls"
index 1b56dd4b081775c685de8a295d1ce6c715f02ed3..cdac9f3e6e1776949edb94d07a993b42f0d05c8a 100644 (file)
@@ -40,6 +40,7 @@
     /// };
     /// let a = tmp + x;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EVAL_ORDER_DEPENDENCE,
     suspicious,
     "whether a variable read occurs before a write depends on sub-expression evaluation order"
@@ -67,6 +68,7 @@
     /// let x = (a, b, c, panic!());
     /// // can simply be replaced by `panic!()`
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DIVERGING_SUB_EXPRESSION,
     complexity,
     "whether an expression contains a diverging sub expression"
index 06171702f75b0e015675d865b8126a07d42a463e..5435e15de7b4b182fd252d88330aadd3617846be 100644 (file)
@@ -37,6 +37,7 @@
     ///     Finished,
     /// }
     /// ```
+    #[clippy::version = "1.43.0"]
     pub STRUCT_EXCESSIVE_BOOLS,
     pedantic,
     "using too many bools in a struct"
@@ -75,6 +76,7 @@
     ///
     /// fn f(shape: Shape, temperature: Temperature) { ... }
     /// ```
+    #[clippy::version = "1.43.0"]
     pub FN_PARAMS_EXCESSIVE_BOOLS,
     pedantic,
     "using too many bools in function parameters"
index bb4684ce38b3d7eba4b74988aa8fe5cad9ddf05f..b0f50b5c144bbe45a6487cee425aa3501258169f 100644 (file)
@@ -31,6 +31,7 @@
     ///     Baz
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub EXHAUSTIVE_ENUMS,
     restriction,
     "detects exported enums that have not been marked #[non_exhaustive]"
@@ -60,6 +61,7 @@
     ///     baz: String,
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub EXHAUSTIVE_STRUCTS,
     restriction,
     "detects exported structs that have not been marked #[non_exhaustive]"
index 9cd5b2d9f4439e20fadd7785f102a53458c3aba5..d64cc61916c5eb4cf0bf00314253cc8b229d4b97 100644 (file)
@@ -18,6 +18,7 @@
     /// ```ignore
     /// std::process::exit(0)
     /// ```
+    #[clippy::version = "1.41.0"]
     pub EXIT,
     restriction,
     "`std::process::exit` is called, terminating the program"
index 4f46ef906f4098517137997f64068f5ccf9a13ba..6b327b9ce1720aeb1fbde29b499fb174f8a393e5 100644 (file)
@@ -23,6 +23,7 @@
     /// // this would be clearer as `eprintln!("foo: {:?}", bar);`
     /// writeln!(&mut std::io::stderr(), "foo: {:?}", bar).unwrap();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXPLICIT_WRITE,
     complexity,
     "using the `write!()` family of functions instead of the `print!()` family of functions, when using the latter would work"
index 70337f5bbeb04039250630821b04d7e1a2b1bfd0..05d300058cf4f270ca6e9713c40deb1bbe7b1e8a 100644 (file)
@@ -44,6 +44,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FALLIBLE_IMPL_FROM,
     nursery,
     "Warn on impls of `From<..>` that contain `panic!()` or `unwrap()`"
index f534327f7a0cda0bccafcbdca12c0205e5625956..dc6bef52ddd9fb3256168e3cec80fd9a2bfb0af1 100644 (file)
@@ -31,6 +31,7 @@
     /// ghi = []
     /// ```
     ///
+    #[clippy::version = "1.57.0"]
     pub REDUNDANT_FEATURE_NAMES,
     cargo,
     "usage of a redundant feature name"
@@ -60,6 +61,7 @@
     /// def = []
     ///
     /// ```
+    #[clippy::version = "1.57.0"]
     pub NEGATIVE_FEATURE_NAMES,
     cargo,
     "usage of a negative feature name"
index c33d80b8e8ef9aee958b93d3819a78829d3775d9..ca8886228de264a042c24c89e2f9688d4c15bb9f 100644 (file)
@@ -37,6 +37,7 @@
     ///     (a - b).abs() < f32::EPSILON
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub FLOAT_EQUALITY_WITHOUT_ABS,
     suspicious,
     "float equality check without `.abs()`"
index 1e8a5bd7d34453be68f0b322047f601ed1f789d6..d30dede833cbf50104651c2112b361d6ffbf5157 100644 (file)
@@ -27,6 +27,7 @@
     /// let v: f64 = 0.123_456_789_9;
     /// println!("{}", v); //  0.123_456_789_9
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXCESSIVE_PRECISION,
     style,
     "excessive precision for float literal"
@@ -50,6 +51,7 @@
     /// let _: f32 = 16_777_216.0;
     /// let _: f64 = 16_777_217.0;
     /// ```
+    #[clippy::version = "1.43.0"]
     pub LOSSY_FLOAT_LITERAL,
     restriction,
     "lossy whole number float literals"
index eda611117babf9c5561b09dd4b6bea8d94164b10..914723a48029cea67f125307419a25eda99b5344 100644 (file)
@@ -43,6 +43,7 @@
     /// let _ = a.ln_1p();
     /// let _ = a.exp_m1();
     /// ```
+    #[clippy::version = "1.43.0"]
     pub IMPRECISE_FLOPS,
     nursery,
     "usage of imprecise floating point operations"
     /// let _ = a.abs();
     /// let _ = -a.abs();
     /// ```
+    #[clippy::version = "1.43.0"]
     pub SUBOPTIMAL_FLOPS,
     nursery,
     "usage of sub-optimal floating point operations"
index 7169ac9ad6c5a50ce98062c8d1dcdaa465adea46..3f043e5f2f1c55be2ec3b1833297bfb76e8d547b 100644 (file)
@@ -33,6 +33,7 @@
     /// // Good
     /// foo.to_owned();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USELESS_FORMAT,
     complexity,
     "useless use of `format!`"
index bb30accf145429d9208c06b7a420bd9f11c1d11b..f0e1a67dcddb93d852d21eeae72b812be8280dbe 100644 (file)
@@ -31,6 +31,7 @@
     /// # use std::panic::Location;
     /// println!("error: something failed at {}", Location::caller());
     /// ```
+    #[clippy::version = "1.58.0"]
     pub FORMAT_IN_FORMAT_ARGS,
     perf,
     "`format!` used in a macro that does formatting"
@@ -56,6 +57,7 @@
     /// # use std::panic::Location;
     /// println!("error: something failed at {}", Location::caller());
     /// ```
+    #[clippy::version = "1.58.0"]
     pub TO_STRING_IN_FORMAT_ARGS,
     perf,
     "`to_string` applied to a type that implements `Display` in format args"
index b4f186525c562ea4cd33c4dcdcf9bddd08ed1d92..3e85c8a9c8071a91bc65f45dbc847207e743e1ff 100644 (file)
@@ -21,6 +21,7 @@
     /// ```rust,ignore
     /// a =- 42; // confusing, should it be `a -= 42` or `a = -42`?
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SUSPICIOUS_ASSIGNMENT_FORMATTING,
     suspicious,
     "suspicious formatting of `*=`, `-=` or `!=`"
@@ -43,6 +44,7 @@
     /// if foo &&! bar { // this should be `foo && !bar` but looks like a different operator
     /// }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub SUSPICIOUS_UNARY_OP_FORMATTING,
     suspicious,
     "suspicious formatting of unary `-` or `!` on the RHS of a BinOp"
@@ -79,6 +81,7 @@
     /// if bar { // this is the `else` block of the previous `if`, but should it be?
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SUSPICIOUS_ELSE_FORMATTING,
     suspicious,
     "suspicious formatting of `else`"
     ///     -4, -5, -6
     /// ];
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub POSSIBLE_MISSING_COMMA,
     correctness,
     "possible missing comma in array"
index 347c6eb12cbcecb1715760ac65f77f7c7adff93f..866ff216f84a21df3dc04355760f8d8e4a11e40b 100644 (file)
@@ -34,6 +34,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub FROM_OVER_INTO,
     style,
     "Warns on implementations of `Into<..>` to use `From<..>`"
index 98ce3db025caa015b4b42e1f7556d3570b0348d6..73e800073b03fe6c0f0e6d93ceef01a834f0dd61 100644 (file)
@@ -35,6 +35,7 @@
     /// let input: &str = get_input();
     /// let num: u16 = input.parse()?;
     /// ```
+    #[clippy::version = "1.52.0"]
     pub FROM_STR_RADIX_10,
     style,
     "from_str_radix with radix 10"
index d7c5ec9ba355bdf4bcc4118bc518554718afd4cf..ad031cbc09d4d0f631b4fcf87df345aa97924985 100644 (file)
@@ -26,6 +26,7 @@
     ///     // ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TOO_MANY_ARGUMENTS,
     complexity,
     "functions with too many arguments"
@@ -49,6 +50,7 @@
     ///     println!("");
     /// }
     /// ```
+    #[clippy::version = "1.34.0"]
     pub TOO_MANY_LINES,
     pedantic,
     "functions with too many lines"
@@ -84,6 +86,7 @@
     ///     println!("{}", unsafe { *x });
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NOT_UNSAFE_PTR_ARG_DEREF,
     correctness,
     "public functions dereferencing raw pointer arguments but not marked `unsafe`"
     /// #[must_use]
     /// fn useless() { }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub MUST_USE_UNIT,
     style,
     "`#[must_use]` attribute on a unit-returning function / method"
     ///     unimplemented!();
     /// }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub DOUBLE_MUST_USE,
     style,
     "`#[must_use]` attribute on a `#[must_use]`-returning function / method"
     /// // this could be annotated with `#[must_use]`.
     /// fn id<T>(t: T) -> T { t }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub MUST_USE_CANDIDATE,
     pedantic,
     "function or method that could take a `#[must_use]` attribute"
     ///
     /// Note that there are crates that simplify creating the error type, e.g.
     /// [`thiserror`](https://docs.rs/thiserror).
+    #[clippy::version = "1.49.0"]
     pub RESULT_UNIT_ERR,
     style,
     "public function returning `Result` with an `Err` type of `()`"
index e18442515b8fc4ffaf10e5a2c6534e387fbc7551..03af498eae3c0f8f6e59dcee974d9387888ea689 100644 (file)
@@ -41,6 +41,7 @@
     /// ```rust
     /// async fn is_send(bytes: std::sync::Arc<[u8]>) {}
     /// ```
+    #[clippy::version = "1.44.0"]
     pub FUTURE_NOT_SEND,
     nursery,
     "public Futures must be Send"
index f3929b0f1e617fd0ad2740c889d81afc817d8da7..edca701869e0fc2eb89dd14574a9700957f414df 100644 (file)
@@ -39,6 +39,7 @@
     /// let x = vec![2, 3, 5];
     /// let last_element = x.last();
     /// ```
+    #[clippy::version = "1.37.0"]
     pub GET_LAST_WITH_LEN,
     complexity,
     "Using `x.get(x.len() - 1)` when `x.last()` is correct and simpler"
index 414f465c49414088113b36ee2eb09f45c72b9964..b4e7bbc767135474d1c33d5b3b601e4548a89ad0 100644 (file)
@@ -22,6 +22,7 @@
     /// # let x = 1;
     /// x / 1 + 0 * 1 - 0 | 0;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub IDENTITY_OP,
     complexity,
     "using identity operations, e.g., `x + 0` or `y / 1`"
index a4118bf54b68313617425862dbe87ed5aae80826..e20741d2407e63b21a09ff0b4d40b299dbedcd77 100644 (file)
@@ -36,6 +36,7 @@
     ///     use_locked(locked);
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub IF_LET_MUTEX,
     correctness,
     "locking a `Mutex` in an `if let` block can cause deadlocks"
index ac938156237bf8f090feb281558f6301b685e6b0..3d59b783337a441b3ca1151f19667fe0174b41b4 100644 (file)
@@ -39,6 +39,7 @@
     ///     a()
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub IF_NOT_ELSE,
     pedantic,
     "`if` branches that could be swapped so no negation operation is necessary on the condition"
index a2dac57454f2d3b7430d4127c70dec75b1952e64..d95f5d41071659055875aedaa24bc0106d87e67e 100644 (file)
@@ -36,6 +36,7 @@
     ///     42
     /// });
     /// ```
+    #[clippy::version = "1.53.0"]
     pub IF_THEN_SOME_ELSE_NONE,
     restriction,
     "Finds if-else that could be written using `bool::then`"
index 81eb51e6f7cee304c034b367544f32eaa0268846..6358228dd47f0e421cc06a7f1306655db868234f 100644 (file)
@@ -54,6 +54,7 @@
     ///
     /// pub fn foo<S: BuildHasher>(map: &mut HashMap<i32, i32, S>) { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub IMPLICIT_HASHER,
     pedantic,
     "missing generalization over different hashers"
index 6d7c71d4082f6e8ad06f599ddc8eee83c32906b3..07caeada80d003fa96f48474a741c22bacf121d0 100644 (file)
@@ -35,6 +35,7 @@
     ///     return x;
     /// }
     /// ```
+    #[clippy::version = "1.33.0"]
     pub IMPLICIT_RETURN,
     restriction,
     "use a return statement like `return expr` instead of an expression"
index ecbbbc5bc64d007463ff3e06184460ee511f0b0d..4088c54623d36a3dc4187589ada0bf02e4345053 100644 (file)
@@ -30,6 +30,7 @@
     /// // Good
     /// i = i.saturating_sub(1);
     /// ```
+    #[clippy::version = "1.44.0"]
     pub IMPLICIT_SATURATING_SUB,
     pedantic,
     "Perform saturating subtraction instead of implicitly checking lower bound of data type"
index 52c92b3b122943bd5fda0afa43bb494792ee08ec..1debdef9d86c7b077594bef9115ec3fbf70d8f9b 100644 (file)
@@ -55,6 +55,7 @@
     /// # let y = 2;
     /// Foo { x, y };
     /// ```
+    #[clippy::version = "1.52.0"]
     pub INCONSISTENT_STRUCT_CONSTRUCTOR,
     pedantic,
     "the order of the field init shorthand is inconsistent with the order in the struct definition"
index f52f090d3872e11ab873ada16b9a0621620d299e..9ead4bb27a5881eb3ab43d6def4481f658999b44 100644 (file)
@@ -33,6 +33,7 @@
     /// x[0];
     /// x[3];
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OUT_OF_BOUNDS_INDEXING,
     correctness,
     "out of bounds constant indexing"
@@ -85,6 +86,7 @@
     /// y.get(10..);
     /// y.get(..100);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INDEXING_SLICING,
     restriction,
     "indexing/slicing usage"
index 68c1fa35fcc4eb919de7512f654cede557cd0877..c7db47a552b2cef43093f7af8e4094b3b91025dc 100644 (file)
@@ -20,6 +20,7 @@
     ///
     /// iter::repeat(1_u8).collect::<Vec<_>>();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INFINITE_ITER,
     correctness,
     "infinite iteration"
@@ -42,6 +43,7 @@
     /// let infinite_iter = 0..;
     /// [0..].iter().zip(infinite_iter.take_while(|x| *x > 5));
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MAYBE_INFINITE_ITER,
     pedantic,
     "possible infinite iteration"
index bd0b29643095b53479502f29327e7a21c486ed52..254d3f8a4d0f901a672585236c66e19819d963a5 100644 (file)
@@ -36,6 +36,7 @@
     ///     fn other() {}
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MULTIPLE_INHERENT_IMPL,
     restriction,
     "Multiple inherent impl that could be grouped"
index 61dd0eb4af7ed37d7239f2b334bbed4712a7edf8..60d234cd6f08f19fcb904f3b68df5a5ccab418b1 100644 (file)
@@ -41,6 +41,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.38.0"]
     pub INHERENT_TO_STRING,
     style,
     "type implements inherent method `to_string()`, but should instead implement the `Display` trait"
@@ -88,6 +89,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.38.0"]
     pub INHERENT_TO_STRING_SHADOW_DISPLAY,
     correctness,
     "type implements inherent method `to_string()`, which gets shadowed by the implementation of the `Display` trait"
index 3e3df903f17cf27156b1bdf2a9d8ce46c39ddc74..df69d3dcc51603fa18e14d8177667c359f3c179a 100644 (file)
@@ -24,6 +24,7 @@
     ///     fn name(&self) -> &'static str;
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INLINE_FN_WITHOUT_BODY,
     correctness,
     "use of `#[inline]` on trait methods without bodies"
index 6850e0c34767cb0864a002b5ce498c3cc157c5a8..3716d36ad88168a2fb7eb84f1a02484981c3d341 100644 (file)
@@ -28,6 +28,7 @@
     /// # let y = 1;
     /// if x > y {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INT_PLUS_ONE,
     complexity,
     "instead of using `x >= y + 1`, use `x > y`"
index c962e814fa5c2eb33af2e3d110857afe409f3bea..fa78620567880e64488c3d613240e07313907339 100644 (file)
@@ -23,6 +23,7 @@
     /// let x = 3f32 / 2f32;
     /// println!("{}", x);
     /// ```
+    #[clippy::version = "1.37.0"]
     pub INTEGER_DIVISION,
     restriction,
     "integer division may cause loss of precision"
index 82438d85c7a3a353128134b0736e587c4dc9d5f1..36e03e50a8e4f4c2c950bb297f88b8d374524f6d 100644 (file)
@@ -30,6 +30,7 @@
     /// let x: u8 = 1;
     /// (x as u32) > 300;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INVALID_UPCAST_COMPARISONS,
     pedantic,
     "a comparison involving an upcast which is always true or false"
index 3736d237642fb61d30b3ddadbb8148fabd2d3ca5..b118d3c8b8727242427c85d4383eb381458e3ddb 100644 (file)
@@ -45,6 +45,7 @@
     ///     foo(); // prints "foo"
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ITEMS_AFTER_STATEMENTS,
     pedantic,
     "blocks where an item comes after a statement"
index 6c779348ca28a4f5e6484392c033350f31188747..968bbc524b2514080059f90daa9b04bb3a61d0b9 100644 (file)
@@ -32,6 +32,7 @@
     ///    }
     /// }
     /// ```
+    #[clippy::version = "1.57.0"]
     pub ITER_NOT_RETURNING_ITERATOR,
     pedantic,
     "methods named `iter` or `iter_mut` that do not return an `Iterator`"
index fe6814e35d0ca1da4475f6428eb0c3fcd8186ec9..80260e4cd8315f3c42738bdd19cd0afccd2b1c1c 100644 (file)
@@ -27,6 +27,7 @@
     /// // Good
     /// pub static a = [0u32; 1_000_000];
     /// ```
+    #[clippy::version = "1.44.0"]
     pub LARGE_CONST_ARRAYS,
     perf,
     "large non-scalar const array may cause performance overhead"
index 392166237be50eb8fd785afd57902d58c0874c24..0191713f60d3f599f773303b61dfa3331c1170ae 100644 (file)
@@ -40,6 +40,7 @@
     ///     B(Box<[i32; 8000]>),
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LARGE_ENUM_VARIANT,
     perf,
     "large size difference between variants on an enum"
index bbb6c1f902ce077e7fcfc6f168021f71fb356cde..1cc2c28c04ad4dfb0c351091ec550ed753cb0826 100644 (file)
@@ -19,6 +19,7 @@
     /// ```rust,ignore
     /// let a = [0u32; 1_000_000];
     /// ```
+    #[clippy::version = "1.41.0"]
     pub LARGE_STACK_ARRAYS,
     pedantic,
     "allocating large arrays on stack may cause stack overflow"
index f336fb9d42f88be86071b100ee85a83e0f6c44f7..09cd0d22d8b0fb3eb45da2f41aa21f28eb3e85c2 100644 (file)
@@ -46,6 +46,7 @@
     ///     ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LEN_ZERO,
     style,
     "checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` could be used instead"
@@ -71,6 +72,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LEN_WITHOUT_IS_EMPTY,
     style,
     "traits or impls with a public `len` method but no corresponding `is_empty` method"
     ///     ..
     /// }
     /// ```
+    #[clippy::version = "1.49.0"]
     pub COMPARISON_TO_EMPTY,
     style,
     "checking `x == \"\"` or `x == []` (or similar) when `.is_empty()` could be used instead"
index 7f2c7b707f0b1290968371fbb65e45b4dd32b86d..db09d00d7303f3e80cdd876be081a7ac664c2b29 100644 (file)
@@ -48,6 +48,7 @@
     ///     None
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USELESS_LET_IF_SEQ,
     nursery,
     "unidiomatic `let mut` declaration followed by initialization in `if`"
index 9efd7aba7e83bccf09af6aea4f86da86285eeeda..557051fb8d2dc2565ddd1efaae12cd355f32e754 100644 (file)
@@ -26,6 +26,7 @@
     /// // is_ok() is marked #[must_use]
     /// let _ = f().is_ok();
     /// ```
+    #[clippy::version = "1.42.0"]
     pub LET_UNDERSCORE_MUST_USE,
     restriction,
     "non-binding let on a `#[must_use]` expression"
@@ -53,6 +54,7 @@
     /// ```rust,ignore
     /// let _lock = mutex.lock();
     /// ```
+    #[clippy::version = "1.43.0"]
     pub LET_UNDERSCORE_LOCK,
     correctness,
     "non-binding let on a synchronization lock"
@@ -94,6 +96,7 @@
     ///     // dropped at end of scope
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub LET_UNDERSCORE_DROP,
     pedantic,
     "non-binding let on a type that implements `Drop`"
index 6565d5a6d70384780fddb0617b3f927d01bb9287..fad3343d128510aca02466f18960f65a251932b2 100644 (file)
@@ -45,6 +45,7 @@
     ///     x
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_LIFETIMES,
     complexity,
     "using explicit lifetimes for references in function arguments when elision rules \
@@ -73,6 +74,7 @@
     ///     // ...
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXTRA_UNUSED_LIFETIMES,
     complexity,
     "unused lifetimes in function definitions"
index 0e36ab085a3696db60018097f723e78010387fa2..130543bbbee80ef229aa818188f9bab24e191c2f 100644 (file)
@@ -28,6 +28,7 @@
     /// // Good
     /// let x: u64 = 61_864_918_973_511;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNREADABLE_LITERAL,
     pedantic,
     "long literal without underscores"
@@ -53,6 +54,7 @@
     /// // Good
     /// 2_i32;
     /// ```
+    #[clippy::version = "1.30.0"]
     pub MISTYPED_LITERAL_SUFFIXES,
     correctness,
     "mistyped literal suffix"
@@ -75,6 +77,7 @@
     /// // Good
     /// let x: u64 = 61_864_918_973_511;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INCONSISTENT_DIGIT_GROUPING,
     style,
     "integer literals with digits grouped inconsistently"
@@ -93,6 +96,7 @@
     /// let x: u32 = 0xFFF_FFF;
     /// let y: u8 = 0b01_011_101;
     /// ```
+    #[clippy::version = "1.49.0"]
     pub UNUSUAL_BYTE_GROUPINGS,
     style,
     "binary or hex literals that aren't grouped by four"
     /// ```rust
     /// let x: u64 = 6186491_8973511;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LARGE_DIGIT_GROUPS,
     pedantic,
     "grouping digits into groups that are too large"
     /// `255` => `0xFF`
     /// `65_535` => `0xFFFF`
     /// `4_042_322_160` => `0xF0F0_F0F0`
+    #[clippy::version = "pre 1.29.0"]
     pub DECIMAL_LITERAL_REPRESENTATION,
     restriction,
     "using decimal representation when hexadecimal would be better"
index 5df1b79640164302d2a8532175486208942569e4..ccec648fa78dd1655a984a8d41f8e4fc32d56589 100644 (file)
@@ -47,6 +47,7 @@
     /// # let mut dst = vec![0; 65];
     /// dst[64..(src.len() + 64)].clone_from_slice(&src[..]);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MANUAL_MEMCPY,
     perf,
     "manually copying items between slices"
@@ -75,6 +76,7 @@
     ///     println!("{}", i);
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_RANGE_LOOP,
     style,
     "for-looping over a range of indices where an iterator over items would do"
     ///     // ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXPLICIT_ITER_LOOP,
     pedantic,
     "for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do"
     ///     // ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXPLICIT_INTO_ITER_LOOP,
     pedantic,
     "for-looping over `_.into_iter()` when `_` would do"
     ///     ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ITER_NEXT_LOOP,
     correctness,
     "for-looping over `_.next()` which is probably not intended"
     ///     // ..
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub FOR_LOOPS_OVER_FALLIBLES,
     suspicious,
     "for-looping over an `Option` or a `Result`, which is more clearly expressed as an `if let`"
     ///     // .. do something with x
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WHILE_LET_LOOP,
     complexity,
     "`loop { if let { ... } else break }`, which can be written as a `while let` loop"
     /// // should be
     /// let len = iterator.count();
     /// ```
+    #[clippy::version = "1.30.0"]
     pub NEEDLESS_COLLECT,
     perf,
     "collecting an iterator when collect is not needed"
     /// # fn bar(bar: usize, baz: usize) {}
     /// for (i, item) in v.iter().enumerate() { bar(i, *item); }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXPLICIT_COUNTER_LOOP,
     complexity,
     "for-looping with an explicit counter when `_.enumerate()` would do"
     /// ```no_run
     /// loop {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EMPTY_LOOP,
     suspicious,
     "empty `loop {}`, which should block or sleep"
     ///     ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WHILE_LET_ON_ITERATOR,
     style,
     "using a `while let` loop instead of a for loop on an iterator"
     ///     ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FOR_KV_MAP,
     style,
     "looping on a map using `iter` when `keys` or `values` would do"
     ///     break;
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEVER_LOOP,
     correctness,
     "any loop that will always `break` or `return`"
     ///     println!("{}", i); // prints numbers from 0 to 42, not 0 to 21
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MUT_RANGE_BOUND,
     suspicious,
     "for loop over a range where one of the bounds is a mutable variable"
     ///     println!("let me loop forever!");
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WHILE_IMMUTABLE_CONDITION,
     correctness,
     "variables used within while expression are not mutated in the body"
     /// let mut vec: Vec<u8> = vec![item1; 20];
     /// vec.resize(20 + 30, item2);
     /// ```
+    #[clippy::version = "1.47.0"]
     pub SAME_ITEM_PUSH,
     style,
     "the same item is pushed inside of a for loop"
     /// let item = &item1;
     /// println!("{}", item);
     /// ```
+    #[clippy::version = "1.49.0"]
     pub SINGLE_ELEMENT_LOOP,
     complexity,
     "there is no reason to have a single element loop"
     ///     println!("{}", n);
     /// }
     /// ```
+    #[clippy::version = "1.52.0"]
     pub MANUAL_FLATTEN,
     complexity,
     "for loops over `Option`s or `Result`s with a single expression can be simplified"
index bccdc3be5e93e1524ea8e19fbe9424e25558ed7b..262a26951c68110152da002292a89b57145c607c 100644 (file)
@@ -24,6 +24,7 @@
     /// #[macro_use]
     /// use some_macro;
     /// ```
+    #[clippy::version = "1.44.0"]
     pub MACRO_USE_IMPORTS,
     pedantic,
     "#[macro_use] is no longer needed"
index 23b3ba2296eaf1dedd01840553c754c9fe554c03..fad8fa467d4b80f23917e969d0a865fdde3a6906 100644 (file)
@@ -20,6 +20,7 @@
     ///     main();
     /// }
     /// ```
+    #[clippy::version = "1.38.0"]
     pub MAIN_RECURSION,
     style,
     "recursion using the entrypoint"
index e55aa3f1850fe06a8a6f17b920e6fdcae763267c..ed3166086f7ee05721b5c9e60b7d1109a0850fda 100644 (file)
@@ -26,6 +26,7 @@
     /// let sad_people: Vec<&str> = vec![];
     /// assert!(sad_people.is_empty(), "there are sad people: {:?}", sad_people);
     /// ```
+    #[clippy::version = "1.57.0"]
     pub MANUAL_ASSERT,
     pedantic,
     "`panic!` and only a `panic!` in `if`-then statement"
index b632af455f85545cae35806400df06686c9c9ba9..86819752f90ffe1753eaa2baa4d681f569bf9046 100644 (file)
@@ -30,6 +30,7 @@
     /// ```rust
     /// async fn foo() -> i32 { 42 }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub MANUAL_ASYNC_FN,
     style,
     "manual implementations of `async` functions can be simplified using the dedicated syntax"
index 96df3d0a490fa9ce44f7b58199e77f259d2ed8f2..cf5dabd94620587adb4b11f8a26840b115331aca 100644 (file)
@@ -36,6 +36,7 @@
     /// ```rust
     /// Some(0).map(|x| x + 1);
     /// ```
+    #[clippy::version = "1.52.0"]
     pub MANUAL_MAP,
     style,
     "reimplementation of `map`"
index 335ea001ee476e144a7aa1f5206bb3368f41d796..63a72d4fddeb0b4d30a74d0b394fdde062c509b1 100644 (file)
@@ -52,6 +52,7 @@
     /// #[non_exhaustive]
     /// struct T(pub i32, pub i32);
     /// ```
+    #[clippy::version = "1.45.0"]
     pub MANUAL_NON_EXHAUSTIVE,
     style,
     "manual implementations of the non-exhaustive pattern can be simplified using #[non_exhaustive]"
index cf641d0ce8625765eb398467fa148fddf524a83a..b60e2dc366b416e455ea5fe04ea2a38845f22d89 100644 (file)
@@ -32,6 +32,7 @@
     /// let foo: Option<i32> = None;
     /// foo.ok_or("error");
     /// ```
+    #[clippy::version = "1.49.0"]
     pub MANUAL_OK_OR,
     pedantic,
     "finds patterns that can be encoded more concisely with `Option::ok_or`"
index 4e040508b6bfbdc396c233c1df3222add7802ca1..f8e28f1671f07cc66b26a6f0dd74570d38595d95 100644 (file)
@@ -42,6 +42,7 @@
     ///     assert_eq!(end.to_uppercase(), "WORLD!");
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub MANUAL_STRIP,
     complexity,
     "suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing"
index 42478e3416ece7a2549529503c03943b25fbaadf..aac3c6e0de2bb6b12f2bb0f65f3e7de60a9148f7 100644 (file)
@@ -35,6 +35,7 @@
     /// let foo: Option<i32> = None;
     /// foo.unwrap_or(1);
     /// ```
+    #[clippy::version = "1.49.0"]
     pub MANUAL_UNWRAP_OR,
     complexity,
     "finds patterns that can be encoded more concisely with `Option::unwrap_or` or `Result::unwrap_or`"
index 7db5c7e52ea4565def25026273b4d7e1283b3777..c2b78e21861d7d38b09eb4cf4e12254c58a0ce6d 100644 (file)
@@ -37,6 +37,7 @@
     /// let y = x.iter();
     /// let z = y.cloned();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MAP_CLONE,
     style,
     "using `iterator.map(|x| x.clone())`, or dereferencing closures for `Copy` types"
index 82d3732326ebbf63fa68a171f898cdc37a7d805e..61f21d532c5016ffc3b09a6f7b4705f291c4ab7f 100644 (file)
@@ -97,6 +97,7 @@
     ///         })
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub MAP_ERR_IGNORE,
     restriction,
     "`map_err` should not ignore the original error"
index 40de9ffcd4e253d2c26ef7cc997e0969ec200bc7..a84de3e079b3918b9c0bb98d91f84d2862278e46 100644 (file)
@@ -47,6 +47,7 @@
     ///     log_err_msg(format_msg(msg));
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OPTION_MAP_UNIT_FN,
     complexity,
     "using `option.map(f)`, where `f` is a function or closure that returns `()`"
@@ -87,6 +88,7 @@
     ///     log_err_msg(format_msg(msg));
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub RESULT_MAP_UNIT_FN,
     complexity,
     "using `result.map(f)`, where `f` is a function or closure that returns `()`"
index 552c9a588977fc564d0a409a568839d50d299a56..583b577ffe25d51ea72332b2e130b77c07b7ba20 100644 (file)
@@ -40,6 +40,7 @@
     ///     _ => {},
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub MATCH_ON_VEC_ITEMS,
     pedantic,
     "matching on vector elements can panic"
index ecf6ad316a46124a121e0be7de6264ace3ed1098..b1839f00aaee95d1922eea1eaf9c68e3c9a584c2 100644 (file)
@@ -38,6 +38,7 @@
     ///        vec.push(value)
     /// }
     /// ```
+    #[clippy::version = "1.57.0"]
     pub MATCH_RESULT_OK,
     style,
     "usage of `ok()` in `let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead"
index f501593c5187e36e99b823f0a1a6919df425bc86..3316ebf405109591fdcd3270f26b5639887f71aa 100644 (file)
@@ -39,6 +39,7 @@
     ///     _ => {},
     /// }
     /// ```
+    #[clippy::version = "1.58.0"]
     pub MATCH_STR_CASE_MISMATCH,
     correctness,
     "creation of a case altering match expression with non-compliant arms"
index e4e533fa71a5134511391a8a986361376c87b912..74765a1a1de627994eb5b84cd70378f307c853b2 100644 (file)
@@ -57,6 +57,7 @@
     ///     bar(foo);
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SINGLE_MATCH,
     style,
     "a `match` statement with a single nontrivial arm (i.e., where the other arm is `_ => {}`) instead of `if let`"
@@ -98,6 +99,7 @@
     ///     bar(&other_ref);
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SINGLE_MATCH_ELSE,
     pedantic,
     "a `match` statement with two arms where the second arm's pattern is a placeholder instead of a specific match pattern"
     ///     _ => frob(x),
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MATCH_REF_PATS,
     style,
     "a `match` or `if let` with all arms prefixed with `&` instead of deref-ing the match expression"
     ///     bar();
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MATCH_BOOL,
     pedantic,
     "a `match` on a boolean expression instead of an `if..else` block"
     ///     _ => (),
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MATCH_OVERLAPPING_ARM,
     style,
     "a `match` with overlapping arms"
     ///     Err(_) => panic!("err"),
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MATCH_WILD_ERR_ARM,
     pedantic,
     "a `match` with `Err(_)` arm and take drastic actions"
     /// // Good
     /// let r: Option<&()> = x.as_ref();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MATCH_AS_REF,
     complexity,
     "a `match` on an Option value instead of using `as_ref()` or `as_mut`"
     ///     Foo::B(_) => {},
     /// }
     /// ```
+    #[clippy::version = "1.34.0"]
     pub WILDCARD_ENUM_MATCH_ARM,
     restriction,
     "a wildcard enum match arm using `_`"
     ///     Foo::C => {},
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
     pedantic,
     "a wildcard enum match for a single variant"
     ///     _ => {},
     /// }
     /// ```
+    #[clippy::version = "1.42.0"]
     pub WILDCARD_IN_OR_PATTERNS,
     complexity,
     "a wildcard pattern used with others patterns in same match arm"
     /// let wrapper = Wrapper::Data(42);
     /// let Wrapper::Data(data) = wrapper;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INFALLIBLE_DESTRUCTURING_MATCH,
     style,
     "a `match` statement with a single infallible arm instead of a `let`"
     /// // Good
     /// let (c, d) = (a, b);
     /// ```
+    #[clippy::version = "1.43.0"]
     pub MATCH_SINGLE_BINDING,
     complexity,
     "a match with a single binding instead of using `let` statement"
     ///     _ => {},
     /// }
     /// ```
+    #[clippy::version = "1.43.0"]
     pub REST_PAT_IN_FULLY_BOUND_STRUCTS,
     restriction,
     "a match on a struct that binds all fields but still uses the wildcard pattern"
     /// if IpAddr::V6(Ipv6Addr::LOCALHOST).is_ipv6() {}
     /// Ok::<i32, i32>(42).is_ok();
     /// ```
+    #[clippy::version = "1.31.0"]
     pub REDUNDANT_PATTERN_MATCHING,
     style,
     "use the proper utility function avoiding an `if let`"
     /// // Good
     /// let a = matches!(x, Some(0));
     /// ```
+    #[clippy::version = "1.47.0"]
     pub MATCH_LIKE_MATCHES_MACRO,
     style,
     "a match that could be written with the matches! macro"
     ///     Quz => quz(),
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MATCH_SAME_ARMS,
     pedantic,
     "`match` with identical arm bodies"
index eb437dc47afb496e63b0bfc37e28a3d209a29f7d..5ffcfd4d2641709c5fa7fd0f8f2fd824e2c5cd24 100644 (file)
@@ -19,6 +19,7 @@
     /// # use std::rc::Rc;
     /// mem::forget(Rc::new(55))
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MEM_FORGET,
     restriction,
     "`mem::forget` usage on `Drop` types, likely to cause memory leaks"
index cf721fc65db855d7c763dcea8961ce3ea42b4a12..7fc39f17232fd41050e000e3eead23503d34bea9 100644 (file)
@@ -35,6 +35,7 @@
     /// let mut an_option = Some(0);
     /// let taken = an_option.take();
     /// ```
+    #[clippy::version = "1.31.0"]
     pub MEM_REPLACE_OPTION_WITH_NONE,
     style,
     "replacing an `Option` with `None` instead of `take()`"
@@ -66,6 +67,7 @@
     /// The [take_mut](https://docs.rs/take_mut) crate offers a sound solution,
     /// at the cost of either lazily creating a replacement value or aborting
     /// on panic, to ensure that the uninitialized value cannot be observed.
+    #[clippy::version = "1.39.0"]
     pub MEM_REPLACE_WITH_UNINIT,
     correctness,
     "`mem::replace(&mut _, mem::uninitialized())` or `mem::replace(&mut _, mem::zeroed())`"
@@ -90,6 +92,7 @@
     /// let mut text = String::from("foo");
     /// let taken = std::mem::take(&mut text);
     /// ```
+    #[clippy::version = "1.42.0"]
     pub MEM_REPLACE_WITH_DEFAULT,
     style,
     "replacing a value of type `T` with `T::default()` instead of using `std::mem::take`"
index 6c4272f9e654adaeba3e3b4cb234cf7d1e941ad0..5cb849a56bc6a4c85190a3b48ce5c9195a5fdef5 100644 (file)
@@ -99,6 +99,7 @@
     /// ```rust
     /// [1, 2, 3].iter().copied();
     /// ```
+    #[clippy::version = "1.53.0"]
     pub CLONED_INSTEAD_OF_COPIED,
     pedantic,
     "used `cloned` where `copied` could be used instead"
     /// ```rust
     /// let nums: Vec<i32> = ["1", "2", "whee!"].iter().filter_map(|x| x.parse().ok()).collect();
     /// ```
+    #[clippy::version = "1.53.0"]
     pub FLAT_MAP_OPTION,
     pedantic,
     "used `flat_map` where `filter_map` could be used instead"
     /// // Good
     /// res.expect("more helpful message");
     /// ```
+    #[clippy::version = "1.45.0"]
     pub UNWRAP_USED,
     restriction,
     "using `.unwrap()` on `Result` or `Option`, which should at least get a better message using `expect()`"
     /// res?;
     /// # Ok::<(), ()>(())
     /// ```
+    #[clippy::version = "1.45.0"]
     pub EXPECT_USED,
     restriction,
     "using `.expect()` on `Result` or `Option`, which might be better handled"
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SHOULD_IMPLEMENT_TRAIT,
     style,
     "defining a method that should be implementing a std trait"
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WRONG_SELF_CONVENTION,
     style,
     "defining a method named with an established prefix (like \"into_\") that takes `self` with the wrong convention"
     /// // Good
     /// x.expect("why did I do this again?");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OK_EXPECT,
     style,
     "using `ok().expect()`, which gives worse error messages than calling `expect` directly on the Result"
     /// // Good
     /// x.unwrap_or_default();
     /// ```
+    #[clippy::version = "1.56.0"]
     pub UNWRAP_OR_ELSE_DEFAULT,
     style,
     "using `.unwrap_or_else(Default::default)`, which is more succinctly expressed as `.unwrap_or_default()`"
     /// // Good
     /// x.map_or_else(some_function, |a| a + 1);
     /// ```
+    #[clippy::version = "1.45.0"]
     pub MAP_UNWRAP_OR,
     pedantic,
     "using `.map(f).unwrap_or(a)` or `.map(f).unwrap_or_else(func)`, which are more succinctly expressed as `map_or(a, f)` or `map_or_else(a, f)`"
     /// // Good
     /// opt.and_then(|a| Some(a + 1));
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OPTION_MAP_OR_NONE,
     style,
     "using `Option.map_or(None, f)`, which is more succinctly expressed as `and_then(f)`"
     /// # let r: Result<u32, &str> = Ok(1);
     /// assert_eq!(Some(1), r.ok());
     /// ```
+    #[clippy::version = "1.44.0"]
     pub RESULT_MAP_OR_INTO_OPTION,
     style,
     "using `Result.map_or(None, Some)`, which is more succinctly expressed as `ok()`"
     /// let _ = res().map(|s| if s.len() == 42 { 10 } else { 20 });
     /// let _ = res().map_err(|s| if s.len() == 42 { 10 } else { 20 });
     /// ```
+    #[clippy::version = "1.45.0"]
     pub BIND_INSTEAD_OF_MAP,
     complexity,
     "using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`"
     /// # let vec = vec![1];
     /// vec.iter().find(|x| **x == 0);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FILTER_NEXT,
     complexity,
     "using `filter(p).next()`, which is more succinctly expressed as `.find(p)`"
     /// # let vec = vec![1];
     /// vec.iter().find(|x| **x != 0);
     /// ```
+    #[clippy::version = "1.42.0"]
     pub SKIP_WHILE_NEXT,
     complexity,
     "using `skip_while(p).next()`, which is more succinctly expressed as `.find(!p)`"
     /// // Good
     /// vec.iter().flat_map(|x| x.iter());
     /// ```
+    #[clippy::version = "1.31.0"]
     pub MAP_FLATTEN,
     pedantic,
     "using combinations of `flatten` and `map` which can usually be written as a single method call"
     /// ```rust
     /// (0_i32..10).filter_map(|n| n.checked_add(1));
     /// ```
+    #[clippy::version = "1.51.0"]
     pub MANUAL_FILTER_MAP,
     complexity,
     "using `_.filter(_).map(_)` in a way that can be written more simply as `filter_map(_)`"
     /// ```rust
     /// (0_i32..10).find_map(|n| n.checked_add(1));
     /// ```
+    #[clippy::version = "1.51.0"]
     pub MANUAL_FIND_MAP,
     complexity,
     "using `_.find(_).map(_)` in a way that can be written more simply as `find_map(_)`"
     /// ```rust
     ///  (0..3).find_map(|x| if x == 2 { Some(x) } else { None });
     /// ```
+    #[clippy::version = "1.36.0"]
     pub FILTER_MAP_NEXT,
     pedantic,
     "using combination of `filter_map` and `next` which can usually be written as a single method call"
     /// # let iter = vec![vec![0]].into_iter();
     /// iter.flatten();
     /// ```
+    #[clippy::version = "1.39.0"]
     pub FLAT_MAP_IDENTITY,
     complexity,
     "call to `flat_map` where `flatten` is sufficient"
     ///
     /// let _ = !"hello world".contains("world");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SEARCH_IS_SOME,
     complexity,
     "using an iterator or string search followed by `is_some()` or `is_none()`, which is more succinctly expressed as a call to `any()` or `contains()` (with negation in case of `is_none()`)"
     /// let name = "foo";
     /// if name.starts_with('_') {};
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CHARS_NEXT_CMP,
     style,
     "using `.chars().next()` to check if a string starts with a char"
     /// # let foo = Some(String::new());
     /// foo.unwrap_or_default();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OR_FUN_CALL,
     perf,
     "using any `*or` method with a function call, which suggests `*or_else`"
     /// # let err_msg = "I'm a teapot";
     /// foo.unwrap_or_else(|| panic!("Err {}: {}", err_code, err_msg));
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub EXPECT_FUN_CALL,
     perf,
     "using any `expect` method with a function call"
     /// ```rust
     /// 42u64.clone();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CLONE_ON_COPY,
     complexity,
     "using `clone` on a `Copy` type"
     /// // Good
     /// Rc::clone(&x);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CLONE_ON_REF_PTR,
     restriction,
     "using 'clone' on a ref-counted pointer"
     ///     println!("{:p} {:p}", *y, z); // prints out the same pointer
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CLONE_DOUBLE_REF,
     correctness,
     "using `clone` on `&&T`"
     /// // OK, the specialized impl is used
     /// ["foo", "bar"].iter().map(|&s| s.to_string());
     /// ```
+    #[clippy::version = "1.40.0"]
     pub INEFFICIENT_TO_STRING,
     pedantic,
     "using `to_string` on `&&T` where `T: ToString`"
     ///     fn new() -> Self;
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEW_RET_NO_SELF,
     style,
     "not returning type containing `Self` in a `new` method"
     ///
     /// // Good
     /// _.split('x');
+    #[clippy::version = "pre 1.29.0"]
     pub SINGLE_CHAR_PATTERN,
     perf,
     "using a single-character str where a char could be used, e.g., `_.split(\"x\")`"
     ///     //..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ITERATOR_STEP_BY_ZERO,
     correctness,
     "using `Iterator::step_by(0)`, which will panic at runtime"
     /// ```rust
     /// let _ = std::iter::empty::<Option<i32>>().flatten();
     /// ```
+    #[clippy::version = "1.53.0"]
     pub OPTION_FILTER_MAP,
     complexity,
     "filtering `Option` for `Some` then force-unwrapping, which can be one type-safe operation"
     /// # s.insert(1);
     /// let x = s.iter().next();
     /// ```
+    #[clippy::version = "1.42.0"]
     pub ITER_NTH_ZERO,
     style,
     "replace `iter.nth(0)` with `iter.next()`"
     /// let bad_vec = some_vec.get(3);
     /// let bad_slice = &some_vec[..].get(3);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ITER_NTH,
     perf,
     "using `.iter().nth()` on a standard library type with O(1) element access"
     /// let bad_vec = some_vec.iter().nth(3);
     /// let bad_slice = &some_vec[..].iter().nth(3);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ITER_SKIP_NEXT,
     style,
     "using `.skip(x).next()` on an iterator"
     /// let last = some_vec[3];
     /// some_vec[0] = 1;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub GET_UNWRAP,
     restriction,
     "using `.get().unwrap()` or `.get_mut().unwrap()` when using `[]` would work instead"
     /// // Good
     /// a.append(&mut b);
     /// ```
+    #[clippy::version = "1.55.0"]
     pub EXTEND_WITH_DRAIN,
     perf,
     "using vec.append(&mut vec) to move the full range of a vecor to another"
     /// s.push_str(abc);
     /// s.push_str(&def);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub STRING_EXTEND_CHARS,
     style,
     "using `x.extend(s.chars())` where s is a `&str` or `String`"
     /// let s = [1, 2, 3, 4, 5];
     /// let s2: Vec<isize> = s.to_vec();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ITER_CLONED_COLLECT,
     style,
     "using `.cloned().collect()` on slice to create a `Vec`"
     /// // Good
     /// name.ends_with('_') || name.ends_with('-');
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CHARS_LAST_CMP,
     style,
     "using `.chars().last()` or `.chars().next_back()` to check if a string ends with a char"
     /// let x: &[i32] = &[1, 2, 3, 4, 5];
     /// do_stuff(x);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USELESS_ASREF,
     complexity,
     "using `as_ref` where the types before and after the call are the same"
     /// ```rust
     /// let _ = (0..3).any(|x| x > 2);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNNECESSARY_FOLD,
     style,
     "using `fold` when a more succinct alternative exists"
     /// // As there is no conditional check on the argument this could be written as:
     /// let _ = (0..4).map(|x| x + 1);
     /// ```
+    #[clippy::version = "1.31.0"]
     pub UNNECESSARY_FILTER_MAP,
     complexity,
     "using `filter_map` when a more succinct alternative exists"
     /// // Good
     /// let _ = (&vec![3, 4, 5]).iter();
     /// ```
+    #[clippy::version = "1.32.0"]
     pub INTO_ITER_ON_REF,
     style,
     "using `.into_iter()` on a reference"
     /// ```rust
     /// let _ = (0..3).map(|x| x + 2).count();
     /// ```
+    #[clippy::version = "1.39.0"]
     pub SUSPICIOUS_MAP,
     suspicious,
     "suspicious usage of map"
     ///     MaybeUninit::uninit().assume_init()
     /// };
     /// ```
+    #[clippy::version = "1.39.0"]
     pub UNINIT_ASSUMED_INIT,
     correctness,
     "`MaybeUninit::uninit().assume_init()`"
     /// let add = x.saturating_add(y);
     /// let sub = x.saturating_sub(y);
     /// ```
+    #[clippy::version = "1.39.0"]
     pub MANUAL_SATURATING_ARITHMETIC,
     style,
     "`.chcked_add/sub(x).unwrap_or(MAX/MIN)`"
     /// ```rust
     /// unsafe { (&() as *const ()).offset(1) };
     /// ```
+    #[clippy::version = "1.41.0"]
     pub ZST_OFFSET,
     correctness,
     "Check for offset calculations on raw pointers to zero-sized types"
     /// # Ok::<_, std::io::Error>(())
     /// # };
     /// ```
+    #[clippy::version = "1.42.0"]
     pub FILETYPE_IS_FILE,
     restriction,
     "`FileType::is_file` is not recommended to test for readable file type"
     /// opt.as_deref()
     /// # ;
     /// ```
+    #[clippy::version = "1.42.0"]
     pub OPTION_AS_REF_DEREF,
     complexity,
     "using `as_ref().map(Deref::deref)`, which is more succinctly expressed as `as_deref()`"
     /// a.get(2);
     /// b.get(0);
     /// ```
+    #[clippy::version = "1.46.0"]
     pub ITER_NEXT_SLICE,
     style,
     "using `.iter().next()` on a sliced array, which can be shortened to just `.get()`"
     /// string.insert(0, 'R');
     /// string.push('R');
     /// ```
+    #[clippy::version = "1.49.0"]
     pub SINGLE_CHAR_ADD_STR,
     style,
     "`push_str()` or `insert_str()` used with a single-character string literal as parameter"
     ///
     /// opt.unwrap_or(42);
     /// ```
+    #[clippy::version = "1.48.0"]
     pub UNNECESSARY_LAZY_EVALUATIONS,
     style,
     "using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation"
     /// ```rust
     /// (0..3).try_for_each(|t| Err(t));
     /// ```
+    #[clippy::version = "1.49.0"]
     pub MAP_COLLECT_RESULT_UNIT,
     style,
     "using `.map(_).collect::<Result<(),_>()`, which can be replaced with `try_for_each`"
     ///
     /// assert_eq!(v, vec![5, 5, 5, 5, 5]);
     /// ```
+    #[clippy::version = "1.49.0"]
     pub FROM_ITER_INSTEAD_OF_COLLECT,
     pedantic,
     "use `.collect()` instead of `::from_iter()`"
     ///     assert!(x >= 0);
     /// });
     /// ```
+    #[clippy::version = "1.51.0"]
     pub INSPECT_FOR_EACH,
     complexity,
     "using `.inspect().for_each()`, which can be replaced with `.for_each()`"
     /// # let iter = vec![Some(1)].into_iter();
     /// iter.flatten();
     /// ```
+    #[clippy::version = "1.52.0"]
     pub FILTER_MAP_IDENTITY,
     complexity,
     "call to `filter_map` where `flatten` is sufficient"
     /// let x = [1, 2, 3];
     /// let y: Vec<_> = x.iter().map(|x| 2*x).collect();
     /// ```
+    #[clippy::version = "1.52.0"]
     pub MAP_IDENTITY,
     complexity,
     "using iterator.map(|x| x)"
     /// // Good
     /// let _ = "Hello".as_bytes().get(3);
     /// ```
+    #[clippy::version = "1.52.0"]
     pub BYTES_NTH,
     style,
     "replace `.bytes().nth()` with `.as_bytes().get()`"
     /// let b = a.clone();
     /// let c = a.clone();
     /// ```
+    #[clippy::version = "1.52.0"]
     pub IMPLICIT_CLONE,
     pedantic,
     "implicitly cloning a value by invoking a function on its dereferenced type"
     /// let _ = some_vec.len();
     /// let _ = &some_vec[..].len();
     /// ```
+    #[clippy::version = "1.52.0"]
     pub ITER_COUNT,
     complexity,
     "replace `.iter().count()` with `.len()`"
     ///     // use x
     /// }
     /// ```
+    #[clippy::version = "1.54.0"]
     pub SUSPICIOUS_SPLITN,
     correctness,
     "checks for `.splitn(0, ..)` and `.splitn(1, ..)`"
     /// // Good
     /// let x: String = "x".repeat(10);
     /// ```
+    #[clippy::version = "1.54.0"]
     pub MANUAL_STR_REPEAT,
     perf,
     "manual implementation of `str::repeat`"
     /// let (key, value) = _.split_once('=')?;
     /// let value = _.split_once('=')?.1;
     /// ```
+    #[clippy::version = "1.57.0"]
     pub MANUAL_SPLIT_ONCE,
     complexity,
     "replace `.splitn(2, pat)` with `.split_once(pat)`"
index dc2dd45e4edb6c1c096b141458f4e5b7e51421d5..a6450aec4f7d46f4e108fbafa953058c741f17f8 100644 (file)
@@ -26,6 +26,7 @@
     /// ```
     /// It will always be equal to `0`. Probably the author meant to clamp the value
     /// between 0 and 100, but has erroneously swapped `min` and `max`.
+    #[clippy::version = "pre 1.29.0"]
     pub MIN_MAX,
     correctness,
     "`min(_, max(_, _))` (or vice versa) with bounds clamping the result to a constant"
index 0f32cd9164e2d7ecf874923a3a5d7a299b19365a..a93537104bfa182af03814c91d1b77a0c25cc658 100644 (file)
@@ -56,6 +56,7 @@
     ///     true
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TOPLEVEL_REF_ARG,
     style,
     "an entire binding declared as `ref`, in a function argument or a `let` statement"
@@ -79,6 +80,7 @@
     /// // Good
     /// if x.is_nan() { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CMP_NAN,
     correctness,
     "comparisons to `NAN`, which will always return false, probably not intended"
     /// if (y - 1.23f64).abs() < error_margin { }
     /// if (y - x).abs() > error_margin { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FLOAT_CMP,
     pedantic,
     "using `==` or `!=` on float values instead of comparing difference with an epsilon"
     /// # let y = String::from("foo");
     /// if x == y {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CMP_OWNED,
     perf,
     "creating owned instances for comparing with others, e.g., `x == \"foo\".to_string()`"
     /// let a = x % 1;
     /// let a = x % -1;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MODULO_ONE,
     correctness,
     "taking a number modulo +/-1, which can either panic/overflow or always returns 0"
     /// let y = _x + 1; // Here we are using `_x`, even though it has a leading
     ///                 // underscore. We should rename `_x` to `x`
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USED_UNDERSCORE_BINDING,
     pedantic,
     "using a binding which is prefixed with an underscore"
     /// ```rust,ignore
     /// f() && g(); // We should write `if f() { g(); }`.
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SHORT_CIRCUIT_STATEMENT,
     complexity,
     "using a short circuit boolean condition as a statement"
     /// // Good
     /// let a = std::ptr::null::<u32>();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ZERO_PTR,
     style,
     "using `0 as *{const, mut} T`"
     /// // let error_margin = std::f64::EPSILON;
     /// if (x - ONE).abs() < error_margin { }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub FLOAT_CMP_CONST,
     restriction,
     "using `==` or `!=` on float constants instead of comparing difference with an epsilon"
index 7c3f5f22ade0f9ba447d1dc583791b092f1abf80..4b56eaebaea1624c5894747560c31baeaaeb4f88 100644 (file)
@@ -46,6 +46,7 @@
     ///     Foo { .. } => {},
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNNEEDED_FIELD_PATTERN,
     restriction,
     "struct fields bound to a wildcard instead of using `..`"
@@ -67,6 +68,7 @@
     /// // Good
     /// fn bar(a: i32, _b: i32) {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DUPLICATE_UNDERSCORE_ARGUMENT,
     style,
     "function arguments having names which only differ by an underscore"
@@ -85,6 +87,7 @@
     /// let mut x = 3;
     /// --x;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DOUBLE_NEG,
     style,
     "`--x`, which is a double negation of `x` and not a pre-decrement as in C/C++"
     /// // Good
     /// let y = 0x1A9BACD;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MIXED_CASE_HEX_LITERALS,
     style,
     "hex literals whose letter digits are not consistently upper- or lowercased"
     /// // Good
     /// let y = 123832_i32;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNSEPARATED_LITERAL_SUFFIX,
     restriction,
     "literals whose suffix is not separated by an underscore"
     /// ```
     ///
     /// prints `83` (as `83 == 0o123` while `123 == 0o173`).
+    #[clippy::version = "pre 1.29.0"]
     pub ZERO_PREFIXED_LITERAL,
     complexity,
     "integer literals starting with `0`"
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BUILTIN_TYPE_SHADOW,
     style,
     "shadowing a builtin type"
     ///     y => (),
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub REDUNDANT_PATTERN,
     style,
     "using `name @ _` in a pattern"
     ///     _ => (),
     /// }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub UNNEEDED_WILDCARD_PATTERN,
     complexity,
     "tuple patterns with a wildcard pattern (`_`) is next to a rest pattern (`..`)"
index 5b2584d43a130db69977205c1af79ebeaea6621c..a8d410508563c72092cfaa587c014863353ba979 100644 (file)
@@ -63,6 +63,7 @@
     /// }
     /// # }
     /// ```
+    #[clippy::version = "1.34.0"]
     pub MISSING_CONST_FOR_FN,
     nursery,
     "Lint functions definitions that could be made `const fn`"
index 6920b4f72eaa11f55b607fbc2a40be3986bd9474..db6aab0671bd08d7a58a9a0a02675072d6d45c7e 100644 (file)
@@ -27,6 +27,7 @@
     /// allowed-by-default lint for
     /// public members, but has no way to enforce documentation of private items.
     /// This lint fixes that.
+    #[clippy::version = "pre 1.29.0"]
     pub MISSING_DOCS_IN_PRIVATE_ITEMS,
     restriction,
     "detects missing documentation for public and private members"
index 448bfc2fdd67c98f33fe60ca83399dfa35b79505..68d49e0f1503116b21341b0e248d0f5e5444b901 100644 (file)
@@ -33,6 +33,7 @@
     /// ```rust,ignore
     /// use serde_json::Value as JsonValue;
     /// ```
+    #[clippy::version = "1.55.0"]
     pub MISSING_ENFORCED_IMPORT_RENAMES,
     restriction,
     "enforce import renames"
index b593c747498e397b76ba9819b3d7388a87f41bd0..ac2f16b49e3f1cd3fc3bc560b8aac36d268735da 100644 (file)
@@ -52,6 +52,7 @@
     ///    fn def_bar() {} // missing #[inline]
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MISSING_INLINE_IN_PUBLIC_ITEMS,
     restriction,
     "detects missing `#[inline]` attribute for public callables (functions, trait methods, methods...)"
index d41b54745649958de717e61f6d395bfbce0e62e5..3b65f80cba20aeb057459af04949401b6069d318 100644 (file)
@@ -32,6 +32,7 @@
     ///   stuff.rs
     ///   lib.rs
     /// ```
+    #[clippy::version = "1.57.0"]
     pub MOD_MODULE_FILES,
     restriction,
     "checks that module layout is consistent"
@@ -61,6 +62,7 @@
     ///   lib.rs
     /// ```
 
+    #[clippy::version = "1.57.0"]
     pub SELF_NAMED_MODULE_FILES,
     restriction,
     "checks that module layout is consistent"
index f45e68233a1777f5c0052e7b0a0758b024a1c306..d182a7d52497d45fd59cf8d367f8e84e207d3e10 100644 (file)
@@ -24,6 +24,7 @@
     /// ```rust
     /// let x = -17 % 3;
     /// ```
+    #[clippy::version = "1.42.0"]
     pub MODULO_ARITHMETIC,
     restriction,
     "any modulo arithmetic statement"
index 816b2f275fb5e17fb7a701d8867b7bb1f6ab2f32..e45cc86d417ac09aa103c518fabb0ec66f6c9880 100644 (file)
@@ -33,6 +33,7 @@
     /// ctrlc = "=3.1.0"
     /// ansi_term = "=0.11.0"
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MULTIPLE_CRATE_VERSIONS,
     cargo,
     "multiple versions of the same crate being used"
index 8476257f086fb9455c52c08aa62f5be009e00c8e..5fe887a4573cccb99b283dab4af6b5e969e9cc1a 100644 (file)
@@ -72,6 +72,7 @@
     ///     let _: HashSet<Bad> = HashSet::new();
     /// }
     /// ```
+    #[clippy::version = "1.42.0"]
     pub MUTABLE_KEY_TYPE,
     suspicious,
     "Check for mutable `Map`/`Set` key type"
index 7c4cac29ba8e8c699b7a5cfdeea61678f0a477ba..bcbea8f1e66b47edadc368481dc4a50584b48597 100644 (file)
@@ -22,6 +22,7 @@
     /// # let mut y = 1;
     /// let x = &mut &mut y;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MUT_MUT,
     pedantic,
     "usage of double-mut refs, e.g., `&mut &mut ...`"
index b96fa4774cbb3633cdcae5b5a74f487ee1b66676..b1e6308d2e1a006ff7d33a7e2ce27c607cf67454 100644 (file)
@@ -38,6 +38,7 @@
     /// let value = value_mutex.get_mut().unwrap();
     /// *value += 1;
     /// ```
+    #[clippy::version = "1.49.0"]
     pub MUT_MUTEX_LOCK,
     style,
     "`&mut Mutex::lock` does unnecessary locking"
index 8d5d7951fc532c6ddd8e42f73ed3d31d814bd257..63a1cf7b7d5bd8492c1fe91da435e106a88d293d 100644 (file)
@@ -23,6 +23,7 @@
     /// // Good
     /// my_vec.push(&value)
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNNECESSARY_MUT_PASSED,
     style,
     "an argument passed as a mutable reference although the callee only demands an immutable reference"
index ee50891cc3103b6903537bbcaf6bbe1ecb304b78..fa7274990db390d1c3f32fb67153b61daaecdd76 100644 (file)
@@ -26,6 +26,7 @@
     /// fn take_a_mut_parameter(_: &mut u32) -> bool { unimplemented!() }
     /// debug_assert!(take_a_mut_parameter(&mut 5));
     /// ```
+    #[clippy::version = "1.40.0"]
     pub DEBUG_ASSERT_WITH_MUT_CALL,
     nursery,
     "mutable arguments in `debug_assert{,_ne,_eq}!`"
index 5feddcbfc61042c6eeecd73900de7354a172519c..816377fe65e9f31e61b5458784af40267abd46cc 100644 (file)
@@ -36,6 +36,7 @@
     /// # use std::sync::atomic::AtomicBool;
     /// let x = AtomicBool::new(y);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MUTEX_ATOMIC,
     perf,
     "using a mutex where an atomic value could be used instead"
@@ -64,6 +65,7 @@
     /// # use std::sync::atomic::AtomicUsize;
     /// let x = AtomicUsize::new(0usize);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MUTEX_INTEGER,
     nursery,
     "using a mutex for an integer type"
index c8a8750c2ff76c27b04a091ebaa96b1304e62d8e..9838d3cad9f02d537732033a0435ffa73281ea1f 100644 (file)
@@ -52,6 +52,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.47.0"]
     pub NEEDLESS_ARBITRARY_SELF_TYPE,
     complexity,
     "type of `self` parameter is already by default `Self`"
index ad981599473070cbdce18c69b66db3e01831f6b6..a8a8d174a823e309f088517808464b9a6d8ad4d8 100644 (file)
@@ -30,6 +30,7 @@
     /// let (x,y) = (true, false);
     /// if x && !y {}
     /// ```
+    #[clippy::version = "1.54.0"]
     pub NEEDLESS_BITWISE_BOOL,
     pedantic,
     "Boolean expressions that use bitwise rather than lazy operators"
index 91944653500bbde663f4e14c9226279eca4fcacc..3709f3948c2b5f541295eaeaa074d8595aed9256 100644 (file)
@@ -41,6 +41,7 @@
     /// ```rust,ignore
     /// !x
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_BOOL,
     complexity,
     "if-statements with plain booleans in the then- and else-clause, e.g., `if p { true } else { false }`"
@@ -65,6 +66,7 @@
     /// if x {}
     /// if !y {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BOOL_COMPARISON,
     complexity,
     "comparing a variable to a boolean, e.g., `if x == true` or `if x != true`"
index 085be6650cc6926e658decac3e3c226995dfe29b..6709fed91bd18040df18c333887c7990be4f3a10 100644 (file)
@@ -37,6 +37,7 @@
     /// let x: &i32 = &5;
     /// fun(x);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_BORROW,
     style,
     "taking a reference that is going to be automatically dereferenced"
@@ -63,6 +64,7 @@
     ///     // use `&x` here
     /// }
     /// ```
+    #[clippy::version = "1.54.0"]
     pub REF_BINDING_TO_REFERENCE,
     pedantic,
     "`ref` binding to a reference"
index 36879eda7c0037733bc940a43f7c9d0546fd98b6..0fcc419e722272b3afccf433f60f3afb07974436 100644 (file)
@@ -38,6 +38,7 @@
     /// let mut v = Vec::<String>::new();
     /// let _ = v.iter_mut().filter(|a| a.is_empty());
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_BORROWED_REFERENCE,
     complexity,
     "destructuring a reference and borrowing the inner value"
index 7aa93ed783920a943ae44caaa23128dbfc4b9990..98a3bce1ff38a1e9d107b54d8f725af240156c9a 100644 (file)
     ///     # break;
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_CONTINUE,
     pedantic,
     "`continue` statements that can be replaced by a rearrangement of code"
index 9a6ddc72ce56a04ca17199e8b1baa700763dafcf..0c1da0351739a25de814988d9db6da15b5bb554b 100644 (file)
@@ -40,6 +40,7 @@
     ///     println!("{}", elem);
     /// }
     /// ```
+    #[clippy::version = "1.53.0"]
     pub NEEDLESS_FOR_EACH,
     pedantic,
     "using `for_each` where a `for` loop would be simpler"
index e88e98e6081e00ff84b1faa6e7b5cd0af4459890..a28b08c33ec46c533d4d4cfa361d80acd9b3c099 100644 (file)
@@ -26,6 +26,7 @@
     /// let a = Some(&1);
     /// let b = a;
     /// ```
+    #[clippy::version = "1.57.0"]
     pub NEEDLESS_OPTION_AS_DEREF,
     complexity,
     "no-op use of `deref` or `deref_mut` method to `Option`."
index 352dc6f8bec3dd7d07c621d211837dc870ae46d1..35877d51c0c166c89ec0e70598ed377a84b70a96 100644 (file)
@@ -51,6 +51,7 @@
     ///     assert_eq!(v.len(), 42);
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_PASS_BY_VALUE,
     pedantic,
     "functions taking arguments by value, but not consuming them in its body"
index 42e48336e1539595d7f877698bd2f42031a83507..3ca933ea8fbe3fab84e88f2318e9458146f39669 100644 (file)
@@ -53,6 +53,7 @@
     ///     tr.and_then(|t| t.magic)
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub NEEDLESS_QUESTION_MARK,
     complexity,
     "Suggest `value.inner_option` instead of `Some(value.inner_option?)`. The same goes for `Result<T, E>`."
index 2a33b7392caa478d08c35b7de0d17c0cf7bb6835..ed315efaa2fa7c546de3a7fabce42dc2997a80f5 100644 (file)
@@ -40,6 +40,7 @@
     ///     ..zero_point
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_UPDATE,
     complexity,
     "using `Foo { ..base }` when there are no missing fields"
index 6ad49b7060565ce9b8cea8db5b88abff1dc76825..efe31a1544187ebeec7ca98fb3e6e034272f9312 100644 (file)
@@ -36,6 +36,7 @@
     ///     _ => false,
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEG_CMP_OP_ON_PARTIAL_ORD,
     complexity,
     "The use of negated comparison operators on partially ordered types may produce confusing code."
index 1b15d29439f780cdee65e26b1dcf002c12aea846..cb67fab17400590a04c008afd701f66047f64d6a 100644 (file)
@@ -20,6 +20,7 @@
     /// ```ignore
     /// x * -1
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEG_MULTIPLY,
     style,
     "multiplying integers with `-1`"
index 0ac27f1cba2262ce1a8c1423678ac787b67d966e..f0c0c89ca8f3b5bfff8df170daa76273a47b3566 100644 (file)
@@ -45,6 +45,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEW_WITHOUT_DEFAULT,
     style,
     "`fn new() -> Self` method without `Default` implementation"
index 6dae8f320436fc49609aa428cc808a218f84edd7..31134743d029bfc73f5d8b9c878971a1ea451cda 100644 (file)
@@ -22,6 +22,7 @@
     /// ```rust
     /// 0;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NO_EFFECT,
     complexity,
     "statements with no effect"
@@ -44,6 +45,7 @@
     /// ```rust,ignore
     /// let _i_serve_no_purpose = 1;
     /// ```
+    #[clippy::version = "1.58.0"]
     pub NO_EFFECT_UNDERSCORE_BINDING,
     pedantic,
     "binding to `_` prefixed variable with no side-effect"
@@ -62,6 +64,7 @@
     /// ```rust,ignore
     /// compute_array()[0];
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNNECESSARY_OPERATION,
     complexity,
     "outer expressions with no effect"
index 2a85a67fa099cac9355d26e61ca5bdada9387994..df82775d50713d0c891c74cfe67e408c5baa9140 100644 (file)
@@ -69,6 +69,7 @@
     /// STATIC_ATOM.store(9, SeqCst);
     /// assert_eq!(STATIC_ATOM.load(SeqCst), 9); // use a `static` item to refer to the same instance
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DECLARE_INTERIOR_MUTABLE_CONST,
     style,
     "declaring `const` with interior mutability"
     /// STATIC_ATOM.store(9, SeqCst);
     /// assert_eq!(STATIC_ATOM.load(SeqCst), 9); // use a `static` item to refer to the same instance
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BORROW_INTERIOR_MUTABLE_CONST,
     style,
     "referencing `const` with interior mutability"
index 5b254bc8133d2fecce4c6227b90d7c91e2206b6c..1a124e2d3cbf39874e50593b34c31b0c45d11a8a 100644 (file)
@@ -24,6 +24,7 @@
     /// let checked_exp = something;
     /// let checked_expr = something_else;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SIMILAR_NAMES,
     pedantic,
     "similarly named items and bindings"
@@ -42,6 +43,7 @@
     /// ```ignore
     /// let (a, b, c, d, e, f, g) = (...);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MANY_SINGLE_CHAR_NAMES,
     pedantic,
     "too many single character bindings"
@@ -62,6 +64,7 @@
     /// let ___1 = 1;
     /// let __1___2 = 11;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub JUST_UNDERSCORES_AND_DIGITS,
     style,
     "unclear name"
index 3b74f69d3753abe38644a6dfe1b618f22b86f1fd..4b57dbc4c412a0d117352899f7ec55005cb19184 100644 (file)
@@ -32,6 +32,7 @@
     /// let mut options = OpenOptions::new();
     /// options.mode(0o644);
     /// ```
+    #[clippy::version = "1.53.0"]
     pub NON_OCTAL_UNIX_PERMISSIONS,
     correctness,
     "use of non-octal value to set unix file permissions, which will be translated into octal"
index 7ebf84d400f569c3f891bc7d417afeeb2d741167..9c07488bfe6ef39cd5bfcec0263719377de7f98a 100644 (file)
@@ -43,6 +43,7 @@
     /// ```
     /// Use thread-safe types like [`std::sync::Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html)
     /// or specify correct bounds on generic type parameters (`T: Send`).
+    #[clippy::version = "1.57.0"]
     pub NON_SEND_FIELDS_IN_SEND_TY,
     suspicious,
     "there is field that does not implement `Send` in a `Send` struct"
index bab15217d52bf84a38a35bda5fecd45df7da813b..3dcc9e26c9e2d9b43d1cbcb8509d09347f17b1db 100644 (file)
@@ -31,6 +31,7 @@
     /// ```rust
     /// vec![1, 2, 3];
     /// ```
+    #[clippy::version = "1.55.0"]
     pub NONSTANDARD_MACRO_BRACES,
     nursery,
     "check consistent use of braces in macro"
index 5752342cf623b67e55292b5079b2c89ab43fa8cb..2c77100bdcfc8837a52b2751fb519a8e674d8bf1 100644 (file)
@@ -22,6 +22,7 @@
     ///
     /// OpenOptions::new().read(true).truncate(true);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NONSENSICAL_OPEN_OPTIONS,
     correctness,
     "nonsensical combination of options for opening a file"
index d7306628030f6ddc3d02a7a134e7ac01959d2f16..3f5286ba097b5970993d6f7027b94c512a556041 100644 (file)
@@ -26,6 +26,7 @@
     /// ```rust,no_run
     /// let _ = env!("HOME");
     /// ```
+    #[clippy::version = "1.43.0"]
     pub OPTION_ENV_UNWRAP,
     correctness,
     "using `option_env!(...).unwrap()` to get environment variable"
index ed5583799fe8c469e1e8aace3886a348972bbb65..df72f4b0eb28766a187b66a5f842472c762d92ab 100644 (file)
@@ -59,6 +59,7 @@
     ///     y*y
     /// }, |foo| foo);
     /// ```
+    #[clippy::version = "1.47.0"]
     pub OPTION_IF_LET_ELSE,
     nursery,
     "reimplementation of Option::map_or"
index 0f9e5ada3a8a4e1186a5f5471e9c270272ac440f..6dabbd4803117692a025804c9ccdd0302e077cd0 100644 (file)
@@ -19,6 +19,7 @@
     /// # let b = 2;
     /// a + b < a;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OVERFLOW_CHECK_CONDITIONAL,
     complexity,
     "overflow checks inspired by C which are likely to panic"
index 583c42b65631395a3acfec3a5748b917ff91e90f..8769c0452146435d1869b0ea30bfa74721052acb 100644 (file)
@@ -30,6 +30,7 @@
     ///     Err(String::from("error"))
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub PANIC_IN_RESULT_FN,
     restriction,
     "functions of type `Result<..>` that contain `panic!()`, `todo!()`, `unreachable()`, `unimplemented()` or assertion"
index d8d9081d6f172ab72da22e9ad1697f5a55e9b521..edfac824ded987e8c47c5e45493c76b1beb83720 100644 (file)
@@ -17,6 +17,7 @@
     /// ```no_run
     /// panic!("even with a good reason");
     /// ```
+    #[clippy::version = "1.40.0"]
     pub PANIC,
     restriction,
     "usage of the `panic!` macro"
@@ -33,6 +34,7 @@
     /// ```no_run
     /// unimplemented!();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNIMPLEMENTED,
     restriction,
     "`unimplemented!` should not be present in production code"
@@ -49,6 +51,7 @@
     /// ```no_run
     /// todo!();
     /// ```
+    #[clippy::version = "1.40.0"]
     pub TODO,
     restriction,
     "`todo!` should not be present in production code"
@@ -65,6 +68,7 @@
     /// ```no_run
     /// unreachable!();
     /// ```
+    #[clippy::version = "1.40.0"]
     pub UNREACHABLE,
     restriction,
     "usage of the `unreachable!` macro"
index 4ec493e5f45e075f209523d0a7389d0de9eaa234..e827cdaae8728922580a9f4e7d9fbc7cafd5b3b6 100644 (file)
@@ -25,6 +25,7 @@
     ///    fn ne(&self, other: &Foo) -> bool { !(self == other) }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub PARTIALEQ_NE_IMPL,
     complexity,
     "re-implementing `PartialEq::ne`"
index 6229b9608b3cbe5aad07d6316c374f70e30f2cff..3092ab8392a7231b99e23e74f71764ce88c21b1e 100644 (file)
@@ -65,6 +65,7 @@
     /// // Better
     /// fn foo(v: u32) {}
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRIVIALLY_COPY_PASS_BY_REF,
     pedantic,
     "functions taking small copyable arguments by reference"
@@ -98,6 +99,7 @@
     /// // Good
     /// fn foo(v: &TooLarge) {}
     /// ```
+    #[clippy::version = "1.49.0"]
     pub LARGE_TYPES_PASSED_BY_VALUE,
     pedantic,
     "functions taking large arguments by value"
index 3df7a72d2950984c2d27a2622e0a1c3e8561ac63..8ebee9bd04d3177c8aa8a4f2bfbdee035d41f998 100644 (file)
@@ -35,6 +35,7 @@
     /// x.push("bar");
     /// assert_eq!(x, PathBuf::from("/foo/bar"));
     /// ```
+    #[clippy::version = "1.36.0"]
     pub PATH_BUF_PUSH_OVERWRITE,
     nursery,
     "calling `push` with file system root on `PathBuf` can overwrite it"
index e7bc24465908b43851b87e2af2483e6ac7758028..3e7eef4edac8a8f56f34e1444fff83ed5424b370 100644 (file)
@@ -77,6 +77,7 @@
     ///     *a += b;
     /// }
     /// ```
+    #[clippy::version = "1.47.0"]
     pub PATTERN_TYPE_MISMATCH,
     restriction,
     "type of pattern does not match the expression type"
index 1a8da00d9d616df75d96727cbe48496c1efbfd84..cc0533c9f5d1aa5b0abfb43e5050b42605f34265 100644 (file)
@@ -42,6 +42,7 @@
     /// ### Example
     /// * `1 << 2 + 3` equals 32, while `(1 << 2) + 3` equals 7
     /// * `-1i32.abs()` equals -1, while `(-1i32).abs()` equals 1
+    #[clippy::version = "pre 1.29.0"]
     pub PRECEDENCE,
     complexity,
     "operations where precedence may be unclear"
index 8a36e20fc973d678297d14718039e8913af8acc7..c08a19d520b607bac1658b9ce50ab64928d2f5e3 100644 (file)
@@ -70,6 +70,7 @@
     /// // Good
     /// fn foo(&[u32]) { .. }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub PTR_ARG,
     style,
     "fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively"
@@ -96,6 +97,7 @@
     ///     ..
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CMP_NULL,
     style,
     "comparing a pointer to a null pointer, suggesting to use `.is_null()` instead"
     /// ```ignore
     /// fn foo(&Foo) -> &mut Bar { .. }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MUT_FROM_REF,
     correctness,
     "fns that create mutable refs from immutable ref args"
     /// // Good
     /// unsafe { std::slice::from_raw_parts(NonNull::dangling().as_ptr(), 0); }
     /// ```
+    #[clippy::version = "1.53.0"]
     pub INVALID_NULL_PTR_USAGE,
     correctness,
     "invalid usage of a null pointer, suggesting `NonNull::dangling()` instead"
index 2df34d6d9b9cf70a780c54352a3d04afdcac5d29..3c126fc1ca69a27cc0862dcb3f44a8cf1f2df211 100644 (file)
@@ -29,6 +29,7 @@
     ///
     /// assert!(std::ptr::eq(a, b));
     /// ```
+    #[clippy::version = "1.49.0"]
     pub PTR_EQ,
     style,
     "use `std::ptr::eq` when comparing raw pointers"
index cfb5287c6673fabe6a5a0642472916f768f9fe39..964564b57946b5784536ab86e62013fe073b869d 100644 (file)
@@ -38,6 +38,7 @@
     ///     ptr.add(offset);
     /// }
     /// ```
+    #[clippy::version = "1.30.0"]
     pub PTR_OFFSET_WITH_CAST,
     complexity,
     "unneeded pointer offset cast"
index f63ef163bcbd0f1b76ddfd92fcac4d38b50a48bc..a5531993ee6ad36bb038edf750c1f22b993fc6ba 100644 (file)
@@ -32,6 +32,7 @@
     /// ```ignore
     /// option?;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub QUESTION_MARK,
     style,
     "checks for expressions that could be replaced by the question mark operator"
index 87364a88ed0dcc8267c6e955c64e83874ab38aaf..09c64485bbb27f4b605e27d51e7d48b15e1bb2c9 100644 (file)
@@ -35,6 +35,7 @@
     /// # let x = vec![1];
     /// x.iter().enumerate();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub RANGE_ZIP_WITH_LEN,
     complexity,
     "zipping iterator with a range when `enumerate()` would do"
@@ -72,6 +73,7 @@
     /// ```rust,ignore
     /// for x..=y { .. }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub RANGE_PLUS_ONE,
     pedantic,
     "`x..(y+1)` reads better as `x..=y`"
     /// ```rust,ignore
     /// for x..y { .. }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub RANGE_MINUS_ONE,
     pedantic,
     "`x..=(y-1)` reads better as `x..y`"
     ///     let sub = &arr[1..3];
     /// }
     /// ```
+    #[clippy::version = "1.45.0"]
     pub REVERSED_EMPTY_RANGES,
     correctness,
     "reversing the limits of range expressions, resulting in empty ranges"
     ///# let x = 6;
     /// assert!((3..8).contains(&x));
     /// ```
+    #[clippy::version = "1.49.0"]
     pub MANUAL_RANGE_CONTAINS,
     style,
     "manually reimplementing {`Range`, `RangeInclusive`}`::contains`"
index f7711b6fe947654b6de39254a0f3cc87f3f80717..1a2c86a768649e501b5a05be3f949a98e9219baf 100644 (file)
@@ -62,6 +62,7 @@ macro_rules! unwrap_or_continue {
     ///
     /// Path::new("/a/b").join("c").to_path_buf();
     /// ```
+    #[clippy::version = "1.32.0"]
     pub REDUNDANT_CLONE,
     perf,
     "`clone()` of an owned value that is going to be dropped immediately"
index 90e3c3f4b3e98f78121f2d23f43bc4a1c89148f6..0de282542fc3c73fc0e15446364b1505e1b3c3b8 100644 (file)
@@ -30,6 +30,7 @@
     /// // Good
     /// let a = 42
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub REDUNDANT_CLOSURE_CALL,
     complexity,
     "throwaway closures called in the expression they are defined"
index 68b256d29442acd199b3696f2094ed51129cfbd9..93dbe936d5841b2e9b9b289ea3e445c5a1857c4c 100644 (file)
@@ -36,6 +36,7 @@
     ///     print!("Moving on...");
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub REDUNDANT_ELSE,
     pedantic,
     "`else` branch that can be removed without changing semantics"
index 47df4917510ff97eadbb5e784cc8e754e1805396..0dea4a784b2170829f7f1a7be2c825f4dca7f2fd 100644 (file)
@@ -30,6 +30,7 @@
     /// ```ignore
     /// let foo = Foo { bar };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub REDUNDANT_FIELD_NAMES,
     style,
     "checks for fields in struct literals where shorthands could be used"
index 919d4e11e5a060637fb35ab2012a802f80f47aa6..2cee3c14d7f30f89db58dc7797d8090d4fe6d3a1 100644 (file)
@@ -26,6 +26,7 @@
     ///     pub fn internal_fn() { }
     /// }
     /// ```
+    #[clippy::version = "1.44.0"]
     pub REDUNDANT_PUB_CRATE,
     nursery,
     "Using `pub(crate)` visibility on items that are not crate visible due to the visibility of the module that contains them."
index 0c460150087b1b6f35e385c7bfa54792bf639e70..b2bd0103d1114125f0849b91cb6a7abdb811e194 100644 (file)
@@ -34,6 +34,7 @@
     ///     x
     /// }
     /// ```
+    #[clippy::version = "1.51.0"]
     pub REDUNDANT_SLICING,
     complexity,
     "redundant slicing of the whole range of a type"
index d5a1a61da6bf4aac5cf769ee233a9faeeb3b4e19..ea5064217abe55ac47b63a6b91e9ef0369059547 100644 (file)
@@ -27,6 +27,7 @@
     ///  const FOO: &[(&str, &str, fn(&Bar) -> bool)] = &[...]
     ///  static FOO: &[(&str, &str, fn(&Bar) -> bool)] = &[...]
     /// ```
+    #[clippy::version = "1.37.0"]
     pub REDUNDANT_STATIC_LIFETIMES,
     style,
     "Using explicit `'static` lifetime for constants or statics when elision rules would allow omitting them."
index d543832e314e97a197a38f6846d873513bf117f8..909d6971a5497305a7937bd7b70984e7ffb729b6 100644 (file)
@@ -28,6 +28,7 @@
     /// ```rust,ignore
     /// let x: Option<&u32> = Some(&0u32);
     /// ```
+    #[clippy::version = "1.49.0"]
     pub REF_OPTION_REF,
     pedantic,
     "use `Option<&T>` instead of `&Option<&T>`"
index 70dff5ad313bc79e971f675746369233b1b4d891..22ae7a291d00e5486e9ef8cb6a7b306aefda8257 100644 (file)
@@ -30,6 +30,7 @@
     /// let a = f(b);
     /// let c = d;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub DEREF_ADDROF,
     complexity,
     "use of `*&` or `*&mut` in an expression"
@@ -124,6 +125,7 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
     /// # let point = Point(30, 20);
     /// let x = point.0;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub REF_IN_DEREF,
     complexity,
     "Use of reference in auto dereference expression."
index 5d08aee1e5f8880f63e1382bb74635e3d85c32d1..8e5983b4773a8cd418d2e26565f42ac2f14ac8a8 100644 (file)
@@ -22,6 +22,7 @@
     /// ```ignore
     /// Regex::new("|")
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub INVALID_REGEX,
     correctness,
     "invalid regular expressions"
@@ -46,6 +47,7 @@
     /// ```ignore
     /// Regex::new("^foobar")
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRIVIAL_REGEX,
     nursery,
     "trivial regular expressions"
index e5e55ee750593699d36839877c28d22dc323bc6a..b5dd2de633742813a9b72347cf1fbc2e09724a44 100644 (file)
@@ -35,6 +35,7 @@
     ///     let x = String::from("hello world").clone();
     /// }
     /// ```
+    #[clippy::version = "1.47.0"]
     pub REPEAT_ONCE,
     complexity,
     "using `.repeat(1)` instead of `String.clone()`, `str.to_string()` or `slice.to_vec()` "
index e2b1a33746e5f4cd5d9ddb161c423c987e2c382f..494bc7dda18e76008aebf3460fb1d64b4a88d0ee 100644 (file)
@@ -37,6 +37,7 @@
     ///     String::new()
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LET_AND_RETURN,
     style,
     "creating a let-binding and then immediately returning it like `let x = expr; x` at the end of a block"
@@ -62,6 +63,7 @@
     ///     x
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NEEDLESS_RETURN,
     style,
     "using a return statement like `return expr;` where an expression would suffice"
index 737ff634e449c4ff4406667e8f4d9e2afd4a6262..3f38d12fb557ffa167d3ed09168e09424c8e6649 100644 (file)
@@ -33,6 +33,7 @@
     ///     fn foo(&self) {}
     /// }
     /// ```
+    #[clippy::version = "1.57.0"]
     pub SAME_NAME_METHOD,
     restriction,
     "two method with same name"
index fbd65fef7d11be2ede59c3e3002fdadd44cda52a..b14f0518bdb77807751ee8041097a98ef96e10ff 100644 (file)
@@ -30,6 +30,7 @@
     ///     a.y = a.y;
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub SELF_ASSIGNMENT,
     correctness,
     "explicit self-assignment"
index 4ba5e1a0f5357829f95fad45aec80029882e8b88..dd73dbfe09e12b33c0e0d6bf427682414b0cb867 100644 (file)
@@ -32,6 +32,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.55.0"]
     pub SELF_NAMED_CONSTRUCTORS,
     style,
     "method should not have the same name as the type it is implemented for"
index d3b4929a18925b832fb7431fc331586f3a7074e4..0b3bbbc815580841e701e22d419e37e6ecc336e3 100644 (file)
@@ -29,6 +29,7 @@
     ///     println!("Hello world");
     /// }
     /// ```
+    #[clippy::version = "1.52.0"]
     pub SEMICOLON_IF_NOTHING_RETURNED,
     pedantic,
     "add a semicolon if nothing is returned"
index 2cd0f85999cf5bca682dd2103c246a544870f9d5..a38b3c4ab69b70fe10c49e8d73712720661a6226 100644 (file)
@@ -15,6 +15,7 @@
     /// ### Example
     /// Implementing `Visitor::visit_string` but not
     /// `Visitor::visit_str`.
+    #[clippy::version = "pre 1.29.0"]
     pub SERDE_API_MISUSE,
     correctness,
     "various things that will negatively affect your serde experience"
index 64841f33cc385afa389801c7ab9f19d2d3032514..5f82aed872cafc855ac9ed0e115c13a6b2a9f6b0 100644 (file)
@@ -29,6 +29,7 @@
     /// // Good
     /// let y = &x; // use different variable name
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SHADOW_SAME,
     restriction,
     "rebinding a name to itself, e.g., `let mut x = &mut x`"
@@ -55,6 +56,7 @@
     /// let x = 2;
     /// let y = x + 1;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SHADOW_REUSE,
     restriction,
     "rebinding a name to an expression that re-uses the original value, e.g., `let x = x + 1`"
@@ -84,6 +86,7 @@
     /// // Good
     /// let w = z; // use different variable name
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SHADOW_UNRELATED,
     restriction,
     "rebinding a name without even using the original value"
index 87aa02b65854e196b742101c7c95ae229ac23caa..28d32203da9d73136f7b0c0a69a75af8690e8b21 100644 (file)
@@ -27,6 +27,7 @@
     ///     regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
     /// }
     /// ```
+    #[clippy::version = "1.43.0"]
     pub SINGLE_COMPONENT_PATH_IMPORTS,
     style,
     "imports with single component path are redundant"
index 3e4e4a8d0c08b03ecdb077d7eecf899a8f34c18b..df1e85afdd799a917fad95e4325de826050faa36 100644 (file)
@@ -29,6 +29,7 @@
     /// let mut y = [2u8; SIZE];
     /// unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), size_of::<u8>() * SIZE) };
     /// ```
+    #[clippy::version = "1.50.0"]
     pub SIZE_OF_IN_ELEMENT_COUNT,
     correctness,
     "using `size_of::<T>` or `size_of_val::<T>` where a count of elements of `T` is expected"
index 3608fe1472dda5b53eb07a454bd6246b9d47db58..1ae772ef70b124ae31244efd4ca23cc2058b7e38 100644 (file)
@@ -36,6 +36,7 @@
     /// let mut vec1 = vec![0; len];
     /// let mut vec2 = vec![0; len];
     /// ```
+    #[clippy::version = "1.32.0"]
     pub SLOW_VECTOR_INITIALIZATION,
     perf,
     "slow vector initialization"
index 4ea1293d504d3e30a3e6cf94ac7e6fe4e143df23..953d21e07a3908063d2ab59f13051ffa942f4f74 100644 (file)
@@ -28,6 +28,7 @@
     /// let mut vec = vec![2, 1, 3];
     /// vec.sort_unstable();
     /// ```
+    #[clippy::version = "1.47.0"]
     pub STABLE_SORT_PRIMITIVE,
     perf,
     "use of sort() when sort_unstable() is equivalent"
index 6435107b8b4643f02f94078b7fe0c70802458d56..368274440d5dcb23551ed30be7d4a8ba5f808ece 100644 (file)
@@ -31,6 +31,7 @@
     /// x += ", World";
     /// x.push_str(", World");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub STRING_ADD_ASSIGN,
     pedantic,
     "using `x = x + ..` where x is a `String` instead of `push_str()`"
@@ -58,6 +59,7 @@
     /// let x = "Hello".to_owned();
     /// x + ", World";
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub STRING_ADD,
     restriction,
     "using `x + ..` where x is a `String` instead of `push_str()`"
     /// // Good
     /// let bs = b"a byte string";
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub STRING_LIT_AS_BYTES,
     nursery,
     "calling `as_bytes` on a string literal instead of using a byte string literal"
     /// ```rust,should_panic
     /// &"Ölkanne"[1..];
     /// ```
+    #[clippy::version = "1.58.0"]
     pub STRING_SLICE,
     restriction,
     "slicing a string"
@@ -227,6 +231,7 @@ fn is_add(cx: &LateContext<'_>, src: &Expr<'_>, target: &Expr<'_>) -> bool {
     /// ```rust
     /// let _ = &"Hello World!"[6..11];
     /// ```
+    #[clippy::version = "1.50.0"]
     pub STRING_FROM_UTF8_AS_BYTES,
     complexity,
     "casting string slices to byte slices and back"
@@ -371,6 +376,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
     /// // example code which does not raise clippy warning
     /// let _ = "str".to_owned();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub STR_TO_STRING,
     restriction,
     "using `to_string()` on a `&str`, which should be `to_owned()`"
@@ -420,6 +426,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'_>) {
     /// let msg = String::from("Hello World");
     /// let _ = msg.clone();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub STRING_TO_STRING,
     restriction,
     "using `to_string()` on a `String`, which should be `clone()`"
index 8bf40ec53122d4f348ff8e49acb0956383d18f64..be7431f11aad04af75a906aeb92c6a931caf3af9 100644 (file)
@@ -30,6 +30,7 @@
     /// let cstring = CString::new("foo").expect("CString::new failed");
     /// let len = cstring.as_bytes().len();
     /// ```
+    #[clippy::version = "1.55.0"]
     pub STRLEN_ON_C_STRINGS,
     complexity,
     "using `libc::strlen` on a `CString` or `CStr` value, while `as_bytes().len()` or `to_bytes().len()` respectively can be used instead"
index 201aa06782405c17921c5c08e2c2b47b9162ef78..faf43fd9fc1ad536ff934eb4cd1d4d5f116e2931 100644 (file)
@@ -59,6 +59,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub SUSPICIOUS_OPERATION_GROUPINGS,
     nursery,
     "groupings of binary operations that look suspiciously like typos"
index 682fad00a13ee30d3e29db8676998d40d91e8490..a3195de81d15c7415be7d5f95a3626ad1c0ba54a 100644 (file)
@@ -25,6 +25,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SUSPICIOUS_ARITHMETIC_IMPL,
     suspicious,
     "suspicious use of operators in impl of arithmetic trait"
@@ -46,6 +47,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub SUSPICIOUS_OP_ASSIGN_IMPL,
     suspicious,
     "suspicious use of operators in impl of OpAssign trait"
index ef26de5b6b933dd810b9a0c845e2269efab2fb3b..a8c7ca4c91687e69583b08917b79b62f33ea8d34 100644 (file)
@@ -35,6 +35,7 @@
     /// let mut b = 2;
     /// std::mem::swap(&mut a, &mut b);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub MANUAL_SWAP,
     complexity,
     "manual swap of two variables"
@@ -60,6 +61,7 @@
     /// # let mut b = 2;
     /// std::mem::swap(&mut a, &mut b);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ALMOST_SWAPPED,
     correctness,
     "`foo = bar; bar = foo` sequence"
index 4a67cabf323a6a1489f84d485bce350acc98a8cf..c9b4b245f4cc25019d130f05b33151bf80a81bdf 100644 (file)
@@ -51,6 +51,7 @@
     ///    second_string: String,
     ///}
     /// ```
+    #[clippy::version = "1.41.0"]
     pub TABS_IN_DOC_COMMENTS,
     style,
     "using tabs in doc comments is not recommended"
index a9da690339ccfaa997c50848f0d40d78a6a856bc..3766b8f8ed10d6aed395454ffcaa2f8e1ce12bd8 100644 (file)
@@ -17,6 +17,7 @@
     /// ```rust
     /// (0, 0).0 = 1
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TEMPORARY_ASSIGNMENT,
     complexity,
     "assignments to temporaries"
index 1c14a9199950cc5e3e1d070f6bf366ec63ecc35c..5eb58b47838298d493c0c4c88def60ec2e0182c0 100644 (file)
@@ -28,6 +28,7 @@
     /// # let radix = 10;
     /// let is_digit = c.is_digit(radix);
     /// ```
+    #[clippy::version = "1.41.0"]
     pub TO_DIGIT_IS_SOME,
     style,
     "`char.is_digit()` is clearer"
index b7414cec87cd2f3a6600d2525d61a3bea3625e88..f8b6bdcd3e15ed413e98e9530045fa5bc5e6fc2a 100644 (file)
@@ -39,6 +39,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub TO_STRING_IN_DISPLAY,
     correctness,
     "`to_string` method used while implementing `Display` trait"
index c216a1f81ea547630840e7403bd0f8ebe4820204..47c0a84cd4630ee97a94f3ebfc29f7987ea4e3ff 100644 (file)
@@ -28,6 +28,7 @@
     ///     last: [u32; 0],
     /// }
     /// ```
+    #[clippy::version = "1.58.0"]
     pub TRAILING_EMPTY_ARRAY,
     nursery,
     "struct with a trailing zero-sized array but without `#[repr(C)]` or another `repr` attribute"
index 73bdcae9e392066b5eab3a9f36d72aff1ca81bec..fb4abceac25e2ccab72372e32f4094c1d8742e81 100644 (file)
@@ -28,6 +28,7 @@
     /// ```rust
     /// pub fn foo<T>(t: T) where T: Copy + Clone {}
     /// ```
+    #[clippy::version = "1.38.0"]
     pub TYPE_REPETITION_IN_BOUNDS,
     pedantic,
     "Types are repeated unnecessary in trait bounds use `+` instead of using `T: _, T: _`"
@@ -57,6 +58,7 @@
     /// ```rust
     /// fn func<T>(arg: T) where T: Clone + Default {}
     /// ```
+    #[clippy::version = "1.47.0"]
     pub TRAIT_DUPLICATION_IN_BOUNDS,
     pedantic,
     "Check if the same trait bounds are specified twice during a function declaration"
index e6acf1a94c9299c6b2c59abfaa83a15da0441cb7..3ad4ec74bf51c1bdde228e00f451c3685fa92e31 100644 (file)
@@ -36,6 +36,7 @@
     /// ```ignore
     /// let ptr: *const T = core::intrinsics::transmute('x')
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WRONG_TRANSMUTE,
     correctness,
     "transmutes that are confusing at best, undefined behaviour at worst and always useless"
@@ -55,6 +56,7 @@
     /// ```rust,ignore
     /// core::intrinsics::transmute(t); // where the result type is the same as `t`'s
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USELESS_TRANSMUTE,
     nursery,
     "transmutes that have the same to and from types or could be a cast/coercion"
@@ -80,6 +82,7 @@
     /// # let p: *const [i32] = &[];
     /// p as *const [u16];
     /// ```
+    #[clippy::version = "1.47.0"]
     pub TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS,
     complexity,
     "transmutes that could be a pointer cast"
     /// core::intrinsics::transmute(t) // where the result type is the same as
     ///                                // `*t` or `&t`'s
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub CROSSPOINTER_TRANSMUTE,
     complexity,
     "transmutes that have to or from types that are a pointer to the other"
     /// // can be written:
     /// let _: &T = &*p;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRANSMUTE_PTR_TO_REF,
     complexity,
     "transmutes from a pointer to a reference type"
     /// // should be:
     /// let _ = std::char::from_u32(x).unwrap();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRANSMUTE_INT_TO_CHAR,
     complexity,
     "transmutes from an integer to a `char`"
     /// // should be:
     /// let _ = std::str::from_utf8(b).unwrap();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRANSMUTE_BYTES_TO_STR,
     complexity,
     "transmutes from a `&[u8]` to a `&str`"
     /// // should be:
     /// let _: bool = x != 0;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRANSMUTE_INT_TO_BOOL,
     complexity,
     "transmutes from an integer to a `bool`"
     /// // should be:
     /// let _: f32 = f32::from_bits(1_u32);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRANSMUTE_INT_TO_FLOAT,
     complexity,
     "transmutes from an integer to a float"
     /// // should be:
     /// let _: u32 = 1f32.to_bits();
     /// ```
+    #[clippy::version = "1.41.0"]
     pub TRANSMUTE_FLOAT_TO_INT,
     complexity,
     "transmutes from a float to an integer"
     /// // should be
     /// let x: [u8; 8] = 0i64.to_ne_bytes();
     /// ```
+    #[clippy::version = "1.58.0"]
     pub TRANSMUTE_NUM_TO_BYTES,
     complexity,
     "transmutes from a number to an array of `u8`"
     /// let _ = ptr as *const f32;
     /// let _ = unsafe{ &*(&1u32 as *const u32 as *const f32) };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TRANSMUTE_PTR_TO_PTR,
     pedantic,
     "transmutes from a pointer to a pointer / a reference to a reference"
     /// ```rust
     /// vec![2_u16].into_iter().map(u32::from).collect::<Vec<_>>();
     /// ```
+    #[clippy::version = "1.40.0"]
     pub UNSOUND_COLLECTION_TRANSMUTE,
     correctness,
     "transmute between collections of layout-incompatible types"
index ef80663d1da41ecdce20d5b885be1482f14b437f..7939dfedc3a2b4fb6d39555f29a3596828895861 100644 (file)
@@ -25,6 +25,7 @@
     /// ```rust
     /// let null_ref: &u64 = unsafe { std::mem::transmute(0 as *const u64) };
     /// ```
+    #[clippy::version = "1.35.0"]
     pub TRANSMUTING_NULL,
     correctness,
     "transmutes from a null pointer to a reference, which is undefined behavior"
index cc450b1e599640fd5088b2d1707e2a728635a4db..e0e7ec9a452c139b19d4aeabe0dc99d4981935bb 100644 (file)
@@ -41,6 +41,7 @@
     ///     Ok(0)
     /// }
     /// ```
+    #[clippy::version = "1.38.0"]
     pub TRY_ERR,
     style,
     "return errors explicitly rather than hiding them behind a `?`"
index bbe07db5358cdc805be57a209fc87c22871b24ee..5a7ef760a3025dcbf890a3175fe1d31200fed05c 100644 (file)
@@ -43,6 +43,7 @@
     ///     values: Vec<Foo>,
     /// }
     /// ```
+    #[clippy::version = "1.57.0"]
     pub BOX_COLLECTION,
     perf,
     "usage of `Box<Vec<T>>`, vector elements are already on the heap"
@@ -75,6 +76,7 @@
     ///     values: Vec<i32>,
     /// }
     /// ```
+    #[clippy::version = "1.33.0"]
     pub VEC_BOX,
     complexity,
     "usage of `Vec<Box<T>>` where T: Sized, vector elements are already on the heap"
     ///     Contents::None
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub OPTION_OPTION,
     pedantic,
     "usage of `Option<Option<T>>`"
     /// # use std::collections::LinkedList;
     /// let x: LinkedList<usize> = LinkedList::new();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LINKEDLIST,
     pedantic,
     "usage of LinkedList, usually a vector is faster, or a more specialized data structure like a `VecDeque`"
     /// ```rust,ignore
     /// fn foo(bar: &T) { ... }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub BORROWED_BOX,
     complexity,
     "a borrow of a boxed type"
     /// ```rust
     /// fn foo(bar: &usize) {}
     /// ```
+    #[clippy::version = "1.44.0"]
     pub REDUNDANT_ALLOCATION,
     perf,
     "redundant allocation"
     /// ```rust,ignore
     /// fn foo(interned: Rc<str>) { ... }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub RC_BUFFER,
     restriction,
     "shared ownership of a buffer type"
     ///     inner: Rc<Vec<Vec<Box<(u32, u32, u32, u32)>>>>,
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub TYPE_COMPLEXITY,
     complexity,
     "usage of very complex types that might be better factored into `type` definitions"
     /// use std::cell::RefCell
     /// fn foo(interned: Rc<RefCell<i32>>) { ... }
     /// ```
+    #[clippy::version = "1.55.0"]
     pub RC_MUTEX,
     restriction,
     "usage of `Rc<Mutex<T>>`"
index fbf66712261e634685ed3952167b768b733485b3..c886faf5d28c6db974238976cfd344ae872f7d26 100644 (file)
@@ -39,6 +39,7 @@
     /// // Safety: references are guaranteed to be non-null.
     /// let ptr = unsafe { NonNull::new_unchecked(a) };
     /// ```
+    #[clippy::version = "1.58.0"]
     pub UNDOCUMENTED_UNSAFE_BLOCKS,
     restriction,
     "creating an unsafe block without explaining why it is safe"
index 095706165936237e7921422b29c23daa080bd84d..c58fa67a023881c6a74255f5adb80b6bc9204761 100644 (file)
@@ -28,6 +28,7 @@
     ///     std::mem::ManuallyDrop::drop(&mut std::mem::ManuallyDrop::new(S));
     /// }
     /// ```
+    #[clippy::version = "1.49.0"]
     pub UNDROPPED_MANUALLY_DROPS,
     correctness,
     "use of safe `std::mem::drop` function to drop a std::mem::ManuallyDrop, which will not drop the inner value"
index f49ce696a04b77d4832cca91d62f78b12964f72d..a514e8c44e2b6888b2930fa0ae03fa5a452d7c8e 100644 (file)
@@ -20,6 +20,7 @@
     /// ### Example
     /// You don't see it, but there may be a zero-width space or soft hyphen
     /// some­where in this text.
+    #[clippy::version = "1.49.0"]
     pub INVISIBLE_CHARACTERS,
     correctness,
     "using an invisible character in a string literal, which is confusing"
@@ -44,6 +45,7 @@
     /// ```rust
     /// let x = String::from("\u{20ac}");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub NON_ASCII_LITERAL,
     restriction,
     "using any literal non-ASCII chars in a string literal instead of using the `\\u` escape"
@@ -62,6 +64,7 @@
     /// ### Example
     /// You may not see it, but "aÌ€"" and "à"" aren't the same string. The
     /// former when escaped is actually `"a\u{300}"` while the latter is `"\u{e0}"`.
+    #[clippy::version = "pre 1.29.0"]
     pub UNICODE_NOT_NFC,
     pedantic,
     "using a Unicode literal not in NFC normal form (see [Unicode tr15](http://www.unicode.org/reports/tr15/) for further information)"
index f3e8b6881058f93907762baedb2a472ab74fc1bc..46cc76b150e4a20e5f4b63dd85874c38ce57b987 100644 (file)
@@ -52,6 +52,7 @@
     ///    // perform initialization with `remaining`
     ///    vec.set_len(...);  // Safe to call `set_len()` on initialized part
     ///    ```
+    #[clippy::version = "1.58.0"]
     pub UNINIT_VEC,
     correctness,
     "Vec with uninitialized data"
index a3a3f2d41c7323354af7c50b4b7b46ffecd32879..26b4e0f58a870beabd074916fad606a8ceb862da 100644 (file)
@@ -39,6 +39,7 @@
     ///        WithValue(x) => x.hash(&mut state),
     /// }
     /// ```
+    #[clippy::version = "1.58.0"]
     pub UNIT_HASH,
     correctness,
     "hashing a unit value, which does nothing"
index db0f412f2a18c8ebc5302fe2c6419c957d0a9a09..9fb8f2368994a89a2db0dffd348884ea204c5c73 100644 (file)
@@ -30,6 +30,7 @@
     /// let mut twins = vec!((1, 1), (2, 2));
     /// twins.sort_by_key(|x| { x.1; });
     /// ```
+    #[clippy::version = "1.47.0"]
     pub UNIT_RETURN_EXPECTING_ORD,
     correctness,
     "fn arguments of type Fn(...) -> Ord returning the unit type ()."
index 66b1abbe50b9d389bc623fbf3d1324fab541f07b..d9f5b53b413a03dd5734a2edadfa202f7bf7ee98 100644 (file)
@@ -21,6 +21,7 @@
     ///     1;
     /// };
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub LET_UNIT_VALUE,
     pedantic,
     "creating a `let` binding to a value of unit type, which usually can't be used afterwards"
@@ -68,6 +69,7 @@
     /// assert_eq!({ foo(); }, { bar(); });
     /// ```
     /// will always succeed
+    #[clippy::version = "pre 1.29.0"]
     pub UNIT_CMP,
     correctness,
     "comparing unit values"
@@ -88,6 +90,7 @@
     ///     baz(a);
     /// })
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNIT_ARG,
     complexity,
     "passing unit to a function"
index 1eafdee03521c31ea7dac69e7ae7d5906e8b7bad..0bcafde658a43046760479f766987764f8c45902 100644 (file)
@@ -24,6 +24,7 @@
     ///     // ...
     /// }
     /// ```
+    #[clippy::version = "1.44.0"]
     pub FN_ADDRESS_COMPARISONS,
     correctness,
     "comparison with an address of a function item"
@@ -47,6 +48,7 @@
     ///     ...
     /// }
     /// ```
+    #[clippy::version = "1.44.0"]
     pub VTABLE_ADDRESS_COMPARISONS,
     correctness,
     "comparison with an address of a trait vtable"
index 4cfd2df551f1bcda7b80e832309a9b3a8f3b5453..839a4bdab09de36e5a32b4ad335fc66382233be1 100644 (file)
@@ -26,6 +26,7 @@
     /// ```rust
     /// use std::io;
     /// ```
+    #[clippy::version = "1.53.0"]
     pub UNNECESSARY_SELF_IMPORTS,
     restriction,
     "imports ending in `::{self}`, which can be omitted"
index 26b56e0f2f316c69b7e53e9f5f50020f25290c3b..d024577f485317b55bb54acbc35f571bff8bf6d7 100644 (file)
@@ -39,6 +39,7 @@
     /// # let mut vec: Vec<A> = Vec::new();
     /// vec.sort_by_key(|a| a.foo());
     /// ```
+    #[clippy::version = "1.46.0"]
     pub UNNECESSARY_SORT_BY,
     complexity,
     "Use of `Vec::sort_by` when `Vec::sort_by_key` or `Vec::sort` would be clearer"
index fcfa84031776f6c296f87b222b32f1689b83c062..1728533f18b858caeb6b9814f37ff2dcdbbc5e78 100644 (file)
@@ -49,6 +49,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub UNNECESSARY_WRAPS,
     pedantic,
     "functions that only return `Ok` or `Some`"
index d6cf7190abb04959099378856509d1ad4cbe0ea0..0bd151fed91cc57c50c2b0c8ca3a93dd09dd4880 100644 (file)
@@ -39,6 +39,7 @@
     ///     if let Some(0 | 2) = Some(0) {}
     /// }
     /// ```
+    #[clippy::version = "1.46.0"]
     pub UNNESTED_OR_PATTERNS,
     pedantic,
     "unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)`"
index 3c694af2b9deea410fae420b37d0887ab5e7a8f9..44b1989dbc68a4a4eb30b01491b0bc018546235d 100644 (file)
@@ -21,6 +21,7 @@
     /// extern crate crossbeam;
     /// use crossbeam::{spawn_unsafe as spawn};
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNSAFE_REMOVED_FROM_NAME,
     style,
     "`unsafe` removed from API names on import"
index f4808682b69279dc1e4445d7c00770c030748866..1ccb78425c29af05f3415a393603ad08be412012 100644 (file)
@@ -29,6 +29,7 @@
     /// }
     /// let number_future = async { get_random_number_improved() };
     /// ```
+    #[clippy::version = "1.54.0"]
     pub UNUSED_ASYNC,
     pedantic,
     "finds async functions with no await statements"
index 031b182bd2fa0cdb68cad28c905db1ae5376dc6e..d4b5c9770a271200bb0efc997fe7b77a843bc8cc 100644 (file)
@@ -29,6 +29,7 @@
     ///     Ok(())
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNUSED_IO_AMOUNT,
     correctness,
     "unused written/read amount"
index e7e249c79a2fad0f6f97e1a8110d62b41f763029..fd9d5b52e501f318199e5fa94ad9cf55dd79cad6 100644 (file)
@@ -29,6 +29,7 @@
     ///     fn method() {}
     /// }
     /// ```
+    #[clippy::version = "1.40.0"]
     pub UNUSED_SELF,
     pedantic,
     "methods that contain a `self` argument but don't use it"
index 1164ac4938fb6a28edce06017a0c0082869eaa83..48c17fa2a40b25c543143a12dcd3f38a9f2bb633 100644 (file)
@@ -28,6 +28,7 @@
     /// ```rust
     /// fn return_unit() {}
     /// ```
+    #[clippy::version = "1.31.0"]
     pub UNUSED_UNIT,
     style,
     "needless unit expression"
index ebaa9dcbbf85818cbcf8c36e399b0a44074df5cf..9e83cae79bc897480ae06d1e2bb70fa01576d6cf 100644 (file)
@@ -39,6 +39,7 @@
     ///     do_something_with(value)
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub UNNECESSARY_UNWRAP,
     complexity,
     "checks for calls of `unwrap[_err]()` that cannot fail"
@@ -65,6 +66,7 @@
     /// ```
     ///
     /// This code will always panic. The if condition should probably be inverted.
+    #[clippy::version = "pre 1.29.0"]
     pub PANICKING_UNWRAP,
     correctness,
     "checks for calls of `unwrap[_err]()` that will always fail"
index 6447e3fa2ca08a85d04716b6bd1f955ba8f5b931..994df85cb8ac4f7c5130275884a75f12e34491f6 100644 (file)
@@ -51,6 +51,7 @@
     ///     Ok(())
     /// }
     /// ```
+    #[clippy::version = "1.48.0"]
     pub UNWRAP_IN_RESULT,
     restriction,
     "functions of type `Result<..>` or `Option`<...> that contain `expect()` or `unwrap()`"
index dbf335a70c83118eee6fcc88f1829ab6e6baffd8..4773e35076057e0bf32a65a507d5e9c71faf4d79 100644 (file)
@@ -33,6 +33,7 @@
     /// ```rust
     /// struct HttpResponse;
     /// ```
+    #[clippy::version = "1.51.0"]
     pub UPPER_CASE_ACRONYMS,
     style,
     "capitalized acronyms are against the naming convention"
index 09aad296f03787f069702f8900abb09609fca8a0..059f7f647f88f0e0f486a400a4608b6fbf422884 100644 (file)
@@ -51,6 +51,7 @@
     ///     }
     /// }
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USE_SELF,
     nursery,
     "unnecessary structure name repetition whereas `Self` is applicable"
index 88f11542072b849e7920c3893fb0bf0ce713ac49..0e4b32541c97785672a65a8e08eb86eda3ee7135 100644 (file)
@@ -28,6 +28,7 @@
     /// // Good
     /// let s: String = format!("hello");
     /// ```
+    #[clippy::version = "1.45.0"]
     pub USELESS_CONVERSION,
     complexity,
     "calls to `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` which perform useless conversions to the same type"
index d3234b5758a575b2066f57cb673959ef5420ed3b..79e7410c3a8381183f256da06d11fb7a446db435 100644 (file)
@@ -36,6 +36,7 @@ pub struct UselessVec {
     /// // Good
     /// foo(&[1, 2]);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USELESS_VEC,
     perf,
     "useless `vec!`"
index b92b6ca4f4380f981ee9f9ed163d44470994555c..1bc0eb6303c01f692c04d08fdf29f94e86fecf0a 100644 (file)
@@ -27,6 +27,7 @@
     /// ```rust
     /// let v = vec![0];
     /// ```
+    #[clippy::version = "1.51.0"]
     pub VEC_INIT_THEN_PUSH,
     perf,
     "`push` immediately after `Vec` creation"
index 5c0429db6b8dfe5ba6c988675db17b8b2268f6e8..3441d9ccdfa25db333ee7a22456b3eb952ddcb4e 100644 (file)
@@ -20,6 +20,7 @@
     /// ```rust
     /// vec!(1, 2, 3, 4, 5).resize(0, 5)
     /// ```
+    #[clippy::version = "1.46.0"]
     pub VEC_RESIZE_TO_ZERO,
     correctness,
     "emptying a vector with `resize(0, an_int)` instead of `clear()` is probably an argument inversion mistake"
index e07c12f4f16159d16abc6814ca96998d16f15feb..ebdaff1e676b7e187511536f6dca84bc38f58804 100644 (file)
@@ -27,6 +27,7 @@
     /// # use std::fs;
     /// let mut bytes = fs::read("foo.txt").unwrap();
     /// ```
+    #[clippy::version = "1.44.0"]
     pub VERBOSE_FILE_READS,
     restriction,
     "use of `File::read_to_end` or `File::read_to_string`"
index d0c98b6bd798a5a368ef7b1fcb2427bf044c44f5..80d7b8a1b6df559820863c39c0199f9abb88615c 100644 (file)
@@ -20,6 +20,7 @@
     /// [dependencies]
     /// regex = "*"
     /// ```
+    #[clippy::version = "1.32.0"]
     pub WILDCARD_DEPENDENCIES,
     cargo,
     "wildcard dependencies being used"
index 2f3e525fdcfbef4dc7cb7317e259a5d4f38f55cd..832da66a53695c55287ddda2eb3dc1343cab1b0a 100644 (file)
@@ -34,6 +34,7 @@
     /// use std::cmp::Ordering;
     /// foo(Ordering::Less)
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ENUM_GLOB_USE,
     pedantic,
     "use items that import all variants of an enum"
@@ -86,6 +87,7 @@
     ///
     /// foo();
     /// ```
+    #[clippy::version = "1.43.0"]
     pub WILDCARD_IMPORTS,
     pedantic,
     "lint `use _::*` statements"
index 85d1f65c51f0911aaf1ab76ffb36ce496a759536..1b3c15fdf23a182905dc0523bb033d4e7f5f6cf9 100644 (file)
@@ -31,6 +31,7 @@
     /// // Good
     /// println!();
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub PRINTLN_EMPTY_STRING,
     style,
     "using `println!(\"\")` with an empty string"
@@ -55,6 +56,7 @@
     /// # let name = "World";
     /// println!("Hello {}!", name);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub PRINT_WITH_NEWLINE,
     style,
     "using `print!()` with a format string that ends in a single newline"
@@ -76,6 +78,7 @@
     /// ```rust
     /// println!("Hello world!");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub PRINT_STDOUT,
     restriction,
     "printing on stdout"
     /// ```rust
     /// eprintln!("Hello world!");
     /// ```
+    #[clippy::version = "1.50.0"]
     pub PRINT_STDERR,
     restriction,
     "printing on stderr"
     /// # let foo = "bar";
     /// println!("{:?}", foo);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub USE_DEBUG,
     restriction,
     "use of `Debug`-based formatting"
     /// ```rust
     /// println!("foo");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub PRINT_LITERAL,
     style,
     "printing a literal with a format string"
     /// // Good
     /// writeln!(buf);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WRITELN_EMPTY_STRING,
     style,
     "using `writeln!(buf, \"\")` with an empty string"
     /// // Good
     /// writeln!(buf, "Hello {}!", name);
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WRITE_WITH_NEWLINE,
     style,
     "using `write!()` with a format string that ends in a single newline"
     /// // Good
     /// writeln!(buf, "foo");
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub WRITE_LITERAL,
     style,
     "writing a literal with a format string"
index e0746ce4d8121b115f1da360d5b2e9756aaa3c06..641681185a2f60a7ad48d672690b88786f2d8ca5 100644 (file)
@@ -20,6 +20,7 @@
     /// // Good
     /// let nan = f32::NAN;
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub ZERO_DIVIDED_BY_ZERO,
     complexity,
     "usage of `0.0 / 0.0` to obtain NaN instead of `f32::NAN` or `f64::NAN`"
index aa6b2614bbc908ca6e5f7757acfcc30f22348d15..eb8436a501d54b057010db4c95b6f67a68a9452e 100644 (file)
@@ -36,6 +36,7 @@
     ///     todo!();
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub ZERO_SIZED_MAP_VALUES,
     pedantic,
     "usage of map with zero-sized value type"