Skip to content

Commit 355c944

Browse files
committed
Auto merge of #16448 - Young-Flash:typos, r=lnicola
minor: correct typos I use [crate-ci/typos](https://github.com/crate-ci/typos) to check typos in codebase, if it's ok with you, I'd like to add a typo check CI using [typos](https://github.com/crate-ci/typos) (with Apache-2.0, MIT licenses). BTW, we can add a [_typos.toml](https://github.com/crate-ci/typos/blob/master/docs/reference.md) as white list for some intentional typos
2 parents 9d837a6 + 62ff8f3 commit 355c944

File tree

23 files changed

+40
-40
lines changed

23 files changed

+40
-40
lines changed

crates/hir-def/src/hir/format_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub(crate) fn parse(
214214

215215
let mut used = vec![false; args.explicit_args().len()];
216216
let mut invalid_refs = Vec::new();
217-
let mut numeric_refences_to_named_arg = Vec::new();
217+
let mut numeric_references_to_named_arg = Vec::new();
218218

219219
enum ArgRef<'a> {
220220
Index(usize),
@@ -231,7 +231,7 @@ pub(crate) fn parse(
231231
used[index] = true;
232232
if arg.kind.ident().is_some() {
233233
// This was a named argument, but it was used as a positional argument.
234-
numeric_refences_to_named_arg.push((index, span, used_as));
234+
numeric_references_to_named_arg.push((index, span, used_as));
235235
}
236236
Ok(index)
237237
} else {

crates/hir-def/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ impl InTypeConstId {
745745
}
746746
}
747747

748-
/// A constant, which might appears as a const item, an annonymous const block in expressions
748+
/// A constant, which might appears as a const item, an anonymous const block in expressions
749749
/// or patterns, or as a constant in types with const generics.
750750
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
751751
pub enum GeneralConstId {

crates/hir-def/src/macro_expansion_tests/mbe/regression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn main() {
7272
}
7373
"#]],
7474
);
75-
// FIXME we should ahev testing infra for multi level expansion tests
75+
// FIXME we should have testing infra for multi level expansion tests
7676
check(
7777
r#"
7878
macro_rules! __rust_force_expr {

crates/hir-def/src/nameres/path_resolution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl DefMap {
269269
stdx::never!(module.is_block_module());
270270

271271
if self.block != def_map.block {
272-
// If we have a different `DefMap` from `self` (the orignal `DefMap` we started
272+
// If we have a different `DefMap` from `self` (the original `DefMap` we started
273273
// with), resolve the remaining path segments in that `DefMap`.
274274
let path =
275275
ModPath::from_segments(PathKind::Super(0), path.segments().iter().cloned());
@@ -540,7 +540,7 @@ impl DefMap {
540540
}
541541
}
542542

543-
/// Given a block module, returns its nearest non-block module and the `DefMap` it blongs to.
543+
/// Given a block module, returns its nearest non-block module and the `DefMap` it belongs to.
544544
fn adjust_to_nearest_non_block_module(
545545
db: &dyn DefDatabase,
546546
def_map: &DefMap,

crates/hir-ty/src/mir/eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ impl MirEvalError {
362362
func
363363
)?;
364364
}
365-
Either::Right(clos) => {
366-
writeln!(f, "In {:?}", clos)?;
365+
Either::Right(closure) => {
366+
writeln!(f, "In {:?}", closure)?;
367367
}
368368
}
369369
let source_map = db.body_with_source_map(*def).1;

crates/hir-ty/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub(crate) fn generics(db: &dyn DefDatabase, def: GenericDefId) -> Generics {
192192
/// and it doesn't store the closure types and fields.
193193
///
194194
/// Codes should not assume this ordering, and should always use methods available
195-
/// on this struct for retriving, and `TyBuilder::substs_for_closure` for creating.
195+
/// on this struct for retrieving, and `TyBuilder::substs_for_closure` for creating.
196196
pub(crate) struct ClosureSubst<'a>(pub(crate) &'a Substitution);
197197

198198
impl<'a> ClosureSubst<'a> {

crates/ide-assists/src/handlers/add_missing_impl_members.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,17 @@ impl<U> Foo<U> for S {
370370
add_missing_impl_members,
371371
r#"
372372
pub trait Trait<'a, 'b, A, B, C> {
373-
fn foo(&self, one: &'a A, anoter: &'b B) -> &'a C;
373+
fn foo(&self, one: &'a A, another: &'b B) -> &'a C;
374374
}
375375
376376
impl<'x, 'y, T, V, U> Trait<'x, 'y, T, V, U> for () {$0}"#,
377377
r#"
378378
pub trait Trait<'a, 'b, A, B, C> {
379-
fn foo(&self, one: &'a A, anoter: &'b B) -> &'a C;
379+
fn foo(&self, one: &'a A, another: &'b B) -> &'a C;
380380
}
381381
382382
impl<'x, 'y, T, V, U> Trait<'x, 'y, T, V, U> for () {
383-
fn foo(&self, one: &'x T, anoter: &'y V) -> &'x U {
383+
fn foo(&self, one: &'x T, another: &'y V) -> &'x U {
384384
${0:todo!()}
385385
}
386386
}"#,
@@ -393,7 +393,7 @@ impl<'x, 'y, T, V, U> Trait<'x, 'y, T, V, U> for () {
393393
add_missing_default_members,
394394
r#"
395395
pub trait Trait<'a, 'b, A, B, C: Default> {
396-
fn foo(&self, _one: &'a A, _anoter: &'b B) -> (C, &'a i32) {
396+
fn foo(&self, _one: &'a A, _another: &'b B) -> (C, &'a i32) {
397397
let value: &'a i32 = &0;
398398
(C::default(), value)
399399
}
@@ -402,14 +402,14 @@ pub trait Trait<'a, 'b, A, B, C: Default> {
402402
impl<'x, 'y, T, V, U: Default> Trait<'x, 'y, T, V, U> for () {$0}"#,
403403
r#"
404404
pub trait Trait<'a, 'b, A, B, C: Default> {
405-
fn foo(&self, _one: &'a A, _anoter: &'b B) -> (C, &'a i32) {
405+
fn foo(&self, _one: &'a A, _another: &'b B) -> (C, &'a i32) {
406406
let value: &'a i32 = &0;
407407
(C::default(), value)
408408
}
409409
}
410410
411411
impl<'x, 'y, T, V, U: Default> Trait<'x, 'y, T, V, U> for () {
412-
$0fn foo(&self, _one: &'x T, _anoter: &'y V) -> (U, &'x i32) {
412+
$0fn foo(&self, _one: &'x T, _another: &'y V) -> (U, &'x i32) {
413413
let value: &'x i32 = &0;
414414
(<U>::default(), value)
415415
}

crates/ide-assists/src/handlers/extract_variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub(crate) fn extract_variable(acc: &mut Assists, ctx: &AssistContext<'_>) -> Op
163163
block
164164
} else {
165165
// `expr_replace` is a descendant of `to_wrap`, so both steps need to be
166-
// handled seperately, otherwise we wrap the wrong expression
166+
// handled separately, otherwise we wrap the wrong expression
167167
let to_wrap = edit.make_mut(to_wrap);
168168

169169
// Replace the target expr first so that we don't need to find where

crates/ide-assists/src/handlers/generate_delegate_trait.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ fn remove_useless_where_clauses(trait_ty: &ast::Type, self_ty: &ast::Type, wc: a
491491

492492
// Generate generic args that should be apply to current impl.
493493
//
494-
// For exmaple, say we have implementation `impl<A, B, C> Trait for B<A>`,
494+
// For example, say we have implementation `impl<A, B, C> Trait for B<A>`,
495495
// and `b: B<T>` in struct `S<T>`. Then the `A` should be instantiated to `T`.
496496
// While the last two generic args `B` and `C` doesn't change, it remains
497497
// `<B, C>`. So we apply `<T, B, C>` as generic arguments to impl.
@@ -637,7 +637,7 @@ fn const_assoc_item(item: syntax::ast::Const, qual_path_ty: ast::Path) -> Option
637637
let path_expr_segment = make::path_from_text(item.name()?.to_string().as_str());
638638

639639
// We want rhs of the const assignment to be a qualified path
640-
// The general case for const assigment can be found [here](`https://doc.rust-lang.org/reference/items/constant-items.html`)
640+
// The general case for const assignment can be found [here](`https://doc.rust-lang.org/reference/items/constant-items.html`)
641641
// The qualified will have the following generic syntax :
642642
// <Base as Trait<GenArgs>>::ConstName;
643643
// FIXME : We can't rely on `make::path_qualified` for now but it would be nice to replace the following with it.
@@ -779,7 +779,7 @@ impl Trait for Base {}
779779

780780
#[test]
781781
fn test_self_ty() {
782-
// trait whith `Self` type cannot be delegated
782+
// trait with `Self` type cannot be delegated
783783
//
784784
// See the function `fn f() -> Self`.
785785
// It should be `fn f() -> Base` in `Base`, and `fn f() -> S` in `S`

crates/ide-assists/src/handlers/generate_mut_trait_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use syntax::{
66

77
use crate::{AssistContext, AssistId, AssistKind, Assists};
88

9-
// FIXME: Generate proper `index_mut` method body refer to `index` method body may impossible due to the unpredicable case [#15581].
9+
// FIXME: Generate proper `index_mut` method body refer to `index` method body may impossible due to the unpredictable case [#15581].
1010
// Here just leave the `index_mut` method body be same as `index` method body, user can modify it manually to meet their need.
1111

1212
// Assist: generate_mut_trait_impl

0 commit comments

Comments
 (0)