diff --git a/CHANGELOG.md b/CHANGELOG.md index b6b374e26c96..6351dfc77907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5947,6 +5947,7 @@ Released 2018-09-13 [`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason [`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range [`almost_complete_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_range +[`almost_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_saturating_sub [`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped [`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant [`arbitrary_source_item_ordering`]: https://rust-lang.github.io/rust-clippy/master/index.html#arbitrary_source_item_ordering @@ -6323,7 +6324,9 @@ Released 2018-09-13 [`manual_repeat_n`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [`manual_retain`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [`manual_rotate`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rotate +[`manual_saturating_add`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_add [`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic +[`manual_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_sub [`manual_slice_fill`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [`manual_slice_size_calculation`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_size_calculation [`manual_split_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index dd5c5dcf4d1f..c3ff664f070a 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -208,9 +208,6 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[ crate::impl_hash_with_borrow_str_and_bytes::IMPL_HASH_BORROW_WITH_STR_AND_BYTES_INFO, crate::implicit_hasher::IMPLICIT_HASHER_INFO, crate::implicit_return::IMPLICIT_RETURN_INFO, - crate::implicit_saturating_add::IMPLICIT_SATURATING_ADD_INFO, - crate::implicit_saturating_sub::IMPLICIT_SATURATING_SUB_INFO, - crate::implicit_saturating_sub::INVERTED_SATURATING_SUB_INFO, crate::implied_bounds_in_impls::IMPLIED_BOUNDS_IN_IMPLS_INFO, crate::incompatible_msrv::INCOMPATIBLE_MSRV_INFO, crate::inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR_INFO, @@ -313,6 +310,9 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[ crate::manual_rem_euclid::MANUAL_REM_EUCLID_INFO, crate::manual_retain::MANUAL_RETAIN_INFO, crate::manual_rotate::MANUAL_ROTATE_INFO, + crate::manual_saturating_add::MANUAL_SATURATING_ADD_INFO, + crate::manual_saturating_sub::ALMOST_SATURATING_SUB_INFO, + crate::manual_saturating_sub::MANUAL_SATURATING_SUB_INFO, crate::manual_slice_size_calculation::MANUAL_SLICE_SIZE_CALCULATION_INFO, crate::manual_string_new::MANUAL_STRING_NEW_INFO, crate::manual_strip::MANUAL_STRIP_INFO, diff --git a/clippy_lints/src/deprecated_lints.rs b/clippy_lints/src/deprecated_lints.rs index f087a894d76a..22b04a9b46ef 100644 --- a/clippy_lints/src/deprecated_lints.rs +++ b/clippy_lints/src/deprecated_lints.rs @@ -111,6 +111,10 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [ ("clippy::if_let_redundant_pattern_matching", "clippy::redundant_pattern_matching"), #[clippy::version = ""] ("clippy::if_let_some_result", "clippy::match_result_ok"), + #[clippy::version = "1.91.0"] + ("clippy::implicit_saturating_add", "clippy::manual_saturating_add"), + #[clippy::version = "1.91.0"] + ("clippy::implicit_saturating_sub", "clippy::manual_saturating_sub"), #[clippy::version = ""] ("clippy::incorrect_clone_impl_on_copy_type", "clippy::non_canonical_clone_impl"), #[clippy::version = ""] @@ -127,6 +131,8 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [ ("clippy::invalid_ref", "invalid_value"), #[clippy::version = ""] ("clippy::invalid_utf8_in_unchecked", "invalid_from_utf8_unchecked"), + #[clippy::version = "1.91.0"] + ("clippy::inverted_saturating_sub", "clippy::almost_saturating_sub"), #[clippy::version = ""] ("clippy::let_underscore_drop", "let_underscore_drop"), #[clippy::version = ""] diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index e3168b8cfe02..654dedb01830 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -161,8 +161,6 @@ mod ignored_unit_patterns; mod impl_hash_with_borrow_str_and_bytes; mod implicit_hasher; mod implicit_return; -mod implicit_saturating_add; -mod implicit_saturating_sub; mod implied_bounds_in_impls; mod incompatible_msrv; mod inconsistent_struct_constructor; @@ -222,6 +220,8 @@ mod manual_range_patterns; mod manual_rem_euclid; mod manual_retain; mod manual_rotate; +mod manual_saturating_add; +mod manual_saturating_sub; mod manual_slice_size_calculation; mod manual_string_new; mod manual_strip; @@ -493,7 +493,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co store.register_late_pass(|_| Box::new(unit_return_expecting_ord::UnitReturnExpectingOrd)); store.register_late_pass(|_| Box::new(strings::StringAdd)); store.register_late_pass(|_| Box::new(implicit_return::ImplicitReturn)); - store.register_late_pass(move |_| Box::new(implicit_saturating_sub::ImplicitSaturatingSub::new(conf))); + store.register_late_pass(move |_| Box::new(manual_saturating_sub::ManualSaturatingSub::new(conf))); store.register_late_pass(|_| Box::new(default_numeric_fallback::DefaultNumericFallback)); store.register_late_pass(move |_| { Box::new(inconsistent_struct_constructor::InconsistentStructConstructor::new( @@ -727,7 +727,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co store.register_early_pass(|| Box::new(multi_assignments::MultiAssignments)); store.register_late_pass(|_| Box::new(bool_to_int_with_if::BoolToIntWithIf)); store.register_late_pass(|_| Box::new(box_default::BoxDefault)); - store.register_late_pass(|_| Box::new(implicit_saturating_add::ImplicitSaturatingAdd)); + store.register_late_pass(|_| Box::new(manual_saturating_add::ManualSaturatingAdd)); store.register_early_pass(|| Box::new(partial_pub_fields::PartialPubFields)); store.register_late_pass(|_| Box::new(missing_trait_methods::MissingTraitMethods)); store.register_late_pass(|_| Box::new(from_raw_with_void_ptr::FromRawWithVoidPtr)); diff --git a/clippy_lints/src/implicit_saturating_add.rs b/clippy_lints/src/manual_saturating_add.rs similarity index 95% rename from clippy_lints/src/implicit_saturating_add.rs rename to clippy_lints/src/manual_saturating_add.rs index 4bf3a390b050..17d5ffa86d63 100644 --- a/clippy_lints/src/implicit_saturating_add.rs +++ b/clippy_lints/src/manual_saturating_add.rs @@ -32,13 +32,13 @@ declare_clippy_lint! { /// u = u.saturating_add(1); /// ``` #[clippy::version = "1.66.0"] - pub IMPLICIT_SATURATING_ADD, + pub MANUAL_SATURATING_ADD, style, "Perform saturating addition instead of implicitly checking max bound of data type" } -declare_lint_pass!(ImplicitSaturatingAdd => [IMPLICIT_SATURATING_ADD]); +declare_lint_pass!(ManualSaturatingAdd => [MANUAL_SATURATING_ADD]); -impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingAdd { +impl<'tcx> LateLintPass<'tcx> for ManualSaturatingAdd { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { if let ExprKind::If(cond, then, None) = expr.kind && let Some((c, op_node, l)) = get_const(cx, cond) @@ -84,7 +84,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingAdd { }; span_lint_and_sugg( cx, - IMPLICIT_SATURATING_ADD, + MANUAL_SATURATING_ADD, expr.span, "manual saturating add detected", "use instead", diff --git a/clippy_lints/src/implicit_saturating_sub.rs b/clippy_lints/src/manual_saturating_sub.rs similarity index 96% rename from clippy_lints/src/implicit_saturating_sub.rs rename to clippy_lints/src/manual_saturating_sub.rs index 678a29924e52..e88d2230f70e 100644 --- a/clippy_lints/src/implicit_saturating_sub.rs +++ b/clippy_lints/src/manual_saturating_sub.rs @@ -40,7 +40,7 @@ declare_clippy_lint! { /// i = i.saturating_sub(1); /// ``` #[clippy::version = "1.44.0"] - pub IMPLICIT_SATURATING_SUB, + pub MANUAL_SATURATING_SUB, style, "Perform saturating subtraction instead of implicitly checking lower bound of data type" } @@ -70,24 +70,24 @@ declare_clippy_lint! { /// let result = a.saturating_sub(b); /// ``` #[clippy::version = "1.83.0"] - pub INVERTED_SATURATING_SUB, + pub ALMOST_SATURATING_SUB, correctness, "Check if a variable is smaller than another one and still subtract from it even if smaller" } -pub struct ImplicitSaturatingSub { +pub struct ManualSaturatingSub { msrv: Msrv, } -impl_lint_pass!(ImplicitSaturatingSub => [IMPLICIT_SATURATING_SUB, INVERTED_SATURATING_SUB]); +impl_lint_pass!(ManualSaturatingSub => [MANUAL_SATURATING_SUB, ALMOST_SATURATING_SUB]); -impl ImplicitSaturatingSub { +impl ManualSaturatingSub { pub fn new(conf: &'static Conf) -> Self { Self { msrv: conf.msrv } } } -impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub { +impl<'tcx> LateLintPass<'tcx> for ManualSaturatingSub { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { if expr.span.from_expansion() { return; @@ -249,7 +249,7 @@ fn check_subtraction( ); span_lint_and_sugg( cx, - IMPLICIT_SATURATING_SUB, + MANUAL_SATURATING_SUB, expr_span, "manual arithmetic check found", "replace it with", @@ -265,7 +265,7 @@ fn check_subtraction( let sugg = make_binop(BinOpKind::Sub, &big_expr_sugg, &little_expr_sugg); span_lint_and_then( cx, - INVERTED_SATURATING_SUB, + ALMOST_SATURATING_SUB, condition_span, "inverted arithmetic check before subtraction", |diag| { @@ -386,7 +386,7 @@ fn subtracts_one<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<&'a Exp fn print_lint_and_sugg(cx: &LateContext<'_>, var_name: Symbol, expr: &Expr<'_>) { span_lint_and_sugg( cx, - IMPLICIT_SATURATING_SUB, + MANUAL_SATURATING_SUB, expr.span, "implicitly performing saturating subtraction", "try", diff --git a/tests/ui/manual_abs_diff.fixed b/tests/ui/manual_abs_diff.fixed index 2766942140ce..4c8b14035b3d 100644 --- a/tests/ui/manual_abs_diff.fixed +++ b/tests/ui/manual_abs_diff.fixed @@ -75,7 +75,7 @@ fn fixme() { } } - #[allow(clippy::implicit_saturating_sub)] + #[allow(clippy::manual_saturating_sub)] let _ = if a > b { a - b } else if a < b { diff --git a/tests/ui/manual_abs_diff.rs b/tests/ui/manual_abs_diff.rs index 2c408f2be375..d7a7e4283974 100644 --- a/tests/ui/manual_abs_diff.rs +++ b/tests/ui/manual_abs_diff.rs @@ -85,7 +85,7 @@ fn fixme() { } } - #[allow(clippy::implicit_saturating_sub)] + #[allow(clippy::manual_saturating_sub)] let _ = if a > b { a - b } else if a < b { diff --git a/tests/ui/manual_arithmetic_check-2.rs b/tests/ui/manual_arithmetic_check-2.rs index b094b2021b32..31c67b23a666 100644 --- a/tests/ui/manual_arithmetic_check-2.rs +++ b/tests/ui/manual_arithmetic_check-2.rs @@ -1,5 +1,5 @@ //@no-rustfix -#![warn(clippy::implicit_saturating_sub)] +#![warn(clippy::manual_saturating_sub)] #![allow(arithmetic_overflow)] fn main() { @@ -7,31 +7,31 @@ fn main() { let b = 13u32; let result = if a > b { b - a } else { 0 }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if b < a { b - a } else { 0 }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if a > b { 0 } else { a - b }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if a >= b { 0 } else { a - b }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if b < a { 0 } else { a - b }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if b <= a { 0 } else { a - b }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if b * 2 <= a { 0 } else { a - b * 2 }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if b <= a * 2 { 0 } else { a * 2 - b }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let result = if b + 3 <= a + 2 { 0 } else { (a + 2) - (b + 3) }; - //~^ inverted_saturating_sub + //~^ almost_saturating_sub let af = 12f32; let bf = 13f32; diff --git a/tests/ui/manual_arithmetic_check-2.stderr b/tests/ui/manual_arithmetic_check-2.stderr index fb0f0da772c9..7fc151088085 100644 --- a/tests/ui/manual_arithmetic_check-2.stderr +++ b/tests/ui/manual_arithmetic_check-2.stderr @@ -9,7 +9,7 @@ note: this subtraction underflows when `b < a` | LL | let result = if a > b { b - a } else { 0 }; | ^^^^^ - = note: `#[deny(clippy::inverted_saturating_sub)]` on by default + = note: `#[deny(clippy::almost_saturating_sub)]` on by default error: inverted arithmetic check before subtraction --> tests/ui/manual_arithmetic_check-2.rs:12:23 diff --git a/tests/ui/manual_arithmetic_check.fixed b/tests/ui/manual_arithmetic_check.fixed index 99ed1faf90a6..591271a2f438 100644 --- a/tests/ui/manual_arithmetic_check.fixed +++ b/tests/ui/manual_arithmetic_check.fixed @@ -1,4 +1,4 @@ -#![warn(clippy::implicit_saturating_sub, clippy::inverted_saturating_sub)] +#![warn(clippy::manual_saturating_sub, clippy::almost_saturating_sub)] #![allow(clippy::if_same_then_else)] fn main() { @@ -7,16 +7,16 @@ fn main() { let c = 8u32; let result = a.saturating_sub(b); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let result = a.saturating_sub(b); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let result = a.saturating_sub(b); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let result = a.saturating_sub(b); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub // Should not warn! let result = if a > b { a - b } else { a - c }; diff --git a/tests/ui/manual_arithmetic_check.rs b/tests/ui/manual_arithmetic_check.rs index cf202fa35a6a..f61029e5cf5e 100644 --- a/tests/ui/manual_arithmetic_check.rs +++ b/tests/ui/manual_arithmetic_check.rs @@ -1,4 +1,4 @@ -#![warn(clippy::implicit_saturating_sub, clippy::inverted_saturating_sub)] +#![warn(clippy::manual_saturating_sub, clippy::almost_saturating_sub)] #![allow(clippy::if_same_then_else)] fn main() { @@ -7,16 +7,16 @@ fn main() { let c = 8u32; let result = if a > b { a - b } else { 0 }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let result = if b < a { a - b } else { 0 }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let result = if a < b { 0 } else { a - b }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let result = if b > a { 0 } else { a - b }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub // Should not warn! let result = if a > b { a - b } else { a - c }; diff --git a/tests/ui/manual_arithmetic_check.stderr b/tests/ui/manual_arithmetic_check.stderr index b1598a5d06dc..421a586a1fa7 100644 --- a/tests/ui/manual_arithmetic_check.stderr +++ b/tests/ui/manual_arithmetic_check.stderr @@ -4,8 +4,8 @@ error: manual arithmetic check found LL | let result = if a > b { a - b } else { 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b)` | - = note: `-D clippy::implicit-saturating-sub` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::implicit_saturating_sub)]` + = note: `-D clippy::manual-saturating-sub` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::manual_saturating_sub)]` error: manual arithmetic check found --> tests/ui/manual_arithmetic_check.rs:12:18 diff --git a/tests/ui/implicit_saturating_add.fixed b/tests/ui/manual_saturating_add.fixed similarity index 97% rename from tests/ui/implicit_saturating_add.fixed rename to tests/ui/manual_saturating_add.fixed index 4cf8e3587b61..92e18e12b964 100644 --- a/tests/ui/implicit_saturating_add.fixed +++ b/tests/ui/manual_saturating_add.fixed @@ -1,5 +1,5 @@ #![allow(unused)] -#![warn(clippy::implicit_saturating_add)] +#![warn(clippy::manual_saturating_add)] fn main() { let mut u_8: u8 = 255; diff --git a/tests/ui/implicit_saturating_add.rs b/tests/ui/manual_saturating_add.rs similarity index 69% rename from tests/ui/implicit_saturating_add.rs rename to tests/ui/manual_saturating_add.rs index d9d035bdcd31..f098f8126619 100644 --- a/tests/ui/implicit_saturating_add.rs +++ b/tests/ui/manual_saturating_add.rs @@ -1,5 +1,5 @@ #![allow(unused)] -#![warn(clippy::implicit_saturating_add)] +#![warn(clippy::manual_saturating_add)] fn main() { let mut u_8: u8 = 255; @@ -19,12 +19,12 @@ fn main() { } if u_8 != u8::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_8 += 1; } if u_8 < u8::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_8 += 1; } @@ -33,107 +33,107 @@ fn main() { } if u_16 != u16::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_16 += 1; } if u_16 < u16::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_16 += 1; } if u16::MAX > u_16 { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_16 += 1; } if u_32 != u32::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_32 += 1; } if u_32 < u32::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_32 += 1; } if u32::MAX > u_32 { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_32 += 1; } if u_64 != u64::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_64 += 1; } if u_64 < u64::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_64 += 1; } if u64::MAX > u_64 { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_64 += 1; } if i_8 != i8::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_8 += 1; } if i_8 < i8::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_8 += 1; } if i8::MAX > i_8 { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_8 += 1; } if i_16 != i16::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_16 += 1; } if i_16 < i16::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_16 += 1; } if i16::MAX > i_16 { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_16 += 1; } if i_32 != i32::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_32 += 1; } if i_32 < i32::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_32 += 1; } if i32::MAX > i_32 { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_32 += 1; } if i_64 != i64::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_64 += 1; } if i_64 < i64::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_64 += 1; } if i64::MAX > i_64 { - //~^ implicit_saturating_add + //~^ manual_saturating_add i_64 += 1; } @@ -170,7 +170,7 @@ fn main() { if u_32 < 42 { println!("brace yourself!"); } else if u_32 < u32::MAX { - //~^ implicit_saturating_add + //~^ manual_saturating_add u_32 += 1; } } diff --git a/tests/ui/implicit_saturating_add.stderr b/tests/ui/manual_saturating_add.stderr similarity index 77% rename from tests/ui/implicit_saturating_add.stderr rename to tests/ui/manual_saturating_add.stderr index 8ae7dc4b884b..ec1e7ab1506b 100644 --- a/tests/ui/implicit_saturating_add.stderr +++ b/tests/ui/manual_saturating_add.stderr @@ -1,5 +1,5 @@ error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:21:5 + --> tests/ui/manual_saturating_add.rs:21:5 | LL | / if u_8 != u8::MAX { LL | | @@ -7,11 +7,11 @@ LL | | u_8 += 1; LL | | } | |_____^ help: use instead: `u_8 = u_8.saturating_add(1);` | - = note: `-D clippy::implicit-saturating-add` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::implicit_saturating_add)]` + = note: `-D clippy::manual-saturating-add` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::manual_saturating_add)]` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:26:5 + --> tests/ui/manual_saturating_add.rs:26:5 | LL | / if u_8 < u8::MAX { LL | | @@ -20,7 +20,7 @@ LL | | } | |_____^ help: use instead: `u_8 = u_8.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:35:5 + --> tests/ui/manual_saturating_add.rs:35:5 | LL | / if u_16 != u16::MAX { LL | | @@ -29,7 +29,7 @@ LL | | } | |_____^ help: use instead: `u_16 = u_16.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:40:5 + --> tests/ui/manual_saturating_add.rs:40:5 | LL | / if u_16 < u16::MAX { LL | | @@ -38,7 +38,7 @@ LL | | } | |_____^ help: use instead: `u_16 = u_16.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:45:5 + --> tests/ui/manual_saturating_add.rs:45:5 | LL | / if u16::MAX > u_16 { LL | | @@ -47,7 +47,7 @@ LL | | } | |_____^ help: use instead: `u_16 = u_16.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:50:5 + --> tests/ui/manual_saturating_add.rs:50:5 | LL | / if u_32 != u32::MAX { LL | | @@ -56,7 +56,7 @@ LL | | } | |_____^ help: use instead: `u_32 = u_32.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:55:5 + --> tests/ui/manual_saturating_add.rs:55:5 | LL | / if u_32 < u32::MAX { LL | | @@ -65,7 +65,7 @@ LL | | } | |_____^ help: use instead: `u_32 = u_32.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:60:5 + --> tests/ui/manual_saturating_add.rs:60:5 | LL | / if u32::MAX > u_32 { LL | | @@ -74,7 +74,7 @@ LL | | } | |_____^ help: use instead: `u_32 = u_32.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:65:5 + --> tests/ui/manual_saturating_add.rs:65:5 | LL | / if u_64 != u64::MAX { LL | | @@ -83,7 +83,7 @@ LL | | } | |_____^ help: use instead: `u_64 = u_64.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:70:5 + --> tests/ui/manual_saturating_add.rs:70:5 | LL | / if u_64 < u64::MAX { LL | | @@ -92,7 +92,7 @@ LL | | } | |_____^ help: use instead: `u_64 = u_64.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:75:5 + --> tests/ui/manual_saturating_add.rs:75:5 | LL | / if u64::MAX > u_64 { LL | | @@ -101,7 +101,7 @@ LL | | } | |_____^ help: use instead: `u_64 = u_64.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:80:5 + --> tests/ui/manual_saturating_add.rs:80:5 | LL | / if i_8 != i8::MAX { LL | | @@ -110,7 +110,7 @@ LL | | } | |_____^ help: use instead: `i_8 = i_8.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:85:5 + --> tests/ui/manual_saturating_add.rs:85:5 | LL | / if i_8 < i8::MAX { LL | | @@ -119,7 +119,7 @@ LL | | } | |_____^ help: use instead: `i_8 = i_8.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:90:5 + --> tests/ui/manual_saturating_add.rs:90:5 | LL | / if i8::MAX > i_8 { LL | | @@ -128,7 +128,7 @@ LL | | } | |_____^ help: use instead: `i_8 = i_8.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:95:5 + --> tests/ui/manual_saturating_add.rs:95:5 | LL | / if i_16 != i16::MAX { LL | | @@ -137,7 +137,7 @@ LL | | } | |_____^ help: use instead: `i_16 = i_16.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:100:5 + --> tests/ui/manual_saturating_add.rs:100:5 | LL | / if i_16 < i16::MAX { LL | | @@ -146,7 +146,7 @@ LL | | } | |_____^ help: use instead: `i_16 = i_16.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:105:5 + --> tests/ui/manual_saturating_add.rs:105:5 | LL | / if i16::MAX > i_16 { LL | | @@ -155,7 +155,7 @@ LL | | } | |_____^ help: use instead: `i_16 = i_16.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:110:5 + --> tests/ui/manual_saturating_add.rs:110:5 | LL | / if i_32 != i32::MAX { LL | | @@ -164,7 +164,7 @@ LL | | } | |_____^ help: use instead: `i_32 = i_32.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:115:5 + --> tests/ui/manual_saturating_add.rs:115:5 | LL | / if i_32 < i32::MAX { LL | | @@ -173,7 +173,7 @@ LL | | } | |_____^ help: use instead: `i_32 = i_32.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:120:5 + --> tests/ui/manual_saturating_add.rs:120:5 | LL | / if i32::MAX > i_32 { LL | | @@ -182,7 +182,7 @@ LL | | } | |_____^ help: use instead: `i_32 = i_32.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:125:5 + --> tests/ui/manual_saturating_add.rs:125:5 | LL | / if i_64 != i64::MAX { LL | | @@ -191,7 +191,7 @@ LL | | } | |_____^ help: use instead: `i_64 = i_64.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:130:5 + --> tests/ui/manual_saturating_add.rs:130:5 | LL | / if i_64 < i64::MAX { LL | | @@ -200,7 +200,7 @@ LL | | } | |_____^ help: use instead: `i_64 = i_64.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:135:5 + --> tests/ui/manual_saturating_add.rs:135:5 | LL | / if i64::MAX > i_64 { LL | | @@ -209,7 +209,7 @@ LL | | } | |_____^ help: use instead: `i_64 = i_64.saturating_add(1);` error: manual saturating add detected - --> tests/ui/implicit_saturating_add.rs:172:12 + --> tests/ui/manual_saturating_add.rs:172:12 | LL | } else if u_32 < u32::MAX { | ____________^ diff --git a/tests/ui/implicit_saturating_sub.fixed b/tests/ui/manual_saturating_sub.fixed similarity index 96% rename from tests/ui/implicit_saturating_sub.fixed rename to tests/ui/manual_saturating_sub.fixed index 1aab6c54407e..2d95d347e761 100644 --- a/tests/ui/implicit_saturating_sub.fixed +++ b/tests/ui/manual_saturating_sub.fixed @@ -1,5 +1,5 @@ #![allow(unused_assignments, unused_mut, clippy::assign_op_pattern)] -#![warn(clippy::implicit_saturating_sub)] +#![warn(clippy::manual_saturating_sub)] use std::cmp::PartialEq; use std::ops::SubAssign; @@ -238,13 +238,13 @@ fn arbitrary_expression() { let (a, b) = (15u64, 20u64); let _ = (a * 2).saturating_sub(b); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let _ = a.saturating_sub(b * 2); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let _ = a.saturating_sub(b * 2); - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let _ = if with_side_effect(a) > a { with_side_effect(a) - a diff --git a/tests/ui/implicit_saturating_sub.rs b/tests/ui/manual_saturating_sub.rs similarity index 81% rename from tests/ui/implicit_saturating_sub.rs rename to tests/ui/manual_saturating_sub.rs index 7ca57a2902db..a22c73cdce29 100644 --- a/tests/ui/implicit_saturating_sub.rs +++ b/tests/ui/manual_saturating_sub.rs @@ -1,5 +1,5 @@ #![allow(unused_assignments, unused_mut, clippy::assign_op_pattern)] -#![warn(clippy::implicit_saturating_sub)] +#![warn(clippy::manual_saturating_sub)] use std::cmp::PartialEq; use std::ops::SubAssign; @@ -25,7 +25,7 @@ fn main() { // Lint if u_8 > 0 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_8 = u_8 - 1; } @@ -33,7 +33,7 @@ fn main() { 10 => { // Lint if u_8 > 0 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_8 -= 1; } }, @@ -48,7 +48,7 @@ fn main() { // Lint if u_16 > 0 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_16 -= 1; } @@ -59,7 +59,7 @@ fn main() { // Lint if u_32 != 0 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_32 -= 1; } @@ -81,19 +81,19 @@ fn main() { // Lint if u_64 > 0 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_64 -= 1; } // Lint if 0 < u_64 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_64 -= 1; } // Lint if 0 != u_64 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_64 -= 1; } @@ -115,7 +115,7 @@ fn main() { // Lint if u_usize > 0 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub u_usize -= 1; } @@ -128,25 +128,25 @@ fn main() { // Lint if i_8 > i8::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_8 -= 1; } // Lint if i_8 > i8::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_8 -= 1; } // Lint if i_8 != i8::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_8 -= 1; } // Lint if i_8 != i8::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_8 -= 1; } @@ -157,25 +157,25 @@ fn main() { // Lint if i_16 > i16::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_16 -= 1; } // Lint if i_16 > i16::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_16 -= 1; } // Lint if i_16 != i16::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_16 -= 1; } // Lint if i_16 != i16::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_16 -= 1; } @@ -186,25 +186,25 @@ fn main() { // Lint if i_32 > i32::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_32 -= 1; } // Lint if i_32 > i32::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_32 -= 1; } // Lint if i_32 != i32::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_32 -= 1; } // Lint if i_32 != i32::MIN { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_32 -= 1; } @@ -215,19 +215,19 @@ fn main() { // Lint if i64::MIN < i_64 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_64 -= 1; } // Lint if i64::MIN != i_64 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_64 -= 1; } // Lint if i64::MIN < i_64 { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub i_64 -= 1; } @@ -296,7 +296,7 @@ fn regression_13524(a: usize, b: usize, c: bool) -> usize { if c { 123 } else if a >= b { - //~^ implicit_saturating_sub + //~^ manual_saturating_sub 0 } else { b - a @@ -312,13 +312,13 @@ fn arbitrary_expression() { let (a, b) = (15u64, 20u64); let _ = if a * 2 > b { a * 2 - b } else { 0 }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let _ = if a > b * 2 { a - b * 2 } else { 0 }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let _ = if a < b * 2 { 0 } else { a - b * 2 }; - //~^ implicit_saturating_sub + //~^ manual_saturating_sub let _ = if with_side_effect(a) > a { with_side_effect(a) - a diff --git a/tests/ui/implicit_saturating_sub.stderr b/tests/ui/manual_saturating_sub.stderr similarity index 78% rename from tests/ui/implicit_saturating_sub.stderr rename to tests/ui/manual_saturating_sub.stderr index 0c225856fd07..0754fbc23d60 100644 --- a/tests/ui/implicit_saturating_sub.stderr +++ b/tests/ui/manual_saturating_sub.stderr @@ -1,5 +1,5 @@ error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:27:5 + --> tests/ui/manual_saturating_sub.rs:27:5 | LL | / if u_8 > 0 { LL | | @@ -7,11 +7,11 @@ LL | | u_8 = u_8 - 1; LL | | } | |_____^ help: try: `u_8 = u_8.saturating_sub(1);` | - = note: `-D clippy::implicit-saturating-sub` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::implicit_saturating_sub)]` + = note: `-D clippy::manual-saturating-sub` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::manual_saturating_sub)]` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:35:13 + --> tests/ui/manual_saturating_sub.rs:35:13 | LL | / if u_8 > 0 { LL | | @@ -20,7 +20,7 @@ LL | | } | |_____________^ help: try: `u_8 = u_8.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:50:5 + --> tests/ui/manual_saturating_sub.rs:50:5 | LL | / if u_16 > 0 { LL | | @@ -29,7 +29,7 @@ LL | | } | |_____^ help: try: `u_16 = u_16.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:61:5 + --> tests/ui/manual_saturating_sub.rs:61:5 | LL | / if u_32 != 0 { LL | | @@ -38,7 +38,7 @@ LL | | } | |_____^ help: try: `u_32 = u_32.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:83:5 + --> tests/ui/manual_saturating_sub.rs:83:5 | LL | / if u_64 > 0 { LL | | @@ -47,7 +47,7 @@ LL | | } | |_____^ help: try: `u_64 = u_64.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:89:5 + --> tests/ui/manual_saturating_sub.rs:89:5 | LL | / if 0 < u_64 { LL | | @@ -56,7 +56,7 @@ LL | | } | |_____^ help: try: `u_64 = u_64.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:95:5 + --> tests/ui/manual_saturating_sub.rs:95:5 | LL | / if 0 != u_64 { LL | | @@ -65,7 +65,7 @@ LL | | } | |_____^ help: try: `u_64 = u_64.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:117:5 + --> tests/ui/manual_saturating_sub.rs:117:5 | LL | / if u_usize > 0 { LL | | @@ -74,7 +74,7 @@ LL | | } | |_____^ help: try: `u_usize = u_usize.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:130:5 + --> tests/ui/manual_saturating_sub.rs:130:5 | LL | / if i_8 > i8::MIN { LL | | @@ -83,7 +83,7 @@ LL | | } | |_____^ help: try: `i_8 = i_8.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:136:5 + --> tests/ui/manual_saturating_sub.rs:136:5 | LL | / if i_8 > i8::MIN { LL | | @@ -92,7 +92,7 @@ LL | | } | |_____^ help: try: `i_8 = i_8.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:142:5 + --> tests/ui/manual_saturating_sub.rs:142:5 | LL | / if i_8 != i8::MIN { LL | | @@ -101,7 +101,7 @@ LL | | } | |_____^ help: try: `i_8 = i_8.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:148:5 + --> tests/ui/manual_saturating_sub.rs:148:5 | LL | / if i_8 != i8::MIN { LL | | @@ -110,7 +110,7 @@ LL | | } | |_____^ help: try: `i_8 = i_8.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:159:5 + --> tests/ui/manual_saturating_sub.rs:159:5 | LL | / if i_16 > i16::MIN { LL | | @@ -119,7 +119,7 @@ LL | | } | |_____^ help: try: `i_16 = i_16.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:165:5 + --> tests/ui/manual_saturating_sub.rs:165:5 | LL | / if i_16 > i16::MIN { LL | | @@ -128,7 +128,7 @@ LL | | } | |_____^ help: try: `i_16 = i_16.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:171:5 + --> tests/ui/manual_saturating_sub.rs:171:5 | LL | / if i_16 != i16::MIN { LL | | @@ -137,7 +137,7 @@ LL | | } | |_____^ help: try: `i_16 = i_16.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:177:5 + --> tests/ui/manual_saturating_sub.rs:177:5 | LL | / if i_16 != i16::MIN { LL | | @@ -146,7 +146,7 @@ LL | | } | |_____^ help: try: `i_16 = i_16.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:188:5 + --> tests/ui/manual_saturating_sub.rs:188:5 | LL | / if i_32 > i32::MIN { LL | | @@ -155,7 +155,7 @@ LL | | } | |_____^ help: try: `i_32 = i_32.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:194:5 + --> tests/ui/manual_saturating_sub.rs:194:5 | LL | / if i_32 > i32::MIN { LL | | @@ -164,7 +164,7 @@ LL | | } | |_____^ help: try: `i_32 = i_32.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:200:5 + --> tests/ui/manual_saturating_sub.rs:200:5 | LL | / if i_32 != i32::MIN { LL | | @@ -173,7 +173,7 @@ LL | | } | |_____^ help: try: `i_32 = i_32.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:206:5 + --> tests/ui/manual_saturating_sub.rs:206:5 | LL | / if i_32 != i32::MIN { LL | | @@ -182,7 +182,7 @@ LL | | } | |_____^ help: try: `i_32 = i_32.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:217:5 + --> tests/ui/manual_saturating_sub.rs:217:5 | LL | / if i64::MIN < i_64 { LL | | @@ -191,7 +191,7 @@ LL | | } | |_____^ help: try: `i_64 = i_64.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:223:5 + --> tests/ui/manual_saturating_sub.rs:223:5 | LL | / if i64::MIN != i_64 { LL | | @@ -200,7 +200,7 @@ LL | | } | |_____^ help: try: `i_64 = i_64.saturating_sub(1);` error: implicitly performing saturating subtraction - --> tests/ui/implicit_saturating_sub.rs:229:5 + --> tests/ui/manual_saturating_sub.rs:229:5 | LL | / if i64::MIN < i_64 { LL | | @@ -209,7 +209,7 @@ LL | | } | |_____^ help: try: `i_64 = i_64.saturating_sub(1);` error: manual arithmetic check found - --> tests/ui/implicit_saturating_sub.rs:298:12 + --> tests/ui/manual_saturating_sub.rs:298:12 | LL | } else if a >= b { | ____________^ @@ -221,19 +221,19 @@ LL | | } | |_____^ help: replace it with: `{ b.saturating_sub(a) }` error: manual arithmetic check found - --> tests/ui/implicit_saturating_sub.rs:314:13 + --> tests/ui/manual_saturating_sub.rs:314:13 | LL | let _ = if a * 2 > b { a * 2 - b } else { 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `(a * 2).saturating_sub(b)` error: manual arithmetic check found - --> tests/ui/implicit_saturating_sub.rs:317:13 + --> tests/ui/manual_saturating_sub.rs:317:13 | LL | let _ = if a > b * 2 { a - b * 2 } else { 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b * 2)` error: manual arithmetic check found - --> tests/ui/implicit_saturating_sub.rs:320:13 + --> tests/ui/manual_saturating_sub.rs:320:13 | LL | let _ = if a < b * 2 { 0 } else { a - b * 2 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b * 2)` diff --git a/tests/ui/rename.fixed b/tests/ui/rename.fixed index fdd851414746..2d036f29a20f 100644 --- a/tests/ui/rename.fixed +++ b/tests/ui/rename.fixed @@ -30,6 +30,8 @@ #![allow(clippy::useless_conversion)] #![allow(clippy::redundant_pattern_matching)] #![allow(clippy::match_result_ok)] +#![allow(clippy::manual_saturating_add)] +#![allow(clippy::manual_saturating_sub)] #![allow(clippy::non_canonical_clone_impl)] #![allow(clippy::non_canonical_partial_ord_impl)] #![allow(clippy::arithmetic_side_effects)] @@ -38,6 +40,7 @@ #![allow(invalid_null_arguments)] #![allow(invalid_value)] #![allow(invalid_from_utf8_unchecked)] +#![allow(clippy::almost_saturating_sub)] #![allow(let_underscore_drop)] #![allow(clippy::overly_complex_bool_expr)] #![allow(unexpected_cfgs)] @@ -96,6 +99,8 @@ #![warn(clippy::useless_conversion)] //~ ERROR: lint `clippy::identity_conversion` #![warn(clippy::redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching` #![warn(clippy::match_result_ok)] //~ ERROR: lint `clippy::if_let_some_result` +#![warn(clippy::manual_saturating_add)] //~ ERROR: lint `clippy::implicit_saturating_add` +#![warn(clippy::manual_saturating_sub)] //~ ERROR: lint `clippy::implicit_saturating_sub` #![warn(clippy::non_canonical_clone_impl)] //~ ERROR: lint `clippy::incorrect_clone_impl_on_copy_type` #![warn(clippy::non_canonical_partial_ord_impl)] //~ ERROR: lint `clippy::incorrect_partial_ord_impl_on_ord_type` #![warn(clippy::arithmetic_side_effects)] //~ ERROR: lint `clippy::integer_arithmetic` @@ -104,6 +109,7 @@ #![warn(invalid_null_arguments)] //~ ERROR: lint `clippy::invalid_null_ptr_usage` #![warn(invalid_value)] //~ ERROR: lint `clippy::invalid_ref` #![warn(invalid_from_utf8_unchecked)] //~ ERROR: lint `clippy::invalid_utf8_in_unchecked` +#![warn(clippy::almost_saturating_sub)] //~ ERROR: lint `clippy::inverted_saturating_sub` #![warn(let_underscore_drop)] //~ ERROR: lint `clippy::let_underscore_drop` #![warn(clippy::overly_complex_bool_expr)] //~ ERROR: lint `clippy::logic_bug` #![warn(unexpected_cfgs)] //~ ERROR: lint `clippy::maybe_misused_cfg` diff --git a/tests/ui/rename.rs b/tests/ui/rename.rs index 591c8ca53ac2..c62d7753cf5e 100644 --- a/tests/ui/rename.rs +++ b/tests/ui/rename.rs @@ -30,6 +30,8 @@ #![allow(clippy::useless_conversion)] #![allow(clippy::redundant_pattern_matching)] #![allow(clippy::match_result_ok)] +#![allow(clippy::manual_saturating_add)] +#![allow(clippy::manual_saturating_sub)] #![allow(clippy::non_canonical_clone_impl)] #![allow(clippy::non_canonical_partial_ord_impl)] #![allow(clippy::arithmetic_side_effects)] @@ -38,6 +40,7 @@ #![allow(invalid_null_arguments)] #![allow(invalid_value)] #![allow(invalid_from_utf8_unchecked)] +#![allow(clippy::almost_saturating_sub)] #![allow(let_underscore_drop)] #![allow(clippy::overly_complex_bool_expr)] #![allow(unexpected_cfgs)] @@ -96,6 +99,8 @@ #![warn(clippy::identity_conversion)] //~ ERROR: lint `clippy::identity_conversion` #![warn(clippy::if_let_redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching` #![warn(clippy::if_let_some_result)] //~ ERROR: lint `clippy::if_let_some_result` +#![warn(clippy::implicit_saturating_add)] //~ ERROR: lint `clippy::implicit_saturating_add` +#![warn(clippy::implicit_saturating_sub)] //~ ERROR: lint `clippy::implicit_saturating_sub` #![warn(clippy::incorrect_clone_impl_on_copy_type)] //~ ERROR: lint `clippy::incorrect_clone_impl_on_copy_type` #![warn(clippy::incorrect_partial_ord_impl_on_ord_type)] //~ ERROR: lint `clippy::incorrect_partial_ord_impl_on_ord_type` #![warn(clippy::integer_arithmetic)] //~ ERROR: lint `clippy::integer_arithmetic` @@ -104,6 +109,7 @@ #![warn(clippy::invalid_null_ptr_usage)] //~ ERROR: lint `clippy::invalid_null_ptr_usage` #![warn(clippy::invalid_ref)] //~ ERROR: lint `clippy::invalid_ref` #![warn(clippy::invalid_utf8_in_unchecked)] //~ ERROR: lint `clippy::invalid_utf8_in_unchecked` +#![warn(clippy::inverted_saturating_sub)] //~ ERROR: lint `clippy::inverted_saturating_sub` #![warn(clippy::let_underscore_drop)] //~ ERROR: lint `clippy::let_underscore_drop` #![warn(clippy::logic_bug)] //~ ERROR: lint `clippy::logic_bug` #![warn(clippy::maybe_misused_cfg)] //~ ERROR: lint `clippy::maybe_misused_cfg` diff --git a/tests/ui/rename.stderr b/tests/ui/rename.stderr index b54fec8c5794..66222d8c4b7e 100644 --- a/tests/ui/rename.stderr +++ b/tests/ui/rename.stderr @@ -1,5 +1,5 @@ error: lint `clippy::almost_complete_letter_range` has been renamed to `clippy::almost_complete_range` - --> tests/ui/rename.rs:68:9 + --> tests/ui/rename.rs:71:9 | LL | #![warn(clippy::almost_complete_letter_range)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::almost_complete_range` @@ -8,442 +8,460 @@ LL | #![warn(clippy::almost_complete_letter_range)] = help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]` error: lint `clippy::blacklisted_name` has been renamed to `clippy::disallowed_names` - --> tests/ui/rename.rs:69:9 + --> tests/ui/rename.rs:72:9 | LL | #![warn(clippy::blacklisted_name)] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_names` error: lint `clippy::block_in_if_condition_expr` has been renamed to `clippy::blocks_in_conditions` - --> tests/ui/rename.rs:70:9 + --> tests/ui/rename.rs:73:9 | LL | #![warn(clippy::block_in_if_condition_expr)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions` error: lint `clippy::block_in_if_condition_stmt` has been renamed to `clippy::blocks_in_conditions` - --> tests/ui/rename.rs:71:9 + --> tests/ui/rename.rs:74:9 | LL | #![warn(clippy::block_in_if_condition_stmt)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions` error: lint `clippy::blocks_in_if_conditions` has been renamed to `clippy::blocks_in_conditions` - --> tests/ui/rename.rs:72:9 + --> tests/ui/rename.rs:75:9 | LL | #![warn(clippy::blocks_in_if_conditions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions` error: lint `clippy::box_vec` has been renamed to `clippy::box_collection` - --> tests/ui/rename.rs:73:9 + --> tests/ui/rename.rs:76:9 | LL | #![warn(clippy::box_vec)] | ^^^^^^^^^^^^^^^ help: use the new name: `clippy::box_collection` error: lint `clippy::cast_ref_to_mut` has been renamed to `invalid_reference_casting` - --> tests/ui/rename.rs:74:9 + --> tests/ui/rename.rs:77:9 | LL | #![warn(clippy::cast_ref_to_mut)] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_reference_casting` error: lint `clippy::clone_double_ref` has been renamed to `suspicious_double_ref_op` - --> tests/ui/rename.rs:75:9 + --> tests/ui/rename.rs:78:9 | LL | #![warn(clippy::clone_double_ref)] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `suspicious_double_ref_op` error: lint `clippy::cmp_nan` has been renamed to `invalid_nan_comparisons` - --> tests/ui/rename.rs:76:9 + --> tests/ui/rename.rs:79:9 | LL | #![warn(clippy::cmp_nan)] | ^^^^^^^^^^^^^^^ help: use the new name: `invalid_nan_comparisons` error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes` - --> tests/ui/rename.rs:77:9 + --> tests/ui/rename.rs:80:9 | LL | #![warn(clippy::const_static_lifetime)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes` error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity` - --> tests/ui/rename.rs:78:9 + --> tests/ui/rename.rs:81:9 | LL | #![warn(clippy::cyclomatic_complexity)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity` error: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq` - --> tests/ui/rename.rs:79:9 + --> tests/ui/rename.rs:82:9 | LL | #![warn(clippy::derive_hash_xor_eq)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq` error: lint `clippy::disallowed_method` has been renamed to `clippy::disallowed_methods` - --> tests/ui/rename.rs:80:9 + --> tests/ui/rename.rs:83:9 | LL | #![warn(clippy::disallowed_method)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_methods` error: lint `clippy::disallowed_type` has been renamed to `clippy::disallowed_types` - --> tests/ui/rename.rs:81:9 + --> tests/ui/rename.rs:84:9 | LL | #![warn(clippy::disallowed_type)] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_types` error: lint `clippy::double_neg` has been renamed to `double_negations` - --> tests/ui/rename.rs:82:9 + --> tests/ui/rename.rs:85:9 | LL | #![warn(clippy::double_neg)] | ^^^^^^^^^^^^^^^^^^ help: use the new name: `double_negations` error: lint `clippy::drop_bounds` has been renamed to `drop_bounds` - --> tests/ui/rename.rs:83:9 + --> tests/ui/rename.rs:86:9 | LL | #![warn(clippy::drop_bounds)] | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds` error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types` - --> tests/ui/rename.rs:84:9 + --> tests/ui/rename.rs:87:9 | LL | #![warn(clippy::drop_copy)] | ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types` error: lint `clippy::drop_ref` has been renamed to `dropping_references` - --> tests/ui/rename.rs:85:9 + --> tests/ui/rename.rs:88:9 | LL | #![warn(clippy::drop_ref)] | ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references` error: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_read_write_in_expression` - --> tests/ui/rename.rs:86:9 + --> tests/ui/rename.rs:89:9 | LL | #![warn(clippy::eval_order_dependence)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression` error: lint `clippy::filter_map` has been renamed to `clippy::manual_filter_map` - --> tests/ui/rename.rs:87:9 + --> tests/ui/rename.rs:90:9 | LL | #![warn(clippy::filter_map)] | ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_filter_map` error: lint `clippy::find_map` has been renamed to `clippy::manual_find_map` - --> tests/ui/rename.rs:88:9 + --> tests/ui/rename.rs:91:9 | LL | #![warn(clippy::find_map)] | ^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_find_map` error: lint `clippy::fn_address_comparisons` has been renamed to `unpredictable_function_pointer_comparisons` - --> tests/ui/rename.rs:89:9 + --> tests/ui/rename.rs:92:9 | LL | #![warn(clippy::fn_address_comparisons)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unpredictable_function_pointer_comparisons` error: lint `clippy::fn_null_check` has been renamed to `useless_ptr_null_checks` - --> tests/ui/rename.rs:90:9 + --> tests/ui/rename.rs:93:9 | LL | #![warn(clippy::fn_null_check)] | ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `useless_ptr_null_checks` error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles` - --> tests/ui/rename.rs:91:9 + --> tests/ui/rename.rs:94:9 | LL | #![warn(clippy::for_loop_over_option)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` error: lint `clippy::for_loop_over_result` has been renamed to `for_loops_over_fallibles` - --> tests/ui/rename.rs:92:9 + --> tests/ui/rename.rs:95:9 | LL | #![warn(clippy::for_loop_over_result)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_over_fallibles` - --> tests/ui/rename.rs:93:9 + --> tests/ui/rename.rs:96:9 | LL | #![warn(clippy::for_loops_over_fallibles)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types` - --> tests/ui/rename.rs:94:9 + --> tests/ui/rename.rs:97:9 | LL | #![warn(clippy::forget_copy)] | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types` error: lint `clippy::forget_ref` has been renamed to `forgetting_references` - --> tests/ui/rename.rs:95:9 + --> tests/ui/rename.rs:98:9 | LL | #![warn(clippy::forget_ref)] | ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references` error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion` - --> tests/ui/rename.rs:96:9 + --> tests/ui/rename.rs:99:9 | LL | #![warn(clippy::identity_conversion)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion` error: lint `clippy::if_let_redundant_pattern_matching` has been renamed to `clippy::redundant_pattern_matching` - --> tests/ui/rename.rs:97:9 + --> tests/ui/rename.rs:100:9 | LL | #![warn(clippy::if_let_redundant_pattern_matching)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_pattern_matching` error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok` - --> tests/ui/rename.rs:98:9 + --> tests/ui/rename.rs:101:9 | LL | #![warn(clippy::if_let_some_result)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok` +error: lint `clippy::implicit_saturating_add` has been renamed to `clippy::manual_saturating_add` + --> tests/ui/rename.rs:102:9 + | +LL | #![warn(clippy::implicit_saturating_add)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_saturating_add` + +error: lint `clippy::implicit_saturating_sub` has been renamed to `clippy::manual_saturating_sub` + --> tests/ui/rename.rs:103:9 + | +LL | #![warn(clippy::implicit_saturating_sub)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_saturating_sub` + error: lint `clippy::incorrect_clone_impl_on_copy_type` has been renamed to `clippy::non_canonical_clone_impl` - --> tests/ui/rename.rs:99:9 + --> tests/ui/rename.rs:104:9 | LL | #![warn(clippy::incorrect_clone_impl_on_copy_type)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_clone_impl` error: lint `clippy::incorrect_partial_ord_impl_on_ord_type` has been renamed to `clippy::non_canonical_partial_ord_impl` - --> tests/ui/rename.rs:100:9 + --> tests/ui/rename.rs:105:9 | LL | #![warn(clippy::incorrect_partial_ord_impl_on_ord_type)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_partial_ord_impl` error: lint `clippy::integer_arithmetic` has been renamed to `clippy::arithmetic_side_effects` - --> tests/ui/rename.rs:101:9 + --> tests/ui/rename.rs:106:9 | LL | #![warn(clippy::integer_arithmetic)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::arithmetic_side_effects` error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter` - --> tests/ui/rename.rs:102:9 + --> tests/ui/rename.rs:107:9 | LL | #![warn(clippy::into_iter_on_array)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter` error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering` - --> tests/ui/rename.rs:103:9 + --> tests/ui/rename.rs:108:9 | LL | #![warn(clippy::invalid_atomic_ordering)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering` error: lint `clippy::invalid_null_ptr_usage` has been renamed to `invalid_null_arguments` - --> tests/ui/rename.rs:104:9 + --> tests/ui/rename.rs:109:9 | LL | #![warn(clippy::invalid_null_ptr_usage)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_null_arguments` error: lint `clippy::invalid_ref` has been renamed to `invalid_value` - --> tests/ui/rename.rs:105:9 + --> tests/ui/rename.rs:110:9 | LL | #![warn(clippy::invalid_ref)] | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value` error: lint `clippy::invalid_utf8_in_unchecked` has been renamed to `invalid_from_utf8_unchecked` - --> tests/ui/rename.rs:106:9 + --> tests/ui/rename.rs:111:9 | LL | #![warn(clippy::invalid_utf8_in_unchecked)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_from_utf8_unchecked` +error: lint `clippy::inverted_saturating_sub` has been renamed to `clippy::almost_saturating_sub` + --> tests/ui/rename.rs:112:9 + | +LL | #![warn(clippy::inverted_saturating_sub)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::almost_saturating_sub` + error: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop` - --> tests/ui/rename.rs:107:9 + --> tests/ui/rename.rs:113:9 | LL | #![warn(clippy::let_underscore_drop)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop` error: lint `clippy::logic_bug` has been renamed to `clippy::overly_complex_bool_expr` - --> tests/ui/rename.rs:108:9 + --> tests/ui/rename.rs:114:9 | LL | #![warn(clippy::logic_bug)] | ^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::overly_complex_bool_expr` error: lint `clippy::maybe_misused_cfg` has been renamed to `unexpected_cfgs` - --> tests/ui/rename.rs:109:9 + --> tests/ui/rename.rs:115:9 | LL | #![warn(clippy::maybe_misused_cfg)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs` error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums` - --> tests/ui/rename.rs:110:9 + --> tests/ui/rename.rs:116:9 | LL | #![warn(clippy::mem_discriminant_non_enum)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums` error: lint `clippy::mismatched_target_os` has been renamed to `unexpected_cfgs` - --> tests/ui/rename.rs:111:9 + --> tests/ui/rename.rs:117:9 | LL | #![warn(clippy::mismatched_target_os)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs` error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default` - --> tests/ui/rename.rs:112:9 + --> tests/ui/rename.rs:118:9 | LL | #![warn(clippy::new_without_default_derive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default` error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map` - --> tests/ui/rename.rs:113:9 + --> tests/ui/rename.rs:119:9 | LL | #![warn(clippy::option_and_then_some)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map` error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used` - --> tests/ui/rename.rs:114:9 + --> tests/ui/rename.rs:120:9 | LL | #![warn(clippy::option_expect_used)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used` error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or` - --> tests/ui/rename.rs:115:9 + --> tests/ui/rename.rs:121:9 | LL | #![warn(clippy::option_map_unwrap_or)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or` error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or` - --> tests/ui/rename.rs:116:9 + --> tests/ui/rename.rs:122:9 | LL | #![warn(clippy::option_map_unwrap_or_else)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or` error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used` - --> tests/ui/rename.rs:117:9 + --> tests/ui/rename.rs:123:9 | LL | #![warn(clippy::option_unwrap_used)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used` error: lint `clippy::overflow_check_conditional` has been renamed to `clippy::panicking_overflow_checks` - --> tests/ui/rename.rs:118:9 + --> tests/ui/rename.rs:124:9 | LL | #![warn(clippy::overflow_check_conditional)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::panicking_overflow_checks` error: lint `clippy::panic_params` has been renamed to `non_fmt_panics` - --> tests/ui/rename.rs:119:9 + --> tests/ui/rename.rs:125:9 | LL | #![warn(clippy::panic_params)] | ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics` error: lint `clippy::positional_named_format_parameters` has been renamed to `named_arguments_used_positionally` - --> tests/ui/rename.rs:120:9 + --> tests/ui/rename.rs:126:9 | LL | #![warn(clippy::positional_named_format_parameters)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `named_arguments_used_positionally` error: lint `clippy::ref_in_deref` has been renamed to `clippy::needless_borrow` - --> tests/ui/rename.rs:121:9 + --> tests/ui/rename.rs:127:9 | LL | #![warn(clippy::ref_in_deref)] | ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::needless_borrow` error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used` - --> tests/ui/rename.rs:122:9 + --> tests/ui/rename.rs:128:9 | LL | #![warn(clippy::result_expect_used)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used` error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or` - --> tests/ui/rename.rs:123:9 + --> tests/ui/rename.rs:129:9 | LL | #![warn(clippy::result_map_unwrap_or_else)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or` error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used` - --> tests/ui/rename.rs:124:9 + --> tests/ui/rename.rs:130:9 | LL | #![warn(clippy::result_unwrap_used)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used` error: lint `clippy::reverse_range_loop` has been renamed to `clippy::reversed_empty_ranges` - --> tests/ui/rename.rs:125:9 + --> tests/ui/rename.rs:131:9 | LL | #![warn(clippy::reverse_range_loop)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::reversed_empty_ranges` error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str` - --> tests/ui/rename.rs:126:9 + --> tests/ui/rename.rs:132:9 | LL | #![warn(clippy::single_char_push_str)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::single_char_add_str` error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions` - --> tests/ui/rename.rs:127:9 + --> tests/ui/rename.rs:133:9 | LL | #![warn(clippy::stutter)] | ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions` error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `dangling_pointers_from_temporaries` - --> tests/ui/rename.rs:128:9 + --> tests/ui/rename.rs:134:9 | LL | #![warn(clippy::temporary_cstring_as_ptr)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `dangling_pointers_from_temporaries` error: lint `clippy::thread_local_initializer_can_be_made_const` has been renamed to `clippy::missing_const_for_thread_local` - --> tests/ui/rename.rs:129:9 + --> tests/ui/rename.rs:135:9 | LL | #![warn(clippy::thread_local_initializer_can_be_made_const)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::missing_const_for_thread_local` error: lint `clippy::to_string_in_display` has been renamed to `clippy::recursive_format_impl` - --> tests/ui/rename.rs:130:9 + --> tests/ui/rename.rs:136:9 | LL | #![warn(clippy::to_string_in_display)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::recursive_format_impl` error: lint `clippy::transmute_float_to_int` has been renamed to `unnecessary_transmutes` - --> tests/ui/rename.rs:131:9 + --> tests/ui/rename.rs:137:9 | LL | #![warn(clippy::transmute_float_to_int)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unnecessary_transmutes` error: lint `clippy::transmute_int_to_char` has been renamed to `unnecessary_transmutes` - --> tests/ui/rename.rs:132:9 + --> tests/ui/rename.rs:138:9 | LL | #![warn(clippy::transmute_int_to_char)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unnecessary_transmutes` error: lint `clippy::transmute_int_to_float` has been renamed to `unnecessary_transmutes` - --> tests/ui/rename.rs:133:9 + --> tests/ui/rename.rs:139:9 | LL | #![warn(clippy::transmute_int_to_float)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unnecessary_transmutes` error: lint `clippy::transmute_num_to_bytes` has been renamed to `unnecessary_transmutes` - --> tests/ui/rename.rs:134:9 + --> tests/ui/rename.rs:140:9 | LL | #![warn(clippy::transmute_num_to_bytes)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unnecessary_transmutes` error: lint `clippy::unchecked_duration_subtraction` has been renamed to `clippy::unchecked_time_subtraction` - --> tests/ui/rename.rs:135:9 + --> tests/ui/rename.rs:141:9 | LL | #![warn(clippy::unchecked_duration_subtraction)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unchecked_time_subtraction` error: lint `clippy::undropped_manually_drops` has been renamed to `undropped_manually_drops` - --> tests/ui/rename.rs:136:9 + --> tests/ui/rename.rs:142:9 | LL | #![warn(clippy::undropped_manually_drops)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `undropped_manually_drops` error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints` - --> tests/ui/rename.rs:137:9 + --> tests/ui/rename.rs:143:9 | LL | #![warn(clippy::unknown_clippy_lints)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints` error: lint `clippy::unused_label` has been renamed to `unused_labels` - --> tests/ui/rename.rs:138:9 + --> tests/ui/rename.rs:144:9 | LL | #![warn(clippy::unused_label)] | ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels` error: lint `clippy::unwrap_or_else_default` has been renamed to `clippy::unwrap_or_default` - --> tests/ui/rename.rs:139:9 + --> tests/ui/rename.rs:145:9 | LL | #![warn(clippy::unwrap_or_else_default)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_or_default` error: lint `clippy::vtable_address_comparisons` has been renamed to `ambiguous_wide_pointer_comparisons` - --> tests/ui/rename.rs:140:9 + --> tests/ui/rename.rs:146:9 | LL | #![warn(clippy::vtable_address_comparisons)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `ambiguous_wide_pointer_comparisons` error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_characters` - --> tests/ui/rename.rs:141:9 + --> tests/ui/rename.rs:147:9 | LL | #![warn(clippy::zero_width_space)] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters` -error: aborting due to 74 previous errors +error: aborting due to 77 previous errors