Skip to content

Commit 8b65632

Browse files
committed
Auto merge of #10419 - deining:fix/typos, r=Jarcho
Fixing typos changelog: none
2 parents 2742ac0 + 03a3f74 commit 8b65632

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

Diff for: book/src/development/proposals/syntax-tree-patterns.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ The second part of the motivation is clippy's dependence on unstable
6868
compiler-internal data structures. Clippy lints are currently written against
6969
the compiler's AST / HIR which means that even small changes in these data
7070
structures might break a lot of lints. The second goal of this RFC is to **make
71-
lints independant of the compiler's AST / HIR data structures**.
71+
lints independent of the compiler's AST / HIR data structures**.
7272

7373
# Approach
7474

7575
A lot of complexity in writing lints currently seems to come from having to
7676
manually implement the matching logic (see code samples above). It's an
77-
imparative style that describes *how* to match a syntax tree node instead of
77+
imperative style that describes *how* to match a syntax tree node instead of
7878
specifying *what* should be matched against declaratively. In other areas, it's
7979
common to use declarative patterns to describe desired information and let the
8080
implementation do the actual matching. A well-known example of this approach are
@@ -270,7 +270,7 @@ pattern!{
270270
// matches if expressions that **may or may not** have an else block
271271
// Attn: `If(_, _, _)` matches only ifs that **have** an else block
272272
//
273-
// | if with else block | if witout else block
273+
// | if with else block | if without else block
274274
// If(_, _, _) | match | no match
275275
// If(_, _, _?) | match | match
276276
// If(_, _, ()) | no match | match
@@ -568,7 +568,7 @@ another example, `Array( Lit(_)* )` is a valid pattern because the parameter of
568568
569569
## The IsMatch Trait
570570

571-
The pattern syntax and the *PatternTree* are independant of specific syntax tree
571+
The pattern syntax and the *PatternTree* are independent of specific syntax tree
572572
implementations (rust ast / hir, syn, ...). When looking at the different
573573
pattern examples in the previous sections, it can be seen that the patterns
574574
don't contain any information specific to a certain syntax tree implementation.
@@ -717,7 +717,7 @@ if false {
717717
#### Problems
718718

719719
Extending Rust syntax (which is quite complex by itself) with additional syntax
720-
needed for specifying patterns (alternations, sequences, repetisions, named
720+
needed for specifying patterns (alternations, sequences, repetitions, named
721721
submatches, ...) might become difficult to read and really hard to parse
722722
properly.
723723

@@ -858,7 +858,7 @@ would be evaluated as soon as the `Block(_)#then` was matched.
858858
Another idea in this area would be to introduce a syntax for backreferences.
859859
They could be used to require that multiple parts of a pattern should match the
860860
same value. For example, the `assign_op_pattern` lint that searches for `a = a
861-
op b` and recommends changing it to `a op= b` requires that both occurrances of
861+
op b` and recommends changing it to `a op= b` requires that both occurrences of
862862
`a` are the same. Using `=#...` as syntax for backreferences, the lint could be
863863
implemented like this:
864864

@@ -882,7 +882,7 @@ least two return statements" could be a practical addition.
882882
For patterns like "a literal that is not a boolean literal" one currently needs
883883
to list all alternatives except the boolean case. Introducing a negation
884884
operator that allows to write `Lit(!Bool(_))` might be a good idea. This pattern
885-
would be eqivalent to `Lit( Char(_) | Int(_) )` (given that currently only three
885+
would be equivalent to `Lit( Char(_) | Int(_) )` (given that currently only three
886886
literal types are implemented).
887887

888888
#### Functional composition

Diff for: clippy_lints/src/functions/impl_trait_in_params.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(super) fn check_fn<'tcx>(cx: &LateContext<'_>, kind: &'tcx FnKind<'_>, body:
2222
if let Some(gen_span) = generics.span_for_param_suggestion() {
2323
diag.span_suggestion_with_style(
2424
gen_span,
25-
"add a type paremeter",
25+
"add a type parameter",
2626
format!(", {{ /* Generic name */ }}: {}", &param.name.ident().as_str()[5..]),
2727
rustc_errors::Applicability::HasPlaceholders,
2828
rustc_errors::SuggestionStyle::ShowAlways,
@@ -35,7 +35,7 @@ pub(super) fn check_fn<'tcx>(cx: &LateContext<'_>, kind: &'tcx FnKind<'_>, body:
3535
ident.span.ctxt(),
3636
ident.span.parent(),
3737
),
38-
"add a type paremeter",
38+
"add a type parameter",
3939
format!("<{{ /* Generic name */ }}: {}>", &param.name.ident().as_str()[5..]),
4040
rustc_errors::Applicability::HasPlaceholders,
4141
rustc_errors::SuggestionStyle::ShowAlways,

Diff for: clippy_lints/src/functions/misnamed_getters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub fn check_fn(cx: &LateContext<'_>, kind: FnKind<'_>, decl: &FnDecl<'_>, body:
9797

9898
let Some(correct_field) = correct_field else {
9999
// There is no field corresponding to the getter name.
100-
// FIXME: This can be a false positive if the correct field is reachable trought deeper autodereferences than used_field is
100+
// FIXME: This can be a false positive if the correct field is reachable through deeper autodereferences than used_field is
101101
return;
102102
};
103103

Diff for: clippy_lints/src/matches/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ declare_clippy_lint! {
925925
#[clippy::version = "1.66.0"]
926926
pub MANUAL_FILTER,
927927
complexity,
928-
"reimplentation of `filter`"
928+
"reimplementation of `filter`"
929929
}
930930

931931
#[derive(Default)]

Diff for: clippy_utils/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ fn item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Vec<Re
617617
/// Can return multiple resolutions when there are multiple versions of the same crate, e.g.
618618
/// `memchr::memchr` could return the functions from both memchr 1.0 and memchr 2.0.
619619
///
620-
/// Also returns multiple results when there are mulitple paths under the same name e.g. `std::vec`
620+
/// Also returns multiple results when there are multiple paths under the same name e.g. `std::vec`
621621
/// would have both a [`DefKind::Mod`] and [`DefKind::Macro`].
622622
///
623623
/// This function is expensive and should be used sparingly.

Diff for: tests/ui/impl_trait_in_params.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | pub fn a(_: impl Trait) {}
55
| ^^^^^^^^^^
66
|
77
= note: `-D clippy::impl-trait-in-params` implied by `-D warnings`
8-
help: add a type paremeter
8+
help: add a type parameter
99
|
1010
LL | pub fn a<{ /* Generic name */ }: Trait>(_: impl Trait) {}
1111
| +++++++++++++++++++++++++++++++
@@ -16,7 +16,7 @@ error: '`impl Trait` used as a function parameter'
1616
LL | pub fn c<C: Trait>(_: C, _: impl Trait) {}
1717
| ^^^^^^^^^^
1818
|
19-
help: add a type paremeter
19+
help: add a type parameter
2020
|
2121
LL | pub fn c<C: Trait, { /* Generic name */ }: Trait>(_: C, _: impl Trait) {}
2222
| +++++++++++++++++++++++++++++++

Diff for: tests/ui/implicit_clone.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn main() {
8787
let kitten = Kitten {};
8888
let _ = kitten.clone();
8989
let _ = own_same_from_ref(&kitten);
90-
// this shouln't lint
90+
// this shouldn't lint
9191
let _ = kitten.to_vec();
9292

9393
// we expect no lints for this

Diff for: tests/ui/implicit_clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn main() {
8787
let kitten = Kitten {};
8888
let _ = kitten.to_owned();
8989
let _ = own_same_from_ref(&kitten);
90-
// this shouln't lint
90+
// this shouldn't lint
9191
let _ = kitten.to_vec();
9292

9393
// we expect no lints for this

Diff for: tests/ui/new_ret_no_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ mod issue10041 {
406406
struct Bomb;
407407

408408
impl Bomb {
409-
// Hidden <Rhs = Self> default generic paramter.
409+
// Hidden <Rhs = Self> default generic parameter.
410410
pub fn new() -> impl PartialOrd {
411411
0i32
412412
}

0 commit comments

Comments
 (0)