about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-17 14:59:02 +0000
committerbors <bors@rust-lang.org>2022-08-17 14:59:02 +0000
commit82ff740501e1da239a6c9ff94dddf7ae1ca9aeb6 (patch)
tree269b92c3e279d12f859f32091222fe498e15c904
parentd6412b58666ee399bdc56a868a79ed322d6a3fcd (diff)
parent23747419ca52414d3ecf6f69f1e530e47ab1e937 (diff)
downloadrust-82ff740501e1da239a6c9ff94dddf7ae1ca9aeb6.tar.gz
rust-82ff740501e1da239a6c9ff94dddf7ae1ca9aeb6.zip
Auto merge of #13044 - dzvon:fix-typo, r=Veykril
fix: a bunch of typos

This PR will fix some typos detected by [typos].

There are also some other typos in the function names, variable names, and file
names, which I leave as they are. I'm more certain that typos in comments
should be fixed.

[typos]: https://github.com/crate-ci/typos
-rw-r--r--crates/flycheck/src/lib.rs2
-rw-r--r--crates/hir-def/src/nameres/proc_macro.rs2
-rw-r--r--crates/hir-expand/src/lib.rs2
-rw-r--r--crates/ide-assists/src/handlers/extract_module.rs6
-rw-r--r--crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs2
-rw-r--r--crates/ide-assists/src/utils/suggest_name.rs4
-rw-r--r--crates/ide-completion/src/completions/postfix/format_like.rs4
-rw-r--r--crates/ide-completion/src/tests/flyimport.rs2
-rw-r--r--crates/ide-db/src/rename.rs2
-rw-r--r--crates/ide-diagnostics/src/handlers/missing_match_arms.rs2
-rw-r--r--crates/mbe/src/expander/matcher.rs2
-rw-r--r--crates/project-model/src/lib.rs2
-rw-r--r--crates/project-model/src/workspace.rs2
-rw-r--r--crates/rust-analyzer/src/bin/logger.rs2
-rw-r--r--crates/syntax/src/hacks.rs2
-rw-r--r--crates/vfs/src/lib.rs2
-rw-r--r--docs/dev/architecture.md2
-rw-r--r--editors/code/src/commands.ts2
-rw-r--r--editors/code/src/toolchain.ts2
19 files changed, 23 insertions, 23 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index 3347940ec6d..2bebea2fbfe 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -345,7 +345,7 @@ impl CargoActor {
         //
         // Because cargo only outputs one JSON object per line, we can
         // simply skip a line if it doesn't parse, which just ignores any
-        // erroneus output.
+        // erroneous output.
 
         let mut error = String::new();
         let mut read_at_least_one_message = false;
diff --git a/crates/hir-def/src/nameres/proc_macro.rs b/crates/hir-def/src/nameres/proc_macro.rs
index 5089ef2d817..52b79cd0fdd 100644
--- a/crates/hir-def/src/nameres/proc_macro.rs
+++ b/crates/hir-def/src/nameres/proc_macro.rs
@@ -45,7 +45,7 @@ impl Attrs {
                     kind: ProcMacroKind::CustomDerive { helpers: Box::new([]) },
                 }),
 
-                // `#[proc_macro_derive(Trait, attibutes(helper1, helper2, ...))]`
+                // `#[proc_macro_derive(Trait, attributes(helper1, helper2, ...))]`
                 [
                     TokenTree::Leaf(Leaf::Ident(trait_name)),
                     TokenTree::Leaf(Leaf::Punct(comma)),
diff --git a/crates/hir-expand/src/lib.rs b/crates/hir-expand/src/lib.rs
index f6b97fd5405..d753d88470c 100644
--- a/crates/hir-expand/src/lib.rs
+++ b/crates/hir-expand/src/lib.rs
@@ -616,7 +616,7 @@ impl ExpansionInfo {
 
         let token_id = match token_id_in_attr_input {
             Some(token_id) => token_id,
-            // the token is not inside an attribute's input so do the lookup in the macro_arg as ususal
+            // the token is not inside an attribute's input so do the lookup in the macro_arg as usual
             None => {
                 let relative_range =
                     token.value.text_range().checked_sub(self.arg.value.text_range().start())?;
diff --git a/crates/ide-assists/src/handlers/extract_module.rs b/crates/ide-assists/src/handlers/extract_module.rs
index b3c4d306ac1..897980c6650 100644
--- a/crates/ide-assists/src/handlers/extract_module.rs
+++ b/crates/ide-assists/src/handlers/extract_module.rs
@@ -29,7 +29,7 @@ use super::remove_unused_param::range_to_remove;
 
 // Assist: extract_module
 //
-// Extracts a selected region as seperate module. All the references, visibility and imports are
+// Extracts a selected region as separate module. All the references, visibility and imports are
 // resolved.
 //
 // ```
@@ -105,7 +105,7 @@ pub(crate) fn extract_module(acc: &mut Assists, ctx: &AssistContext<'_>) -> Opti
             //
             //- Thirdly, resolving all the imports this includes removing paths from imports
             //  outside the module, shifting/cloning them inside new module, or shifting the imports, or making
-            //  new import statemnts
+            //  new import statements
 
             //We are getting item usages and record_fields together, record_fields
             //for change_visibility and usages for first point mentioned above in the process
@@ -661,7 +661,7 @@ fn check_intersection_and_push(
     import_path: TextRange,
 ) {
     if import_paths_to_be_removed.len() > 0 {
-        // Text ranges recieved here for imports are extended to the
+        // Text ranges received here for imports are extended to the
         // next/previous comma which can cause intersections among them
         // and later deletion of these can cause panics similar
         // to reported in #11766. So to mitigate it, we
diff --git a/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs b/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs
index 6112e09455a..5242f3b5100 100644
--- a/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs
+++ b/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs
@@ -88,7 +88,7 @@ pub(crate) fn replace_turbofish_with_explicit_type(
             },
         );
     } else if let Some(InferType(t)) = let_stmt.ty() {
-        // If there's a type inferrence underscore, we can offer to replace it with the type in
+        // If there's a type inference underscore, we can offer to replace it with the type in
         // the turbofish.
         // let x: _ = fn::<...>();
         let underscore_range = t.syntax().text_range();
diff --git a/crates/ide-assists/src/utils/suggest_name.rs b/crates/ide-assists/src/utils/suggest_name.rs
index 779cdbc93c5..662ddd063f3 100644
--- a/crates/ide-assists/src/utils/suggest_name.rs
+++ b/crates/ide-assists/src/utils/suggest_name.rs
@@ -75,7 +75,7 @@ pub(crate) fn for_generic_parameter(ty: &ast::ImplTraitType) -> SmolStr {
 /// In current implementation, the function tries to get the name from
 /// the following sources:
 ///
-/// * if expr is an argument to function/method, use paramter name
+/// * if expr is an argument to function/method, use parameter name
 /// * if expr is a function/method call, use function name
 /// * expression type name if it exists (E.g. `()`, `fn() -> ()` or `!` do not have names)
 /// * fallback: `var_name`
@@ -85,7 +85,7 @@ pub(crate) fn for_generic_parameter(ty: &ast::ImplTraitType) -> SmolStr {
 /// Currently it sticks to the first name found.
 // FIXME: Microoptimize and return a `SmolStr` here.
 pub(crate) fn for_variable(expr: &ast::Expr, sema: &Semantics<'_, RootDatabase>) -> String {
-    // `from_param` does not benifit from stripping
+    // `from_param` does not benefit from stripping
     // it need the largest context possible
     // so we check firstmost
     if let Some(name) = from_param(expr, sema) {
diff --git a/crates/ide-completion/src/completions/postfix/format_like.rs b/crates/ide-completion/src/completions/postfix/format_like.rs
index 6b94347e0ad..b273a4cb53b 100644
--- a/crates/ide-completion/src/completions/postfix/format_like.rs
+++ b/crates/ide-completion/src/completions/postfix/format_like.rs
@@ -173,7 +173,7 @@ impl FormatStrParser {
                     }
                 }
                 (State::Expr, ':') if chars.peek().copied() == Some(':') => {
-                    // path seperator
+                    // path separator
                     current_expr.push_str("::");
                     chars.next();
                 }
@@ -185,7 +185,7 @@ impl FormatStrParser {
                         current_expr = String::new();
                         self.state = State::FormatOpts;
                     } else {
-                        // We're inside of braced expression, assume that it's a struct field name/value delimeter.
+                        // We're inside of braced expression, assume that it's a struct field name/value delimiter.
                         current_expr.push(chr);
                     }
                 }
diff --git a/crates/ide-completion/src/tests/flyimport.rs b/crates/ide-completion/src/tests/flyimport.rs
index 0bba7f2459c..a63ef006875 100644
--- a/crates/ide-completion/src/tests/flyimport.rs
+++ b/crates/ide-completion/src/tests/flyimport.rs
@@ -159,7 +159,7 @@ pub mod some_module {
     pub struct ThiiiiiirdStruct;
     // contains all letters from the query, but not in the beginning, displayed second
     pub struct AfterThirdStruct;
-    // contains all letters from the query in the begginning, displayed first
+    // contains all letters from the query in the beginning, displayed first
     pub struct ThirdStruct;
 }
 
diff --git a/crates/ide-db/src/rename.rs b/crates/ide-db/src/rename.rs
index 517fe3f246d..49b81265ea5 100644
--- a/crates/ide-db/src/rename.rs
+++ b/crates/ide-db/src/rename.rs
@@ -82,7 +82,7 @@ impl Definition {
     }
 
     /// Textual range of the identifier which will change when renaming this
-    /// `Definition`. Note that some definitions, like buitin types, can't be
+    /// `Definition`. Note that some definitions, like builtin types, can't be
     /// renamed.
     pub fn range_for_rename(self, sema: &Semantics<'_, RootDatabase>) -> Option<FileRange> {
         let res = match self {
diff --git a/crates/ide-diagnostics/src/handlers/missing_match_arms.rs b/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
index 9e66fbfb752..5fcaf405b14 100644
--- a/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
+++ b/crates/ide-diagnostics/src/handlers/missing_match_arms.rs
@@ -750,7 +750,7 @@ fn main() {
 enum Foo { A }
 fn main() {
     // FIXME: this should not bail out but current behavior is such as the old algorithm.
-    // ExprValidator::validate_match(..) checks types of top level patterns incorrecly.
+    // ExprValidator::validate_match(..) checks types of top level patterns incorrectly.
     match Foo::A {
         ref _x => {}
         Foo::A => {}
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs
index 5020e9abaf3..c1aa14d6b7e 100644
--- a/crates/mbe/src/expander/matcher.rs
+++ b/crates/mbe/src/expander/matcher.rs
@@ -321,7 +321,7 @@ struct MatchState<'t> {
     /// The KleeneOp of this sequence if we are in a repetition.
     sep_kind: Option<RepeatKind>,
 
-    /// Number of tokens of seperator parsed
+    /// Number of tokens of separator parsed
     sep_parsed: Option<usize>,
 
     /// Matched meta variables bindings
diff --git a/crates/project-model/src/lib.rs b/crates/project-model/src/lib.rs
index e3f83084ac8..b81b7432f65 100644
--- a/crates/project-model/src/lib.rs
+++ b/crates/project-model/src/lib.rs
@@ -3,7 +3,7 @@
 //!
 //! Pure model is represented by the [`base_db::CrateGraph`] from another crate.
 //!
-//! In this crate, we are conserned with "real world" project models.
+//! In this crate, we are concerned with "real world" project models.
 //!
 //! Specifically, here we have a representation for a Cargo project
 //! ([`CargoWorkspace`]) and for manually specified layout ([`ProjectJson`]).
diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs
index daabb299f76..8d6f50f5587 100644
--- a/crates/project-model/src/workspace.rs
+++ b/crates/project-model/src/workspace.rs
@@ -770,7 +770,7 @@ fn handle_rustc_crates(
         queue.push_back(root_pkg);
         while let Some(pkg) = queue.pop_front() {
             // Don't duplicate packages if they are dependended on a diamond pattern
-            // N.B. if this line is ommitted, we try to analyse over 4_800_000 crates
+            // N.B. if this line is omitted, we try to analyse over 4_800_000 crates
             // which is not ideal
             if rustc_pkg_crates.contains_key(&pkg) {
                 continue;
diff --git a/crates/rust-analyzer/src/bin/logger.rs b/crates/rust-analyzer/src/bin/logger.rs
index 0b69f75bc0d..298814af5a4 100644
--- a/crates/rust-analyzer/src/bin/logger.rs
+++ b/crates/rust-analyzer/src/bin/logger.rs
@@ -52,7 +52,7 @@ impl Logger {
         // merge chalk filter to our main filter (from RA_LOG env).
         //
         // The acceptable syntax of CHALK_DEBUG is `target[span{field=value}]=level`.
-        // As the value should only affect chalk crates, we'd better mannually
+        // As the value should only affect chalk crates, we'd better manually
         // specify the target. And for simplicity, CHALK_DEBUG only accept the value
         // that specify level.
         let chalk_level_dir = std::env::var("CHALK_DEBUG")
diff --git a/crates/syntax/src/hacks.rs b/crates/syntax/src/hacks.rs
index a047f61fa03..ec3d3d444c3 100644
--- a/crates/syntax/src/hacks.rs
+++ b/crates/syntax/src/hacks.rs
@@ -1,4 +1,4 @@
-//! Things which exist to solve practial issues, but which shouldn't exist.
+//! Things which exist to solve practical issues, but which shouldn't exist.
 //!
 //! Please avoid adding new usages of the functions in this module
 
diff --git a/crates/vfs/src/lib.rs b/crates/vfs/src/lib.rs
index 10fae41d081..7badb1c363b 100644
--- a/crates/vfs/src/lib.rs
+++ b/crates/vfs/src/lib.rs
@@ -64,7 +64,7 @@ pub struct FileId(pub u32);
 
 /// Storage for all files read by rust-analyzer.
 ///
-/// For more informations see the [crate-level](crate) documentation.
+/// For more information see the [crate-level](crate) documentation.
 #[derive(Default)]
 pub struct Vfs {
     interner: PathInterner,
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index 51e26c58a91..c173a239fea 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -485,7 +485,7 @@ Mind the code--architecture gap: at the moment, we are using fewer feature flags
 ### Serialization
 
 In Rust, it is easy (often too easy) to add serialization to any type by adding `#[derive(Serialize)]`.
-This easiness is misleading -- serializable types impose significant backwards compatability constraints.
+This easiness is misleading -- serializable types impose significant backwards compatibility constraints.
 If a type is serializable, then it is a part of some IPC boundary.
 You often don't control the other side of this boundary, so changing serializable types is hard.
 
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index f58de9da1bf..12f666401fd 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -655,7 +655,7 @@ function crateGraph(ctx: Ctx, full: boolean): Cmd {
                     html, body { margin:0; padding:0; overflow:hidden }
                     svg { position:fixed; top:0; left:0; height:100%; width:100% }
 
-                    /* Disable the graphviz backgroud and fill the polygons */
+                    /* Disable the graphviz background and fill the polygons */
                     .graph > polygon { display:none; }
                     :is(.node,.edge) polygon { fill: white; }
 
diff --git a/editors/code/src/toolchain.ts b/editors/code/src/toolchain.ts
index bac163da9f3..e1ca4954280 100644
--- a/editors/code/src/toolchain.ts
+++ b/editors/code/src/toolchain.ts
@@ -158,7 +158,7 @@ export const getPathForExecutable = memoizeAsync(
 
         try {
             // hmm, `os.homedir()` seems to be infallible
-            // it is not mentioned in docs and cannot be infered by the type signature...
+            // it is not mentioned in docs and cannot be inferred by the type signature...
             const standardPath = vscode.Uri.joinPath(
                 vscode.Uri.file(os.homedir()),
                 ".cargo",