Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/hir-def/src/attrs/docs.rs4
-rw-r--r--crates/hir-def/src/nameres/path_resolution.rs8
-rw-r--r--crates/hir-ty/src/infer/place_op.rs2
-rw-r--r--crates/hir-ty/src/lib.rs2
-rw-r--r--crates/hir-ty/src/next_solver/inspect.rs2
-rw-r--r--crates/hir/src/display.rs2
-rw-r--r--crates/hir/src/semantics.rs4
-rw-r--r--crates/hir/src/semantics/source_to_def.rs6
-rw-r--r--crates/ide-assists/src/handlers/replace_if_let_with_match.rs2
-rw-r--r--crates/ide-completion/src/completions/attribute/derive.rs2
-rw-r--r--crates/ide-completion/src/completions/type.rs2
-rw-r--r--crates/ide-completion/src/context/analysis.rs2
-rw-r--r--crates/ide-completion/src/item.rs2
-rw-r--r--crates/ide-db/src/source_change.rs4
-rw-r--r--crates/ide-db/src/syntax_helpers/tree_diff.rs2
-rw-r--r--crates/ide-ssr/src/search.rs2
-rw-r--r--crates/ide-ssr/src/tests.rs2
-rw-r--r--crates/ide/src/typing.rs2
-rw-r--r--crates/mbe/src/expander/matcher.rs2
-rw-r--r--crates/parser/src/output.rs2
-rw-r--r--crates/proc-macro-api/src/legacy_protocol/msg/flat.rs2
-rw-r--r--crates/rust-analyzer/src/cli/ssr.rs4
-rw-r--r--crates/rust-analyzer/src/main_loop.rs2
-rw-r--r--crates/span/src/ast_id.rs4
-rw-r--r--crates/vfs/src/lib.rs6
-rw-r--r--crates/vfs/src/loader.rs2
-rw-r--r--crates/vfs/src/path_interner.rs4
27 files changed, 40 insertions, 40 deletions
diff --git a/crates/hir-def/src/attrs/docs.rs b/crates/hir-def/src/attrs/docs.rs
index bdd8ea84a0..55cb6f8f81 100644
--- a/crates/hir-def/src/attrs/docs.rs
+++ b/crates/hir-def/src/attrs/docs.rs
@@ -44,13 +44,13 @@ pub struct Docs {
docs: String,
/// A sorted map from an offset in `docs` to an offset in the source code.
docs_source_map: Vec<DocsSourceMapLine>,
- /// If the item is an outlined module (`mod foo;`), `docs_source_map` store the concatenated
+ /// If the item is an outlined module (`mod foo;`), `docs_source_map` stores the concatenated
/// list of the outline and inline docs (outline first). Then, this field contains the [`HirFileId`]
/// of the outline declaration, and the index in `docs` from which the inline docs
/// begin.
outline_mod: Option<(HirFileId, usize)>,
inline_file: HirFileId,
- /// The size the prepended prefix, which does not map to real doc comments.
+ /// The size of the prepended prefix, which does not map to real doc comments.
prefix_len: TextSize,
/// The offset in `docs` from which the docs are inner attributes/comments.
inline_inner_docs_start: Option<TextSize>,
diff --git a/crates/hir-def/src/nameres/path_resolution.rs b/crates/hir-def/src/nameres/path_resolution.rs
index fde1db4734..150b4eeb60 100644
--- a/crates/hir-def/src/nameres/path_resolution.rs
+++ b/crates/hir-def/src/nameres/path_resolution.rs
@@ -1,11 +1,11 @@
-//! This modules implements a function to resolve a path `foo::bar::baz` to a
-//! def, which is used within the name resolution.
+//! This module implements a function to resolve a path `foo::bar::baz` to a
+//! def, which is used within name resolution.
//!
//! When name resolution is finished, the result of resolving a path is either
-//! `Some(def)` or `None`. However, when we are in process of resolving imports
+//! `Some(def)` or `None`. However, when we are in the process of resolving imports
//! or macros, there's a third possibility:
//!
-//! I can't resolve this path right now, but I might be resolve this path
+//! I can't resolve this path right now, but I might be able to resolve this path
//! later, when more macros are expanded.
//!
//! `ReachedFixedPoint` signals about this.
diff --git a/crates/hir-ty/src/infer/place_op.rs b/crates/hir-ty/src/infer/place_op.rs
index b226e5ca85..c2e39709e8 100644
--- a/crates/hir-ty/src/infer/place_op.rs
+++ b/crates/hir-ty/src/infer/place_op.rs
@@ -235,7 +235,7 @@ impl<'db> InferenceContext<'db> {
// We have to replace the operator with the mutable variant for the
// program to compile, so we don't really have a choice here and want
- // to just try using `DerefMut` even if its not in the item bounds
+ // to just try using `DerefMut` even if it's not in the item bounds
// of the opaque.
let treat_opaques = TreatNotYetDefinedOpaques::AsInfer;
table.lookup_method_for_operator(
diff --git a/crates/hir-ty/src/lib.rs b/crates/hir-ty/src/lib.rs
index c631c87de5..0dd558828f 100644
--- a/crates/hir-ty/src/lib.rs
+++ b/crates/hir-ty/src/lib.rs
@@ -216,7 +216,7 @@ impl<'db> MemoryMap<'db> {
}
}
-/// Return an index of a parameter in the generic type parameter list by it's id.
+/// Returns the index of a parameter in the generic type parameter list by its id.
pub fn type_or_const_param_idx(db: &dyn HirDatabase, id: TypeOrConstParamId) -> u32 {
generics::generics(db, id.parent).type_or_const_param_idx(id)
}
diff --git a/crates/hir-ty/src/next_solver/inspect.rs b/crates/hir-ty/src/next_solver/inspect.rs
index 7e2dfb7112..f251dcfdcf 100644
--- a/crates/hir-ty/src/next_solver/inspect.rs
+++ b/crates/hir-ty/src/next_solver/inspect.rs
@@ -131,7 +131,7 @@ impl<'a, 'db> InspectCandidate<'a, 'db> {
/// Certainty passed into `evaluate_added_goals_and_make_canonical_response`.
///
/// If this certainty is `Yes`, then we must be confident that the candidate
- /// must hold iff it's nested goals hold. This is not true if the certainty is
+ /// must hold iff its nested goals hold. This is not true if the certainty is
/// `Maybe(..)`, which suggests we forced ambiguity instead.
///
/// This is *not* the certainty of the candidate's full nested evaluation, which
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs
index dc35a5c57b..61eda80fb4 100644
--- a/crates/hir/src/display.rs
+++ b/crates/hir/src/display.rs
@@ -357,7 +357,7 @@ impl<'db> HirDisplay<'db> for Adt {
impl<'db> HirDisplay<'db> for Struct {
fn hir_fmt(&self, f: &mut HirFormatter<'_, 'db>) -> Result {
let module_id = self.module(f.db).id;
- // FIXME: Render repr if its set explicitly?
+ // FIXME: Render repr if it's set explicitly?
write_visibility(module_id, self.visibility(f.db), f)?;
f.write_str("struct ")?;
write!(f, "{}", self.name(f.db).display(f.db, f.edition()))?;
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index fee6ae3d49..f298e25489 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -1563,7 +1563,7 @@ impl<'db> SemanticsImpl<'db> {
}
/// Attempts to map the node out of macro expanded files.
- /// This only work for attribute expansions, as other ones do not have nodes as input.
+ /// This only works for attribute expansions, as other ones do not have nodes as input.
pub fn original_ast_node<N: AstNode>(&self, node: N) -> Option<N> {
self.wrap_node_infile(node).original_ast_node_rooted(self.db).map(
|InRealFile { file_id, value }| {
@@ -1574,7 +1574,7 @@ impl<'db> SemanticsImpl<'db> {
}
/// Attempts to map the node out of macro expanded files.
- /// This only work for attribute expansions, as other ones do not have nodes as input.
+ /// This only works for attribute expansions, as other ones do not have nodes as input.
pub fn original_syntax_node_rooted(&self, node: &SyntaxNode) -> Option<SyntaxNode> {
let InFile { file_id, .. } = self.find_file(node);
InFile::new(file_id, node).original_syntax_node_rooted(self.db).map(
diff --git a/crates/hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs
index 3b39a48914..81005f48dd 100644
--- a/crates/hir/src/semantics/source_to_def.rs
+++ b/crates/hir/src/semantics/source_to_def.rs
@@ -10,7 +10,7 @@
//! This problem is a part of more-or-less every IDE feature implemented. Every
//! IDE functionality (like goto to definition), conceptually starts with a
//! specific cursor position in a file. Starting with this text offset, we first
-//! figure out what syntactic construct are we at: is this a pattern, an
+//! figure out what syntactic construct we are at: is this a pattern, an
//! expression, an item definition.
//!
//! Knowing only the syntax gives us relatively little info. For example,
@@ -32,11 +32,11 @@
//! Specifically, the algorithm goes like this:
//!
//! 1. Find the syntactic container for the syntax. For example, field's
-//! container is the struct, and structs container is a module.
+//! container is the struct, and the struct's container is a module.
//! 2. Recursively get the def corresponding to container.
//! 3. Ask the container def for all child defs. These child defs contain
//! the answer and answer's siblings.
-//! 4. For each child def, ask for it's source.
+//! 4. For each child def, ask for its source.
//! 5. The child def whose source is the syntax node we've started with
//! is the answer.
//!
diff --git a/crates/ide-assists/src/handlers/replace_if_let_with_match.rs b/crates/ide-assists/src/handlers/replace_if_let_with_match.rs
index 9a61163e87..50d6f6d62c 100644
--- a/crates/ide-assists/src/handlers/replace_if_let_with_match.rs
+++ b/crates/ide-assists/src/handlers/replace_if_let_with_match.rs
@@ -102,7 +102,7 @@ pub(crate) fn replace_if_let_with_match(
if !pat_seen && cond_bodies.len() != 1 {
// Don't offer turning an if (chain) without patterns into a match,
- // unless its a simple `if cond { .. } (else { .. })`
+ // unless it's a simple `if cond { .. } (else { .. })`
return None;
}
diff --git a/crates/ide-completion/src/completions/attribute/derive.rs b/crates/ide-completion/src/completions/attribute/derive.rs
index 9e7dabbd01..356c7e0087 100644
--- a/crates/ide-completion/src/completions/attribute/derive.rs
+++ b/crates/ide-completion/src/completions/attribute/derive.rs
@@ -107,7 +107,7 @@ struct DeriveDependencies {
}
/// Standard Rust derives that have dependencies
-/// (the dependencies are needed so that the main derive don't break the compilation when added)
+/// (the dependencies are needed so that the main derive doesn't break the compilation when added)
const DEFAULT_DERIVE_DEPENDENCIES: &[DeriveDependencies] = &[
DeriveDependencies { label: "Copy", dependencies: &["Clone"] },
DeriveDependencies { label: "Eq", dependencies: &["PartialEq"] },
diff --git a/crates/ide-completion/src/completions/type.rs b/crates/ide-completion/src/completions/type.rs
index c07c02e285..391152f438 100644
--- a/crates/ide-completion/src/completions/type.rs
+++ b/crates/ide-completion/src/completions/type.rs
@@ -26,7 +26,7 @@ pub(crate) fn complete_type_path<'db>(
ScopeDef::ModuleDef(Function(_) | EnumVariant(_) | Static(_)) | ScopeDef::Local(_) => {
false
}
- // unless its a constant in a generic arg list position
+ // unless it's a constant in a generic arg list position
ScopeDef::ModuleDef(Const(_)) | ScopeDef::GenericParam(ConstParam(_)) => {
location.complete_consts()
}
diff --git a/crates/ide-completion/src/context/analysis.rs b/crates/ide-completion/src/context/analysis.rs
index b06f52c113..7280fd1ad5 100644
--- a/crates/ide-completion/src/context/analysis.rs
+++ b/crates/ide-completion/src/context/analysis.rs
@@ -1663,7 +1663,7 @@ fn classify_name_ref<'db>(
let res = sema.resolve_path(&qualifier);
// For understanding how and why super_chain_len is calculated the way it
- // is check the documentation at it's definition
+ // is check the documentation at its definition
let mut segment_count = 0;
let super_count = iter::successors(Some(qualifier.clone()), |p| p.qualifier())
.take_while(|p| {
diff --git a/crates/ide-completion/src/item.rs b/crates/ide-completion/src/item.rs
index 2ff726c6d0..675ffac040 100644
--- a/crates/ide-completion/src/item.rs
+++ b/crates/ide-completion/src/item.rs
@@ -320,7 +320,7 @@ impl CompletionRelevance {
}
if let Some(trait_) = trait_ {
- // lower rank trait methods unless its notable
+ // lower rank trait methods unless it's notable
if !trait_.notable_trait {
score -= 5;
}
diff --git a/crates/ide-db/src/source_change.rs b/crates/ide-db/src/source_change.rs
index a38154420a..540b0ee99d 100644
--- a/crates/ide-db/src/source_change.rs
+++ b/crates/ide-db/src/source_change.rs
@@ -1,5 +1,5 @@
-//! This modules defines type to represent changes to the source code, that flow
-//! from the server to the client.
+//! This module defines types that represent changes to source code flowing from
+//! the server to the client.
//!
//! It can be viewed as a dual for [`Change`][vfs::Change].
diff --git a/crates/ide-db/src/syntax_helpers/tree_diff.rs b/crates/ide-db/src/syntax_helpers/tree_diff.rs
index 7163c08e1e..af893f1ea5 100644
--- a/crates/ide-db/src/syntax_helpers/tree_diff.rs
+++ b/crates/ide-db/src/syntax_helpers/tree_diff.rs
@@ -115,7 +115,7 @@ pub fn diff(from: &SyntaxNode, to: &SyntaxNode) -> TreeDiff {
}
(Some(ref lhs_ele), Some(ref rhs_ele)) if syntax_element_eq(lhs_ele, rhs_ele) => {}
(Some(lhs_ele), Some(rhs_ele)) => {
- // nodes differ, look for lhs_ele in rhs, if its found we can mark everything up
+ // nodes differ, look for lhs_ele in rhs, if it's found we can mark everything up
// until that element as insertions. This is important to keep the diff minimal
// in regards to insertions that have been actually done, this is important for
// use insertions as we do not want to replace the entire module node.
diff --git a/crates/ide-ssr/src/search.rs b/crates/ide-ssr/src/search.rs
index c6a1d69672..f76912b840 100644
--- a/crates/ide-ssr/src/search.rs
+++ b/crates/ide-ssr/src/search.rs
@@ -127,7 +127,7 @@ impl<'db> MatchFinder<'db> {
usage_cache.find(&definition).unwrap()
}
- /// Returns the scope within which we want to search. We don't want un unrestricted search
+ /// Returns the scope within which we want to search. We don't want an unrestricted search
/// scope, since we don't want to find references in external dependencies.
fn search_scope(&self) -> SearchScope {
// FIXME: We should ideally have a test that checks that we edit local roots and not library
diff --git a/crates/ide-ssr/src/tests.rs b/crates/ide-ssr/src/tests.rs
index b3d09cac42..d8c15cabb2 100644
--- a/crates/ide-ssr/src/tests.rs
+++ b/crates/ide-ssr/src/tests.rs
@@ -1070,7 +1070,7 @@ fn match_failure_reasons() {
#[test]
fn overlapping_possible_matches() {
// There are three possible matches here, however the middle one, `foo(foo(foo(42)))` shouldn't
- // match because it overlaps with the outer match. The inner match is permitted since it's is
+ // match because it overlaps with the outer match. The inner match is permitted since it is
// contained entirely within the placeholder of the outer match.
assert_matches(
"foo(foo($a))",
diff --git a/crates/ide/src/typing.rs b/crates/ide/src/typing.rs
index b06079d8ac..79919dac5b 100644
--- a/crates/ide/src/typing.rs
+++ b/crates/ide/src/typing.rs
@@ -365,7 +365,7 @@ fn on_left_angle_typed(
) -> Option<TextEdit> {
let file_text = reparsed.syntax().text();
- // Find the next non-whitespace char in the line, check if its a `>`
+ // Find the next non-whitespace char in the line, check if it's a `>`
let mut next_offset = offset;
while file_text.char_at(next_offset) == Some(' ') {
next_offset += TextSize::of(' ')
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs
index fe01fb1f10..c95e5a3ef8 100644
--- a/crates/mbe/src/expander/matcher.rs
+++ b/crates/mbe/src/expander/matcher.rs
@@ -347,7 +347,7 @@ struct MatchState<'t> {
/// Process the matcher positions of `cur_items` until it is empty. In the process, this will
/// produce more items in `next_items`, `eof_items`, and `bb_items`.
///
-/// For more info about the how this happens, see the module-level doc comments and the inline
+/// For more info about how this happens, see the module-level doc comments and the inline
/// comments of this function.
///
/// # Parameters
diff --git a/crates/parser/src/output.rs b/crates/parser/src/output.rs
index ce64db8ada..4f4728a8c5 100644
--- a/crates/parser/src/output.rs
+++ b/crates/parser/src/output.rs
@@ -14,7 +14,7 @@ use crate::SyntaxKind;
#[derive(Default)]
pub struct Output {
/// 32-bit encoding of events. If LSB is zero, then that's an index into the
- /// error vector. Otherwise, it's one of the thee other variants, with data encoded as
+ /// error vector. Otherwise, it's one of the three other variants, with data encoded as
///
/// ```text
/// |16 bit kind|8 bit n_input_tokens|4 bit tag|4 bit leftover|
diff --git a/crates/proc-macro-api/src/legacy_protocol/msg/flat.rs b/crates/proc-macro-api/src/legacy_protocol/msg/flat.rs
index 3015bd0c0e..ae03be9aa7 100644
--- a/crates/proc-macro-api/src/legacy_protocol/msg/flat.rs
+++ b/crates/proc-macro-api/src/legacy_protocol/msg/flat.rs
@@ -31,7 +31,7 @@
//! ```
//!
//! We probably should replace most of the code here with bincode someday, but,
-//! as we don't have bincode in Cargo.toml yet, lets stick with serde_json for
+//! as we don't have bincode in Cargo.toml yet, let's stick with serde_json for
//! the time being.
#[cfg(feature = "in-rust-tree")]
diff --git a/crates/rust-analyzer/src/cli/ssr.rs b/crates/rust-analyzer/src/cli/ssr.rs
index 7b00aebbfc..ad92ebea7a 100644
--- a/crates/rust-analyzer/src/cli/ssr.rs
+++ b/crates/rust-analyzer/src/cli/ssr.rs
@@ -48,8 +48,8 @@ impl flags::Ssr {
impl flags::Search {
/// Searches for `patterns`, printing debug information for any nodes whose text exactly matches
- /// `debug_snippet`. This is intended for debugging and probably isn't in it's current form useful
- /// for much else.
+ /// `debug_snippet`. This is intended for debugging and probably isn't useful in its current
+ /// form for much else.
pub fn run(self) -> anyhow::Result<()> {
use ide_db::base_db::SourceDatabase;
let cargo_config =
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 56490061a7..bd5c5ec87d 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -998,7 +998,7 @@ impl GlobalState {
let path = VfsPath::from(path);
// If the file is in mem docs, it's managed by the client via
- // notifications so only set it if its not in there. Library files are
+ // notifications so only set it if it's not in there. Library files are
// exempt from that authority as they are considered immutable, for
// them disk is always the source of truth.
let is_library = self.source_root_config.path_is_library(&path);
diff --git a/crates/span/src/ast_id.rs b/crates/span/src/ast_id.rs
index f6500a9b4d..83a6748c01 100644
--- a/crates/span/src/ast_id.rs
+++ b/crates/span/src/ast_id.rs
@@ -1,8 +1,8 @@
//! `AstIdMap` allows to create stable IDs for "large" syntax nodes like items
//! and macro calls.
//!
-//! Specifically, it enumerates all items in a file and uses position of a an
-//! item as an ID. That way, id's don't change unless the set of items itself
+//! Specifically, it enumerates all items in a file and uses the position of an
+//! item as an ID. That way, IDs don't change unless the set of items itself
//! changes.
//!
//! These IDs are tricky. If one of them invalidates, its interned ID invalidates,
diff --git a/crates/vfs/src/lib.rs b/crates/vfs/src/lib.rs
index d48b984407..8d2c65f791 100644
--- a/crates/vfs/src/lib.rs
+++ b/crates/vfs/src/lib.rs
@@ -211,7 +211,7 @@ impl Vfs {
///
/// Returns `true` if the file was modified, and saves the [change](ChangedFile).
///
- /// If the path does not currently exists in the `Vfs`, allocates a new
+ /// If the path does not currently exist in the `Vfs`, allocates a new
/// [`FileId`] for it.
pub fn set_file_contents(&mut self, path: VfsPath, contents: Option<Vec<u8>>) -> bool {
let _p = span!(Level::INFO, "Vfs::set_file_contents").entered();
@@ -280,7 +280,7 @@ impl Vfs {
true
}
- /// Drain and returns all the changes in the `Vfs`.
+ /// Drains and returns all the changes in the `Vfs`.
pub fn take_changes(&mut self) -> IndexMap<FileId, ChangedFile, BuildHasherDefault<FxHasher>> {
mem::take(&mut self.changes)
}
@@ -292,7 +292,7 @@ impl Vfs {
/// Returns the id associated with `path`
///
- /// - If `path` does not exists in the `Vfs`, allocate a new id for it, associated with a
+ /// - If `path` does not exist in the `Vfs`, allocates a new id for it, associated with a
/// deleted file;
/// - Else, returns `path`'s id.
///
diff --git a/crates/vfs/src/loader.rs b/crates/vfs/src/loader.rs
index c49e4c4322..97e46ae894 100644
--- a/crates/vfs/src/loader.rs
+++ b/crates/vfs/src/loader.rs
@@ -60,7 +60,7 @@ pub enum Message {
n_total: usize,
/// The files that have been loaded successfully.
n_done: LoadingProgress,
- /// The dir being loaded, `None` if its for a file.
+ /// The dir being loaded, `None` if it's for a file.
dir: Option<AbsPathBuf>,
/// The [`Config`] version.
config_version: u32,
diff --git a/crates/vfs/src/path_interner.rs b/crates/vfs/src/path_interner.rs
index 225bfc7218..fbd1a624e3 100644
--- a/crates/vfs/src/path_interner.rs
+++ b/crates/vfs/src/path_interner.rs
@@ -17,7 +17,7 @@ pub(crate) struct PathInterner {
impl PathInterner {
/// Get the id corresponding to `path`.
///
- /// If `path` does not exists in `self`, returns [`None`].
+ /// If `path` does not exist in `self`, returns [`None`].
pub(crate) fn get(&self, path: &VfsPath) -> Option<FileId> {
self.map.get_index_of(path).map(|i| FileId(i as u32))
}
@@ -36,7 +36,7 @@ impl PathInterner {
///
/// # Panics
///
- /// Panics if `id` does not exists in `self`.
+ /// Panics if `id` does not exist in `self`.
pub(crate) fn lookup(&self, id: FileId) -> &VfsPath {
self.map.get_index(id.0 as usize).unwrap()
}