From 4fd361343449bcdf7af4642851dc5dbf772f1a68 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Mon, 11 Feb 2019 17:18:27 +0100 Subject: Fix some typos --- crates/ra_hir/src/code_model_api.rs | 6 +++--- crates/ra_hir/src/expr/scope.rs | 2 +- crates/ra_hir/src/ids.rs | 16 ++++++++-------- crates/ra_hir/src/nameres.rs | 2 +- crates/ra_hir/src/nameres/lower.rs | 2 +- crates/ra_hir/src/path.rs | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 94a08aa63..2ac05c836 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -134,7 +134,7 @@ impl Module { /// Topmost parent of this module. Every module has a `crate_root`, but some /// might be missing `krate`. This can happen if a module's file is not included - /// in the module tree of any target in Cargo.toml. + /// in the module tree of any target in `Cargo.toml`. pub fn crate_root(&self, db: &impl PersistentHirDatabase) -> Module { self.crate_root_impl(db) } @@ -351,7 +351,7 @@ impl Enum { db.type_for_def((*self).into()) } - // TODO move to a more general type + // TODO: move to a more general type /// Builds a resolver for type references inside this struct. pub fn resolver(&self, db: &impl HirDatabase) -> Resolver { // take the outer scope... @@ -495,7 +495,7 @@ impl Function { db.generic_params((*self).into()) } - // TODO move to a more general type for 'body-having' items + // TODO: move to a more general type for 'body-having' items /// Builds a resolver for code inside this item. pub fn resolver(&self, db: &impl HirDatabase) -> Resolver { // take the outer scope... diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs index 44d5c2429..bb8d50db8 100644 --- a/crates/ra_hir/src/expr/scope.rs +++ b/crates/ra_hir/src/expr/scope.rs @@ -84,7 +84,7 @@ impl ExprScopes { fn add_bindings(&mut self, body: &Body, scope: ScopeId, pat: PatId) { match &body[pat] { Pat::Bind { name, .. } => { - // bind can have a subpattern, but it's actually not allowed + // bind can have a sub pattern, but it's actually not allowed // to bind to things in there let entry = ScopeEntry { name: name.clone(), pat }; self.scopes[scope].entries.push(entry) diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index d3fa7d266..8d81d5ebf 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -46,24 +46,24 @@ impl HirInterner { /// This module defines a bunch of ids we are using. The most important ones are /// probably `HirFileId` and `DefId`. -/// Input to the analyzer is a set of files, where each file is indentified by +/// Input to the analyzer is a set of files, where each file is identified by /// `FileId` and contains source code. However, another source of source code in /// Rust are macros: each macro can be thought of as producing a "temporary /// file". To assign an id to such a file, we use the id of the macro call that /// produced the file. So, a `HirFileId` is either a `FileId` (source code /// written by user), or a `MacroCallId` (source code produced by macro). /// -/// What is a `MacroCallId`? Simplifying, it's a `HirFileId` of a file containin -/// the call plus the offset of the macro call in the file. Note that this is a -/// recursive definition! However, the size_of of `HirFileId` is finite -/// (because everything bottoms out at the real `FileId`) and small +/// What is a `MacroCallId`? Simplifying, it's a `HirFileId` of a file +/// containing the call plus the offset of the macro call in the file. Note that +/// this is a recursive definition! However, the size_of of `HirFileId` is +/// finite (because everything bottoms out at the real `FileId`) and small /// (`MacroCallId` uses the location interner). #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct HirFileId(HirFileIdRepr); impl HirFileId { /// For macro-expansion files, returns the file original source file the - /// expansionoriginated from. + /// expansion originated from. pub fn original_file(self, db: &impl PersistentHirDatabase) -> FileId { match self.0 { HirFileIdRepr::File(file_id) => file_id, @@ -324,9 +324,9 @@ impl SourceFileItems { fn init(&mut self, source_file: &SourceFile) { // By walking the tree in bread-first order we make sure that parents - // get lower ids then children. That is, addding a new child does not + // get lower ids then children. That is, adding a new child does not // change parent's id. This means that, say, adding a new function to a - // trait does not chage ids of top-level items, which helps caching. + // trait does not change ids of top-level items, which helps caching. bfs(source_file.syntax(), |it| { if let Some(module_item) = ast::ModuleItem::cast(it) { self.alloc(module_item.syntax()); diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index 261ebdf97..ffb20d564 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs @@ -490,7 +490,7 @@ impl ItemMap { None => { // we still have path segments left, but the path so far // didn't resolve in the types namespace => no resolution - // (don't break here because curr_per_ns might contain + // (don't break here because `curr_per_ns` might contain // something in the value namespace, and it would be wrong // to return that) return (PerNs::none(), ReachedFixedPoint::No); diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 7e9a3de2b..3cd496d7f 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs @@ -208,7 +208,7 @@ impl LoweredModule { } } ast::ModuleItemKind::Module(_) => { - // modules are handled separately direclty by nameres + // modules are handled separately directly by name res } }; } diff --git a/crates/ra_hir/src/path.rs b/crates/ra_hir/src/path.rs index 6a24c8aa7..8ed54607a 100644 --- a/crates/ra_hir/src/path.rs +++ b/crates/ra_hir/src/path.rs @@ -97,7 +97,7 @@ impl Path { return Some(q); } // TODO: this bottom up traversal is not too precise. - // Should we handle do a top-down analysiss, recording results? + // Should we handle do a top-down analysis, recording results? let use_tree_list = path.syntax().ancestors().find_map(ast::UseTreeList::cast)?; let use_tree = use_tree_list.parent_use_tree(); use_tree.path() -- cgit v1.2.3