Skip to content

Commit 2400b36

Browse files
committed
Auto merge of #14577 - jsoref:spelling, r=lnicola
Spelling This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling). The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796 The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293 closes #14567
2 parents 112464f + bc7d84c commit 2400b36

File tree

83 files changed

+137
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+137
-136
lines changed

.github/actions/github-release/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ perform github releases but they all tend to have their set of drawbacks.
1010
Additionally nothing handles deleting releases which we need for our rolling
1111
`dev` release.
1212

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

.github/workflows/autopublish.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
shell: bash
3333
run: |
3434
git config --global user.email "[email protected]"
35-
git config --global user.name "Github Action"
35+
git config --global user.name "GitHub Action"
3636
rm Cargo.lock
3737
# Fix names for crates that were published before switch to kebab-case.
3838
cargo workspaces rename --from base-db base_db

.github/workflows/publish-libs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
shell: bash
3030
run: |
3131
git config --global user.email "[email protected]"
32-
git config --global user.name "Github Action"
32+
git config --global user.name "GitHub Action"
3333
# Remove r-a crates from the workspaces so we don't auto-publish them as well
3434
sed -i 's/ "crates\/\*"//' ./Cargo.toml
3535
cargo workspaces publish --yes --exact --from-git --no-git-commit --allow-dirty

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
{
7474
// Used for testing the extension with a local build of the LSP server (in `target/release`)
75-
// with all other extendions loaded.
75+
// with all other extensions loaded.
7676
"name": "Run With Extensions",
7777
"type": "extensionHost",
7878
"request": "launch",

bench_data/glorious_old_parser

+1-1
Original file line numberDiff line numberDiff line change
@@ -3808,7 +3808,7 @@ impl<'a> Parser<'a> {
38083808
if self.eat_keyword(keywords::Else) || !cond.returns() {
38093809
let sp = self.sess.source_map().next_point(lo);
38103810
let mut err = self.diagnostic()
3811-
.struct_span_err(sp, "missing condition for `if` statemement");
3811+
.struct_span_err(sp, "missing condition for `if` statement");
38123812
err.span_label(sp, "expected if condition here");
38133813
return Err(err)
38143814
}

crates/hir-def/src/find_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const MAX_PATH_LEN: usize = 15;
4242
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
4343
pub enum PrefixKind {
4444
/// Causes paths to always start with either `self`, `super`, `crate` or a crate-name.
45-
/// This is the same as plain, just that paths will start with `self` iprepended f the path
45+
/// This is the same as plain, just that paths will start with `self` prepended if the path
4646
/// starts with an identifier that is not a crate.
4747
BySelf,
4848
/// Causes paths to ignore imports in the local module.

crates/hir-def/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ impl Binding {
502502
pub fn is_upvar(&self, relative_to: ExprId) -> bool {
503503
match self.owner {
504504
Some(x) => {
505-
// We assign expression ids in a way that outer closures will recieve
505+
// We assign expression ids in a way that outer closures will receive
506506
// a lower id
507507
x.into_raw() < relative_to.into_raw()
508508
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn#19 main#20(#21)#21 {#22
9898
);
9999
}
100100
#[test]
101-
fn float_field_acces_macro_input() {
101+
fn float_field_access_macro_input() {
102102
check(
103103
r#"
104104
macro_rules! foo {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Attrs {
5252
}
5353

5454
// This fn is intended for `#[proc_macro_derive(..)]` and `#[rustc_builtin_macro(..)]`, which have
55-
// the same strucuture.
55+
// the same structure.
5656
#[rustfmt::skip]
5757
pub(crate) fn parse_macro_name_and_helper_attrs(tt: &[TokenTree]) -> Option<(Name, Box<[Name]>)> {
5858
match tt {

crates/hir-def/src/nameres/tests/mod_resolution.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ mod module;
887887
//- /module.rs
888888
#![cfg(NEVER)]
889889
890-
struct AlsoShoulntAppear;
890+
struct AlsoShouldNotAppear;
891891
"#,
892892
expect![[r#"
893893
crate

crates/hir-expand/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ impl ExpansionInfo {
701701
(&attr_args.1, self.attr_input_or_mac_def.clone()?.syntax().cloned())
702702
}
703703
MacroCallKind::Attr { attr_args, .. } => {
704-
// try unshifting the the token id, if unshifting fails, the token resides in the non-item attribute input
704+
// try unshifting the token id, if unshifting fails, the token resides in the non-item attribute input
705705
// note that the `TokenExpander::map_id_up` earlier only unshifts for declarative macros, so we don't double unshift with this
706706
match self.macro_arg_shift.unshift(token_id) {
707707
Some(unshifted) => {

crates/hir-ty/src/diagnostics/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl ExprValidator {
207207

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

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

213213
let witnesses = report.non_exhaustiveness_witnesses;

crates/hir-ty/src/diagnostics/match_check/deconstruct_pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn expand_or_pat(pat: &Pat) -> Vec<&Pat> {
8282
pats
8383
}
8484

85-
/// [Constructor] uses this in umimplemented variants.
85+
/// [Constructor] uses this in unimplemented variants.
8686
/// It allows porting match expressions from upstream algorithm without losing semantics.
8787
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
8888
pub(super) enum Void {}

crates/hir-ty/src/diagnostics/match_check/pat_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Pattern untilities.
1+
//! Pattern utilities.
22
//!
33
//! Originates from `rustc_hir::pat_util`
44

crates/hir-ty/src/diagnostics/match_check/usefulness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ pub(crate) enum Reachability {
755755
/// The arm is reachable. This additionally carries a set of or-pattern branches that have been
756756
/// found to be unreachable despite the overall arm being reachable. Used only in the presence
757757
/// of or-patterns, otherwise it stays empty.
758-
// FIXME: store ureachable subpattern IDs
758+
// FIXME: store unreachable subpattern IDs
759759
Reachable,
760760
/// The arm is unreachable.
761761
Unreachable,

crates/hir-ty/src/infer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ pub(crate) struct InferenceContext<'a> {
483483
current_closure: Option<ClosureId>,
484484
/// Stores the list of closure ids that need to be analyzed before this closure. See the
485485
/// comment on `InferenceContext::sort_closures`
486-
closure_dependecies: FxHashMap<ClosureId, Vec<ClosureId>>,
486+
closure_dependencies: FxHashMap<ClosureId, Vec<ClosureId>>,
487487
deferred_closures: FxHashMap<ClosureId, Vec<(Ty, Ty, Vec<Ty>, ExprId)>>,
488488
}
489489

@@ -555,7 +555,7 @@ impl<'a> InferenceContext<'a> {
555555
current_captures: vec![],
556556
current_closure: None,
557557
deferred_closures: FxHashMap::default(),
558-
closure_dependecies: FxHashMap::default(),
558+
closure_dependencies: FxHashMap::default(),
559559
}
560560
}
561561

crates/hir-ty/src/infer/closure.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ impl InferenceContext<'_> {
783783
let mut deferred_closures = mem::take(&mut self.deferred_closures);
784784
let mut dependents_count: FxHashMap<ClosureId, usize> =
785785
deferred_closures.keys().map(|x| (*x, 0)).collect();
786-
for (_, deps) in &self.closure_dependecies {
786+
for (_, deps) in &self.closure_dependencies {
787787
for dep in deps {
788788
*dependents_count.entry(*dep).or_default() += 1;
789789
}
@@ -795,7 +795,7 @@ impl InferenceContext<'_> {
795795
if let Some(d) = deferred_closures.remove(&x) {
796796
result.push((x, d));
797797
}
798-
for dep in self.closure_dependecies.get(&x).into_iter().flat_map(|x| x.iter()) {
798+
for dep in self.closure_dependencies.get(&x).into_iter().flat_map(|x| x.iter()) {
799799
let cnt = dependents_count.get_mut(dep).unwrap();
800800
*cnt -= 1;
801801
if *cnt == 0 {

crates/hir-ty/src/infer/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<'a> InferenceContext<'a> {
287287
.intern(Interner);
288288
self.deferred_closures.entry(closure_id).or_default();
289289
if let Some(c) = self.current_closure {
290-
self.closure_dependecies.entry(c).or_default().push(closure_id);
290+
self.closure_dependencies.entry(c).or_default().push(closure_id);
291291
}
292292
(Some(closure_id), closure_ty, None)
293293
}
@@ -349,7 +349,7 @@ impl<'a> InferenceContext<'a> {
349349
self.table.resolve_completely(callee_ty.clone()).kind(Interner)
350350
{
351351
if let Some(par) = self.current_closure {
352-
self.closure_dependecies.entry(par).or_default().push(*c);
352+
self.closure_dependencies.entry(par).or_default().push(*c);
353353
}
354354
self.deferred_closures.entry(*c).or_default().push((
355355
derefed_callee.clone(),

crates/hir-ty/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub type Guidance = chalk_solve::Guidance<Interner>;
148148
pub type WhereClause = chalk_ir::WhereClause<Interner>;
149149

150150
/// A constant can have reference to other things. Memory map job is holding
151-
/// the neccessary bits of memory of the const eval session to keep the constant
151+
/// the necessary bits of memory of the const eval session to keep the constant
152152
/// meaningful.
153153
#[derive(Debug, Default, Clone, PartialEq, Eq)]
154154
pub struct MemoryMap(pub HashMap<usize, Vec<u8>>);

crates/hir-ty/src/mir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub struct Local {
5555
/// This is what is implemented in miri today. Are these the semantics we want for MIR? Is this
5656
/// something we can even decide without knowing more about Rust's memory model?
5757
///
58-
/// **Needs clarifiation:** Is loading a place that has its variant index set well-formed? Miri
58+
/// **Needs clarification:** Is loading a place that has its variant index set well-formed? Miri
5959
/// currently implements it, but it seems like this may be something to check against in the
6060
/// validator.
6161
#[derive(Debug, PartialEq, Eq, Clone)]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fn place_case(lvalue: &Place) -> ProjectionCase {
110110

111111
/// Returns a map from basic blocks to the set of locals that might be ever initialized before
112112
/// the start of the block. Only `StorageDead` can remove something from this map, and we ignore
113-
/// `Uninit` and `drop` and similars after initialization.
113+
/// `Uninit` and `drop` and similar after initialization.
114114
fn ever_initialized_map(body: &MirBody) -> ArenaMap<BasicBlockId, ArenaMap<LocalId, bool>> {
115115
let mut result: ArenaMap<BasicBlockId, ArenaMap<LocalId, bool>> =
116116
body.basic_blocks.iter().map(|x| (x.0, ArenaMap::default())).collect();

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl Interval {
123123
}
124124

125125
fn write_from_interval(&self, memory: &mut Evaluator<'_>, interval: Interval) -> Result<()> {
126-
// FIXME: this could be more efficent
126+
// FIXME: this could be more efficient
127127
let bytes = &interval.get(memory)?.to_vec();
128128
memory.write_memory(self.addr, bytes)
129129
}
@@ -692,16 +692,16 @@ impl Evaluator<'_> {
692692
Owned(r[0..lc.len()].into())
693693
}
694694
BinOp::Shl | BinOp::Shr => {
695-
let shift_amout = if r128 < 0 {
695+
let shift_amount = if r128 < 0 {
696696
return Err(MirEvalError::Panic(format!("Overflow in {op:?}")));
697697
} else if r128 > 128 {
698698
return Err(MirEvalError::Panic(format!("Overflow in {op:?}")));
699699
} else {
700700
r128 as u8
701701
};
702702
let r = match op {
703-
BinOp::Shl => l128 << shift_amout,
704-
BinOp::Shr => l128 >> shift_amout,
703+
BinOp::Shl => l128 << shift_amount,
704+
BinOp::Shr => l128 >> shift_amount,
705705
_ => unreachable!(),
706706
};
707707
Owned(r.to_le_bytes()[0..lc.len()].into())
@@ -966,7 +966,7 @@ impl Evaluator<'_> {
966966

967967
fn make_by_layout(
968968
&mut self,
969-
size: usize, // Not neccessarily equal to variant_layout.size
969+
size: usize, // Not necessarily equal to variant_layout.size
970970
variant_layout: &Layout,
971971
tag: Option<(usize, usize, i128)>,
972972
values: impl Iterator<Item = Interval>,
@@ -1481,7 +1481,7 @@ impl Evaluator<'_> {
14811481
is_dyn_method(self.db, self.trait_env.clone(), def, generic_args.clone())
14821482
{
14831483
// In the layout of current possible receiver, which at the moment of writing this code is one of
1484-
// `&T`, `&mut T`, `Box<T>`, `Rc<T>`, `Arc<T>`, and `Pin<P>` where `P` is one of possible recievers,
1484+
// `&T`, `&mut T`, `Box<T>`, `Rc<T>`, `Arc<T>`, and `Pin<P>` where `P` is one of possible receivers,
14851485
// the vtable is exactly in the `[ptr_size..2*ptr_size]` bytes. So we can use it without branching on
14861486
// the type.
14871487
let ty = self

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
12051205
);
12061206
let prev_label = if let Some(label) = label {
12071207
// We should generate the end now, to make sure that it wouldn't change later. It is
1208-
// bad as we may emit end (unneccessary unreachable block) for unterminating loop, but
1208+
// bad as we may emit end (unnecessary unreachable block) for unterminating loop, but
12091209
// it should not affect correctness.
12101210
self.current_loop_end()?;
12111211
self.labeled_loop_blocks
@@ -1277,7 +1277,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
12771277
/// the appropriated places.
12781278
fn push_storage_live(&mut self, b: BindingId, current: BasicBlockId) -> Result<()> {
12791279
// Current implementation is wrong. It adds no `StorageDead` at the end of scope, and before each break
1280-
// and continue. It just add a `StorageDead` before the `StorageLive`, which is not wrong, but unneeeded in
1280+
// and continue. It just add a `StorageDead` before the `StorageLive`, which is not wrong, but unneeded in
12811281
// the proper implementation. Due this limitation, implementing a borrow checker on top of this mir will falsely
12821282
// allow this:
12831283
//

crates/hir-ty/src/mir/lower/pattern_matching.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl MirLowerCtx<'_> {
2323
/// mismatched path block is `None`.
2424
///
2525
/// By default, it will create a new block for mismatched path. If you already have one, you can provide it with
26-
/// `current_else` argument to save an unneccessary jump. If `current_else` isn't `None`, the result mismatched path
26+
/// `current_else` argument to save an unnecessary jump. If `current_else` isn't `None`, the result mismatched path
2727
/// wouldn't be `None` as well. Note that this function will add jumps to the beginning of the `current_else` block,
2828
/// so it should be an empty block.
2929
pub(super) fn pattern_match(

crates/hir-ty/src/tests/regression.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ fn infix_parse<T, S>(_state: S, _level_code: &Fn(S)) -> T {
10601060
loop {}
10611061
}
10621062
1063-
fn parse_arule() {
1063+
fn parse_a_rule() {
10641064
infix_parse((), &(|_recurse| ()))
10651065
}
10661066
"#,

crates/hir-ty/src/tests/traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4250,7 +4250,7 @@ impl Trait for () {
42504250
}
42514251

42524252
#[test]
4253-
fn associted_type_in_struct_expr_path_enum() {
4253+
fn associated_type_in_struct_expr_path_enum() {
42544254
// FIXME: All annotation should be resolvable.
42554255
// For lines marked as unstable, see rust-lang/rust#86935.
42564256
// FIXME: Remove the comments once stablized.

crates/hir/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ fn precise_macro_call_location(
841841
ast: &MacroCallKind,
842842
db: &dyn HirDatabase,
843843
) -> (InFile<SyntaxNodePtr>, Option<TextRange>, Option<String>, MacroKind) {
844-
// FIXME: maaybe we actually want slightly different ranges for the different macro diagnostics
844+
// FIXME: maybe we actually want slightly different ranges for the different macro diagnostics
845845
// - e.g. the full attribute for macro errors, but only the name for name resolution
846846
match ast {
847847
MacroCallKind::FnLike { ast_id, .. } => {
@@ -1562,7 +1562,7 @@ impl DefWithBody {
15621562
match source_map.expr_syntax(expr) {
15631563
Ok(expr) => acc.push(MissingUnsafe { expr }.into()),
15641564
Err(SyntheticSyntax) => {
1565-
// FIXME: Here and eslwhere in this file, the `expr` was
1565+
// FIXME: Here and elsewhere in this file, the `expr` was
15661566
// desugared, report or assert that this doesn't happen.
15671567
}
15681568
}
@@ -3697,7 +3697,7 @@ impl Type {
36973697
self.as_adt()
36983698
.and_then(|a| a.lifetime(db).and_then(|lt| Some((&lt.name).to_smol_str())))
36993699
.into_iter()
3700-
// add the type and const paramaters
3700+
// add the type and const parameters
37013701
.chain(self.type_and_const_arguments(db))
37023702
}
37033703

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl Foo for S {
252252
}
253253

254254
#[test]
255-
fn test_copied_overriden_members() {
255+
fn test_copied_overridden_members() {
256256
check_assist(
257257
add_missing_impl_members,
258258
r#"

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn relevance_score(
203203
// get the distance between the imported path and the current module
204204
// (prefer items that are more local)
205205
Some((item_module, current_module)) => {
206-
score -= module_distance_hueristic(db, current_module, &item_module) as i32;
206+
score -= module_distance_heuristic(db, current_module, &item_module) as i32;
207207
}
208208

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

216216
/// A heuristic that gives a higher score to modules that are more separated.
217-
fn module_distance_hueristic(db: &dyn HirDatabase, current: &Module, item: &Module) -> usize {
217+
fn module_distance_heuristic(db: &dyn HirDatabase, current: &Module, item: &Module) -> usize {
218218
// get the path starting from the item to the respective crate roots
219219
let mut current_path = current.path_to_root(db);
220220
let mut item_path = item.path_to_root(db);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ fn main() {
504504
}
505505

506506
#[test]
507-
fn ignore_statements_aftert_if() {
507+
fn ignore_statements_after_if() {
508508
check_assist_not_applicable(
509509
convert_to_guarded_return,
510510
r#"

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ struct OutlivedLocal {
374374

375375
/// Container of local variable usages
376376
///
377-
/// Semanticall same as `UsageSearchResult`, but provides more convenient interface
377+
/// Semantically same as `UsageSearchResult`, but provides more convenient interface
378378
struct LocalUsages(ide_db::search::UsageSearchResult);
379379

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

1294-
let sibblings = trait_impl.parent()?.children();
1295-
sibblings
1294+
let siblings = trait_impl.parent()?.children();
1295+
siblings
12961296
.filter_map(ast::Impl::cast)
12971297
.find(|s| impl_type_name(s) == impl_type && !is_trait_impl(s))
12981298
}

0 commit comments

Comments
 (0)