From cf4270d13b2f8d2cf4cbd76a8cc15d0fa3bcee14 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 20 Jul 2024 12:50:36 +0700 Subject: [PATCH] Reduce typo count. --- clippy_lints/src/matches/significant_drop_in_scrutinee.rs | 6 +++--- clippy_lints/src/returns.rs | 4 ++-- lintcheck/src/output.rs | 4 ++-- tests/ui/deref_addrof.fixed | 2 +- tests/ui/deref_addrof.rs | 2 +- tests/ui/missing_const_for_fn/could_be_const.fixed | 2 +- tests/ui/missing_const_for_fn/could_be_const.rs | 2 +- tests/ui/zero_repeat_side_effects.fixed | 2 +- tests/ui/zero_repeat_side_effects.rs | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/clippy_lints/src/matches/significant_drop_in_scrutinee.rs b/clippy_lints/src/matches/significant_drop_in_scrutinee.rs index 9047c9627..9c2f42d21 100644 --- a/clippy_lints/src/matches/significant_drop_in_scrutinee.rs +++ b/clippy_lints/src/matches/significant_drop_in_scrutinee.rs @@ -232,7 +232,7 @@ impl<'a, 'tcx> SigDropChecker<'a, 'tcx> { enum SigDropHolder { /// No values with significant drop present in this expression. /// - /// Expressions that we've emited lints do not count. + /// Expressions that we've emitted lints do not count. None, /// Some field in this expression references to values with significant drop. /// @@ -426,7 +426,7 @@ fn ty_has_erased_regions(ty: Ty<'_>) -> bool { impl<'a, 'tcx> Visitor<'tcx> for SigDropHelper<'a, 'tcx> { fn visit_expr(&mut self, ex: &'tcx Expr<'_>) { - // We've emited a lint on some neighborhood expression. That lint will suggest to move out the + // We've emitted a lint on some neighborhood expression. That lint will suggest to move out the // _parent_ expression (not the expression itself). Since we decide to move out the parent // expression, it is pointless to continue to process the current expression. if self.sig_drop_holder == SigDropHolder::Moved { @@ -450,7 +450,7 @@ impl<'a, 'tcx> Visitor<'tcx> for SigDropHelper<'a, 'tcx> { ExprKind::Assign(lhs, _, _) | ExprKind::AssignOp(_, lhs, _) if lhs.hir_id == ex.hir_id && self.sig_drop_holder == SigDropHolder::Moved => { - // Never move out only the assignee. Instead, we should always move out the whole assigment. + // Never move out only the assignee. Instead, we should always move out the whole assignment. self.replace_current_sig_drop(parent_ex.span, true, 0); }, _ => { diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs index 8ced47b48..d9a79fab1 100644 --- a/clippy_lints/src/returns.rs +++ b/clippy_lints/src/returns.rs @@ -394,8 +394,8 @@ fn check_final_expr<'tcx>( // Returns may be used to turn an expression into a statement in rustc's AST. // This allows the addition of attributes, like `#[allow]` (See: clippy#9361) - // `#[expect(clippy::needless_return)]` needs to be handled separatly to - // actually fullfil the expectation (clippy::#12998) + // `#[expect(clippy::needless_return)]` needs to be handled separately to + // actually fulfill the expectation (clippy::#12998) match cx.tcx.hir().attrs(expr.hir_id) { [] => {}, [attr] => { diff --git a/lintcheck/src/output.rs b/lintcheck/src/output.rs index aadf9c162..f785347de 100644 --- a/lintcheck/src/output.rs +++ b/lintcheck/src/output.rs @@ -77,10 +77,10 @@ impl ClippyWarning { .iter() .find(|span| span.is_primary) .or(diag.spans.first()) - .unwrap_or_else(|| panic!("Diagnositc without span: {diag}")); + .unwrap_or_else(|| panic!("Diagnostic without span: {diag}")); let file = &span.file_name; let url = if let Some(src_split) = file.find("/src/") { - // This removes the inital `target/lintcheck/sources/-/` + // This removes the initial `target/lintcheck/sources/-/` let src_split = src_split + "/src/".len(); let (_, file) = file.split_at(src_split); diff --git a/tests/ui/deref_addrof.fixed b/tests/ui/deref_addrof.fixed index b6278c6ca..f412c57d6 100644 --- a/tests/ui/deref_addrof.fixed +++ b/tests/ui/deref_addrof.fixed @@ -45,7 +45,7 @@ fn main() { let _ = unsafe { *core::ptr::addr_of!(a) }; let _repeat = [0; 64]; - // do NOT lint for array as sematic differences with/out `*&`. + // do NOT lint for array as semantic differences with/out `*&`. let _arr = *&[0, 1, 2, 3, 4]; } diff --git a/tests/ui/deref_addrof.rs b/tests/ui/deref_addrof.rs index 572b0fdb1..67836b0de 100644 --- a/tests/ui/deref_addrof.rs +++ b/tests/ui/deref_addrof.rs @@ -45,7 +45,7 @@ fn main() { let _ = unsafe { *core::ptr::addr_of!(a) }; let _repeat = *&[0; 64]; - // do NOT lint for array as sematic differences with/out `*&`. + // do NOT lint for array as semantic differences with/out `*&`. let _arr = *&[0, 1, 2, 3, 4]; } diff --git a/tests/ui/missing_const_for_fn/could_be_const.fixed b/tests/ui/missing_const_for_fn/could_be_const.fixed index dbd739eee..f54503ada 100644 --- a/tests/ui/missing_const_for_fn/could_be_const.fixed +++ b/tests/ui/missing_const_for_fn/could_be_const.fixed @@ -200,7 +200,7 @@ mod with_ty_alias { } // NOTE: When checking the type of a function param, make sure it is not an alias with // `AliasTyKind::Projection` before calling `TyCtxt::type_of` to find out what the actual type - // is. Because the associate ty could have no default, therefore would cause ICE, as demostrated + // is. Because the associate ty could have no default, therefore would cause ICE, as demonstrated // in this test. const fn alias_ty_is_projection(bar: <() as FooTrait>::Foo) {} } diff --git a/tests/ui/missing_const_for_fn/could_be_const.rs b/tests/ui/missing_const_for_fn/could_be_const.rs index 4ac56f4c8..2c229068e 100644 --- a/tests/ui/missing_const_for_fn/could_be_const.rs +++ b/tests/ui/missing_const_for_fn/could_be_const.rs @@ -200,7 +200,7 @@ mod with_ty_alias { } // NOTE: When checking the type of a function param, make sure it is not an alias with // `AliasTyKind::Projection` before calling `TyCtxt::type_of` to find out what the actual type - // is. Because the associate ty could have no default, therefore would cause ICE, as demostrated + // is. Because the associate ty could have no default, therefore would cause ICE, as demonstrated // in this test. fn alias_ty_is_projection(bar: <() as FooTrait>::Foo) {} } diff --git a/tests/ui/zero_repeat_side_effects.fixed b/tests/ui/zero_repeat_side_effects.fixed index 2f71d1752..989e8ae70 100644 --- a/tests/ui/zero_repeat_side_effects.fixed +++ b/tests/ui/zero_repeat_side_effects.fixed @@ -20,7 +20,7 @@ fn main() { f(); b = [] as [i32; 0]; // on vecs - // vecs dont support infering value of consts + // vecs dont support inferring value of consts f(); let c: std::vec::Vec = vec![]; let d; f(); d = vec![] as std::vec::Vec; diff --git a/tests/ui/zero_repeat_side_effects.rs b/tests/ui/zero_repeat_side_effects.rs index ed5cdd1ae..68511f41a 100644 --- a/tests/ui/zero_repeat_side_effects.rs +++ b/tests/ui/zero_repeat_side_effects.rs @@ -20,7 +20,7 @@ fn main() { b = [f(); 0]; // on vecs - // vecs dont support infering value of consts + // vecs dont support inferring value of consts let c = vec![f(); 0]; let d; d = vec![f(); 0];