Skip to content

Commit

Permalink
Spelling
Browse files Browse the repository at this point in the history
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref committed Apr 19, 2023
1 parent 2c251a7 commit bc7d84c
Show file tree
Hide file tree
Showing 83 changed files with 137 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .github/actions/github-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ perform github releases but they all tend to have their set of drawbacks.
Additionally nothing handles deleting releases which we need for our rolling
`dev` release.

To handle all this this action rolls-its-own implementation using the
To handle all this action rolls-its-own implementation using the
actions/toolkit repository and packages published there. These run in a Docker
container and take various inputs to orchestrate the release from the build.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
git config --global user.name "GitHub Action"
rm Cargo.lock
# Fix names for crates that were published before switch to kebab-case.
cargo workspaces rename --from base-db base_db
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-libs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
git config --global user.name "GitHub Action"
# Remove r-a crates from the workspaces so we don't auto-publish them as well
sed -i 's/ "crates\/\*"//' ./Cargo.toml
cargo workspaces publish --yes --exact --from-git --no-git-commit --allow-dirty
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
{
// Used for testing the extension with a local build of the LSP server (in `target/release`)
// with all other extendions loaded.
// with all other extensions loaded.
"name": "Run With Extensions",
"type": "extensionHost",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion bench_data/glorious_old_parser
Original file line number Diff line number Diff line change
Expand Up @@ -3808,7 +3808,7 @@ impl<'a> Parser<'a> {
if self.eat_keyword(keywords::Else) || !cond.returns() {
let sp = self.sess.source_map().next_point(lo);
let mut err = self.diagnostic()
.struct_span_err(sp, "missing condition for `if` statemement");
.struct_span_err(sp, "missing condition for `if` statement");
err.span_label(sp, "expected if condition here");
return Err(err)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/find_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const MAX_PATH_LEN: usize = 15;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum PrefixKind {
/// Causes paths to always start with either `self`, `super`, `crate` or a crate-name.
/// This is the same as plain, just that paths will start with `self` iprepended f the path
/// This is the same as plain, just that paths will start with `self` prepended if the path
/// starts with an identifier that is not a crate.
BySelf,
/// Causes paths to ignore imports in the local module.
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ impl Binding {
pub fn is_upvar(&self, relative_to: ExprId) -> bool {
match self.owner {
Some(x) => {
// We assign expression ids in a way that outer closures will recieve
// We assign expression ids in a way that outer closures will receive
// a lower id
x.into_raw() < relative_to.into_raw()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/macro_expansion_tests/mbe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn#19 main#20(#21)#21 {#22
);
}
#[test]
fn float_field_acces_macro_input() {
fn float_field_access_macro_input() {
check(
r#"
macro_rules! foo {
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/nameres/proc_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Attrs {
}

// This fn is intended for `#[proc_macro_derive(..)]` and `#[rustc_builtin_macro(..)]`, which have
// the same strucuture.
// the same structure.
#[rustfmt::skip]
pub(crate) fn parse_macro_name_and_helper_attrs(tt: &[TokenTree]) -> Option<(Name, Box<[Name]>)> {
match tt {
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/nameres/tests/mod_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ mod module;
//- /module.rs
#![cfg(NEVER)]
struct AlsoShoulntAppear;
struct AlsoShouldNotAppear;
"#,
expect![[r#"
crate
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-expand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ impl ExpansionInfo {
(&attr_args.1, self.attr_input_or_mac_def.clone()?.syntax().cloned())
}
MacroCallKind::Attr { attr_args, .. } => {
// try unshifting the the token id, if unshifting fails, the token resides in the non-item attribute input
// try unshifting the token id, if unshifting fails, the token resides in the non-item attribute input
// note that the `TokenExpander::map_id_up` earlier only unshifts for declarative macros, so we don't double unshift with this
match self.macro_arg_shift.unshift(token_id) {
Some(unshifted) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/diagnostics/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl ExprValidator {

let report = compute_match_usefulness(&cx, &m_arms, scrut_ty);

// FIXME Report unreacheble arms
// FIXME Report unreachable arms
// https://github.com/rust-lang/rust/blob/f31622a50/compiler/rustc_mir_build/src/thir/pattern/check_match.rs#L200

let witnesses = report.non_exhaustiveness_witnesses;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn expand_or_pat(pat: &Pat) -> Vec<&Pat> {
pats
}

/// [Constructor] uses this in umimplemented variants.
/// [Constructor] uses this in unimplemented variants.
/// It allows porting match expressions from upstream algorithm without losing semantics.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub(super) enum Void {}
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/diagnostics/match_check/pat_util.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Pattern untilities.
//! Pattern utilities.
//!
//! Originates from `rustc_hir::pat_util`

Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/diagnostics/match_check/usefulness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ pub(crate) enum Reachability {
/// The arm is reachable. This additionally carries a set of or-pattern branches that have been
/// found to be unreachable despite the overall arm being reachable. Used only in the presence
/// of or-patterns, otherwise it stays empty.
// FIXME: store ureachable subpattern IDs
// FIXME: store unreachable subpattern IDs
Reachable,
/// The arm is unreachable.
Unreachable,
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ pub(crate) struct InferenceContext<'a> {
current_closure: Option<ClosureId>,
/// Stores the list of closure ids that need to be analyzed before this closure. See the
/// comment on `InferenceContext::sort_closures`
closure_dependecies: FxHashMap<ClosureId, Vec<ClosureId>>,
closure_dependencies: FxHashMap<ClosureId, Vec<ClosureId>>,
deferred_closures: FxHashMap<ClosureId, Vec<(Ty, Ty, Vec<Ty>, ExprId)>>,
}

Expand Down Expand Up @@ -555,7 +555,7 @@ impl<'a> InferenceContext<'a> {
current_captures: vec![],
current_closure: None,
deferred_closures: FxHashMap::default(),
closure_dependecies: FxHashMap::default(),
closure_dependencies: FxHashMap::default(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/infer/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ impl InferenceContext<'_> {
let mut deferred_closures = mem::take(&mut self.deferred_closures);
let mut dependents_count: FxHashMap<ClosureId, usize> =
deferred_closures.keys().map(|x| (*x, 0)).collect();
for (_, deps) in &self.closure_dependecies {
for (_, deps) in &self.closure_dependencies {
for dep in deps {
*dependents_count.entry(*dep).or_default() += 1;
}
Expand All @@ -768,7 +768,7 @@ impl InferenceContext<'_> {
if let Some(d) = deferred_closures.remove(&x) {
result.push((x, d));
}
for dep in self.closure_dependecies.get(&x).into_iter().flat_map(|x| x.iter()) {
for dep in self.closure_dependencies.get(&x).into_iter().flat_map(|x| x.iter()) {
let cnt = dependents_count.get_mut(dep).unwrap();
*cnt -= 1;
if *cnt == 0 {
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/infer/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl<'a> InferenceContext<'a> {
.intern(Interner);
self.deferred_closures.entry(closure_id).or_default();
if let Some(c) = self.current_closure {
self.closure_dependecies.entry(c).or_default().push(closure_id);
self.closure_dependencies.entry(c).or_default().push(closure_id);
}
(Some(closure_id), closure_ty, None)
}
Expand Down Expand Up @@ -349,7 +349,7 @@ impl<'a> InferenceContext<'a> {
self.table.resolve_completely(callee_ty.clone()).kind(Interner)
{
if let Some(par) = self.current_closure {
self.closure_dependecies.entry(par).or_default().push(*c);
self.closure_dependencies.entry(par).or_default().push(*c);
}
self.deferred_closures.entry(*c).or_default().push((
derefed_callee.clone(),
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub type Guidance = chalk_solve::Guidance<Interner>;
pub type WhereClause = chalk_ir::WhereClause<Interner>;

/// A constant can have reference to other things. Memory map job is holding
/// the neccessary bits of memory of the const eval session to keep the constant
/// the necessary bits of memory of the const eval session to keep the constant
/// meaningful.
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct MemoryMap(pub HashMap<usize, Vec<u8>>);
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct Local {
/// This is what is implemented in miri today. Are these the semantics we want for MIR? Is this
/// something we can even decide without knowing more about Rust's memory model?
///
/// **Needs clarifiation:** Is loading a place that has its variant index set well-formed? Miri
/// **Needs clarification:** Is loading a place that has its variant index set well-formed? Miri
/// currently implements it, but it seems like this may be something to check against in the
/// validator.
#[derive(Debug, PartialEq, Eq, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/mir/borrowck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn place_case(lvalue: &Place) -> ProjectionCase {

/// Returns a map from basic blocks to the set of locals that might be ever initialized before
/// the start of the block. Only `StorageDead` can remove something from this map, and we ignore
/// `Uninit` and `drop` and similars after initialization.
/// `Uninit` and `drop` and similar after initialization.
fn ever_initialized_map(body: &MirBody) -> ArenaMap<BasicBlockId, ArenaMap<LocalId, bool>> {
let mut result: ArenaMap<BasicBlockId, ArenaMap<LocalId, bool>> =
body.basic_blocks.iter().map(|x| (x.0, ArenaMap::default())).collect();
Expand Down
12 changes: 6 additions & 6 deletions crates/hir-ty/src/mir/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Interval {
}

fn write_from_interval(&self, memory: &mut Evaluator<'_>, interval: Interval) -> Result<()> {
// FIXME: this could be more efficent
// FIXME: this could be more efficient
let bytes = &interval.get(memory)?.to_vec();
memory.write_memory(self.addr, bytes)
}
Expand Down Expand Up @@ -692,16 +692,16 @@ impl Evaluator<'_> {
Owned(r[0..lc.len()].into())
}
BinOp::Shl | BinOp::Shr => {
let shift_amout = if r128 < 0 {
let shift_amount = if r128 < 0 {
return Err(MirEvalError::Panic(format!("Overflow in {op:?}")));
} else if r128 > 128 {
return Err(MirEvalError::Panic(format!("Overflow in {op:?}")));
} else {
r128 as u8
};
let r = match op {
BinOp::Shl => l128 << shift_amout,
BinOp::Shr => l128 >> shift_amout,
BinOp::Shl => l128 << shift_amount,
BinOp::Shr => l128 >> shift_amount,
_ => unreachable!(),
};
Owned(r.to_le_bytes()[0..lc.len()].into())
Expand Down Expand Up @@ -966,7 +966,7 @@ impl Evaluator<'_> {

fn make_by_layout(
&mut self,
size: usize, // Not neccessarily equal to variant_layout.size
size: usize, // Not necessarily equal to variant_layout.size
variant_layout: &Layout,
tag: Option<(usize, usize, i128)>,
values: impl Iterator<Item = Interval>,
Expand Down Expand Up @@ -1481,7 +1481,7 @@ impl Evaluator<'_> {
is_dyn_method(self.db, self.trait_env.clone(), def, generic_args.clone())
{
// In the layout of current possible receiver, which at the moment of writing this code is one of
// `&T`, `&mut T`, `Box<T>`, `Rc<T>`, `Arc<T>`, and `Pin<P>` where `P` is one of possible recievers,
// `&T`, `&mut T`, `Box<T>`, `Rc<T>`, `Arc<T>`, and `Pin<P>` where `P` is one of possible receivers,
// the vtable is exactly in the `[ptr_size..2*ptr_size]` bytes. So we can use it without branching on
// the type.
let ty = self
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/mir/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
);
let prev_label = if let Some(label) = label {
// We should generate the end now, to make sure that it wouldn't change later. It is
// bad as we may emit end (unneccessary unreachable block) for unterminating loop, but
// bad as we may emit end (unnecessary unreachable block) for unterminating loop, but
// it should not affect correctness.
self.current_loop_end()?;
self.labeled_loop_blocks
Expand Down Expand Up @@ -1278,7 +1278,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
/// the appropriated places.
fn push_storage_live(&mut self, b: BindingId, current: BasicBlockId) -> Result<()> {
// Current implementation is wrong. It adds no `StorageDead` at the end of scope, and before each break
// and continue. It just add a `StorageDead` before the `StorageLive`, which is not wrong, but unneeeded in
// and continue. It just add a `StorageDead` before the `StorageLive`, which is not wrong, but unneeded in
// the proper implementation. Due this limitation, implementing a borrow checker on top of this mir will falsely
// allow this:
//
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/mir/lower/pattern_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl MirLowerCtx<'_> {
/// mismatched path block is `None`.
///
/// By default, it will create a new block for mismatched path. If you already have one, you can provide it with
/// `current_else` argument to save an unneccessary jump. If `current_else` isn't `None`, the result mismatched path
/// `current_else` argument to save an unnecessary jump. If `current_else` isn't `None`, the result mismatched path
/// wouldn't be `None` as well. Note that this function will add jumps to the beginning of the `current_else` block,
/// so it should be an empty block.
pub(super) fn pattern_match(
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ fn infix_parse<T, S>(_state: S, _level_code: &Fn(S)) -> T {
loop {}
}
fn parse_arule() {
fn parse_a_rule() {
infix_parse((), &(|_recurse| ()))
}
"#,
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/tests/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4250,7 +4250,7 @@ impl Trait for () {
}

#[test]
fn associted_type_in_struct_expr_path_enum() {
fn associated_type_in_struct_expr_path_enum() {
// FIXME: All annotation should be resolvable.
// For lines marked as unstable, see rust-lang/rust#86935.
// FIXME: Remove the comments once stablized.
Expand Down
6 changes: 3 additions & 3 deletions crates/hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ fn precise_macro_call_location(
ast: &MacroCallKind,
db: &dyn HirDatabase,
) -> (InFile<SyntaxNodePtr>, Option<TextRange>, Option<String>, MacroKind) {
// FIXME: maaybe we actually want slightly different ranges for the different macro diagnostics
// FIXME: maybe we actually want slightly different ranges for the different macro diagnostics
// - e.g. the full attribute for macro errors, but only the name for name resolution
match ast {
MacroCallKind::FnLike { ast_id, .. } => {
Expand Down Expand Up @@ -1522,7 +1522,7 @@ impl DefWithBody {
match source_map.expr_syntax(expr) {
Ok(expr) => acc.push(MissingUnsafe { expr }.into()),
Err(SyntheticSyntax) => {
// FIXME: Here and eslwhere in this file, the `expr` was
// FIXME: Here and elsewhere in this file, the `expr` was
// desugared, report or assert that this doesn't happen.
}
}
Expand Down Expand Up @@ -3654,7 +3654,7 @@ impl Type {
self.as_adt()
.and_then(|a| a.lifetime(db).and_then(|lt| Some((&lt.name).to_smol_str())))
.into_iter()
// add the type and const paramaters
// add the type and const parameters
.chain(self.type_and_const_arguments(db))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl Foo for S {
}

#[test]
fn test_copied_overriden_members() {
fn test_copied_overridden_members() {
check_assist(
add_missing_impl_members,
r#"
Expand Down
4 changes: 2 additions & 2 deletions crates/ide-assists/src/handlers/auto_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fn relevance_score(
// get the distance between the imported path and the current module
// (prefer items that are more local)
Some((item_module, current_module)) => {
score -= module_distance_hueristic(db, current_module, &item_module) as i32;
score -= module_distance_heuristic(db, current_module, &item_module) as i32;
}

// could not find relevant modules, so just use the length of the path as an estimate
Expand All @@ -214,7 +214,7 @@ fn relevance_score(
}

/// A heuristic that gives a higher score to modules that are more separated.
fn module_distance_hueristic(db: &dyn HirDatabase, current: &Module, item: &Module) -> usize {
fn module_distance_heuristic(db: &dyn HirDatabase, current: &Module, item: &Module) -> usize {
// get the path starting from the item to the respective crate roots
let mut current_path = current.path_to_root(db);
let mut item_path = item.path_to_root(db);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ fn main() {
}

#[test]
fn ignore_statements_aftert_if() {
fn ignore_statements_after_if() {
check_assist_not_applicable(
convert_to_guarded_return,
r#"
Expand Down
6 changes: 3 additions & 3 deletions crates/ide-assists/src/handlers/extract_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ struct OutlivedLocal {

/// Container of local variable usages
///
/// Semanticall same as `UsageSearchResult`, but provides more convenient interface
/// Semantically same as `UsageSearchResult`, but provides more convenient interface
struct LocalUsages(ide_db::search::UsageSearchResult);

impl LocalUsages {
Expand Down Expand Up @@ -1291,8 +1291,8 @@ fn find_non_trait_impl(trait_impl: &SyntaxNode) -> Option<ast::Impl> {
let as_impl = ast::Impl::cast(trait_impl.clone())?;
let impl_type = Some(impl_type_name(&as_impl)?);

let sibblings = trait_impl.parent()?.children();
sibblings
let siblings = trait_impl.parent()?.children();
siblings
.filter_map(ast::Impl::cast)
.find(|s| impl_type_name(s) == impl_type && !is_trait_impl(s))
}
Expand Down
Loading

0 comments on commit bc7d84c

Please sign in to comment.