From e5b6d433fbff84875336a5d58fc18da5a7004847 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:37:02 -0400 Subject: [PATCH 1/2] fix various comment typos --- clippy_lints/src/legacy_numeric_constants.rs | 2 +- clippy_utils/src/lib.rs | 2 +- tests/ui/unconditional_recursion.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/legacy_numeric_constants.rs b/clippy_lints/src/legacy_numeric_constants.rs index c5f1afe68c3f4..00124dcdd91dc 100644 --- a/clippy_lints/src/legacy_numeric_constants.rs +++ b/clippy_lints/src/legacy_numeric_constants.rs @@ -17,7 +17,7 @@ declare_clippy_lint! { /// `std::::EPSILON`, etc. /// /// ### Why is this bad? - /// All of these have been superceded by the associated constants on their respective types, + /// All of these have been superseded by the associated constants on their respective types, /// such as `i128::MAX`. These legacy items may be deprecated in a future version of rust. /// /// ### Example diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 37c12dd850c27..a13885b022f69 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -3285,7 +3285,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St Right(r) => Right(r.data), }); - // 2. for the remaning segments, construct relative path using only mod names and `super` + // 2. for the remaining segments, construct relative path using only mod names and `super` let mut go_up_by = 0; let mut path = Vec::new(); for el in unique_parts { diff --git a/tests/ui/unconditional_recursion.rs b/tests/ui/unconditional_recursion.rs index 70b390b00e272..a51fc567f50c9 100644 --- a/tests/ui/unconditional_recursion.rs +++ b/tests/ui/unconditional_recursion.rs @@ -266,7 +266,7 @@ struct S13 { impl S13 { fn new() -> Self { - // Shoud not warn! + // Should not warn! Self::default() } } From 8de0a1bdbd0d35640acaa4cf0d677b1cc7dcf50e Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:37:30 -0400 Subject: [PATCH 2/2] fix varname typo --- clippy_lints/src/transmute/transmute_int_to_non_zero.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/transmute/transmute_int_to_non_zero.rs b/clippy_lints/src/transmute/transmute_int_to_non_zero.rs index 234021f0f4797..2bea3be3d6030 100644 --- a/clippy_lints/src/transmute/transmute_int_to_non_zero.rs +++ b/clippy_lints/src/transmute/transmute_int_to_non_zero.rs @@ -27,7 +27,7 @@ pub(super) fn check<'tcx>( }; // FIXME: This can be simplified once `NonZero` is stable. - let coercable_types = [ + let coercible_types = [ ("NonZeroU8", tcx.types.u8), ("NonZeroU16", tcx.types.u16), ("NonZeroU32", tcx.types.u32), @@ -44,7 +44,7 @@ pub(super) fn check<'tcx>( let int_type = substs.type_at(0); - let Some(nonzero_alias) = coercable_types.iter().find_map(|(nonzero_alias, t)| { + let Some(nonzero_alias) = coercible_types.iter().find_map(|(nonzero_alias, t)| { if *t == int_type && *t == from_ty { Some(nonzero_alias) } else {