Auto merge of #13131 - waywardmonkeys:reduce-typo-count, r=Alexendoo

Reduce typo count.

changelog: none
This commit is contained in:
bors 2024-07-20 11:05:12 +00:00
commit b02cb2401d
9 changed files with 13 additions and 13 deletions

View file

@ -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);
},
_ => {

View file

@ -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] => {

View file

@ -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);

View file

@ -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];
}

View file

@ -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];
}

View file

@ -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) {}
}

View file

@ -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) {}
}

View file

@ -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>;

View file

@ -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];