Skip to content

Commit

Permalink
Reduce typo count.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Jul 20, 2024
1 parent 057c4ae commit cf4270d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/matches/significant_drop_in_scrutinee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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 {
Expand All @@ -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);
},
_ => {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] => {
Expand Down
4 changes: 2 additions & 2 deletions lintcheck/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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/<crate>-<version>/`
// This removes the initial `target/lintcheck/sources/<crate>-<version>/`
let src_split = src_split + "/src/".len();
let (_, file) = file.split_at(src_split);

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/deref_addrof.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/deref_addrof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/missing_const_for_fn/could_be_const.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
}
2 changes: 1 addition & 1 deletion tests/ui/missing_const_for_fn/could_be_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
}
2 changes: 1 addition & 1 deletion tests/ui/zero_repeat_side_effects.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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<i32> = vec![];
let d;
f(); d = vec![] as std::vec::Vec<i32>;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/zero_repeat_side_effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit cf4270d

Please sign in to comment.