Auto merge of #9159 - alex-semenyuk:fix_typos, r=dswij

Fix typos

changelog: none
This commit is contained in:
bors 2022-07-13 14:48:32 +00:00
commit 0db9280783
20 changed files with 22 additions and 22 deletions

View File

@ -364,7 +364,7 @@ Released 2022-04-07
* [`needless_borrow`]: Prevent mutable borrows being moved and suggest removing the borrow on method calls * [`needless_borrow`]: Prevent mutable borrows being moved and suggest removing the borrow on method calls
[#8217](https://github.com/rust-lang/rust-clippy/pull/8217) [#8217](https://github.com/rust-lang/rust-clippy/pull/8217)
* [`chars_next_cmp`]: Correctly excapes the suggestion * [`chars_next_cmp`]: Correctly escapes the suggestion
[#8376](https://github.com/rust-lang/rust-clippy/pull/8376) [#8376](https://github.com/rust-lang/rust-clippy/pull/8376)
* [`explicit_write`]: Add suggestions for `write!`s with format arguments * [`explicit_write`]: Add suggestions for `write!`s with format arguments
[#8365](https://github.com/rust-lang/rust-clippy/pull/8365) [#8365](https://github.com/rust-lang/rust-clippy/pull/8365)
@ -2525,7 +2525,7 @@ Released 2019-09-26
* [`inherent_to_string_shadow_display`] [#4259](https://github.com/rust-lang/rust-clippy/pull/4259) * [`inherent_to_string_shadow_display`] [#4259](https://github.com/rust-lang/rust-clippy/pull/4259)
* [`type_repetition_in_bounds`] [#3766](https://github.com/rust-lang/rust-clippy/pull/3766) * [`type_repetition_in_bounds`] [#3766](https://github.com/rust-lang/rust-clippy/pull/3766)
* [`try_err`] [#4222](https://github.com/rust-lang/rust-clippy/pull/4222) * [`try_err`] [#4222](https://github.com/rust-lang/rust-clippy/pull/4222)
* Move `{unnnecessary,panicking}_unwrap` out of nursery [#4307](https://github.com/rust-lang/rust-clippy/pull/4307) * Move `{unnecessary,panicking}_unwrap` out of nursery [#4307](https://github.com/rust-lang/rust-clippy/pull/4307)
* Extend the `use_self` lint to suggest uses of `Self::Variant` [#4308](https://github.com/rust-lang/rust-clippy/pull/4308) * Extend the `use_self` lint to suggest uses of `Self::Variant` [#4308](https://github.com/rust-lang/rust-clippy/pull/4308)
* Improve suggestion for needless return [#4262](https://github.com/rust-lang/rust-clippy/pull/4262) * Improve suggestion for needless return [#4262](https://github.com/rust-lang/rust-clippy/pull/4262)
* Add auto-fixable suggestion for `let_unit` [#4337](https://github.com/rust-lang/rust-clippy/pull/4337) * Add auto-fixable suggestion for `let_unit` [#4337](https://github.com/rust-lang/rust-clippy/pull/4337)

View File

@ -56,7 +56,7 @@ For more information on configuring lint levels, see the [rustc documentation].
Clippy has lint groups which are allow-by-default. This means, that you will Clippy has lint groups which are allow-by-default. This means, that you will
have to enable the lints in those groups manually. have to enable the lints in those groups manually.
For a full list of all lints with their description and examples, please refere For a full list of all lints with their description and examples, please refer
to [Clippy's lint list]. The two most important allow-by-default groups are to [Clippy's lint list]. The two most important allow-by-default groups are
described below: described below:

View File

@ -22,7 +22,7 @@
/// ``` /// ```
/// let x = &12; /// let x = &12;
/// let addr_x = &x as *const _ as usize; /// let addr_x = &x as *const _ as usize;
/// let addr_y = &&*x as *const _ as usize; // assert ok now, and lint triggerd. /// let addr_y = &&*x as *const _ as usize; // assert ok now, and lint triggered.
/// // But if we fix it, assert will fail. /// // But if we fix it, assert will fail.
/// assert_ne!(addr_x, addr_y); /// assert_ne!(addr_x, addr_y);
/// ``` /// ```

View File

@ -30,7 +30,7 @@
/// For types that implement `Copy`, the suggestion to `Box` a variant's /// For types that implement `Copy`, the suggestion to `Box` a variant's
/// data would require removing the trait impl. The types can of course /// data would require removing the trait impl. The types can of course
/// still be `Clone`, but that is worse ergonomically. Depending on the /// still be `Clone`, but that is worse ergonomically. Depending on the
/// use case it may be possible to store the large data in an auxillary /// use case it may be possible to store the large data in an auxiliary
/// structure (e.g. Arena or ECS). /// structure (e.g. Arena or ECS).
/// ///
/// The lint will ignore generic types if the layout depends on the /// The lint will ignore generic types if the layout depends on the

View File

@ -139,7 +139,7 @@ fn extract<'tcx>(block: &Block<'tcx>) -> Option<(&'tcx Stmt<'tcx>, &'tcx Expr<'t
if_chain! { if_chain! {
// This should be the loop // This should be the loop
if let Some((node_hir, Node::Stmt(..))) = parent_iter.next(); if let Some((node_hir, Node::Stmt(..))) = parent_iter.next();
// This should be the funciton body // This should be the function body
if let Some((_, Node::Block(block))) = parent_iter.next(); if let Some((_, Node::Block(block))) = parent_iter.next();
if let Some((last_stmt, last_ret)) = extract(block); if let Some((last_stmt, last_ret)) = extract(block);
if last_stmt.hir_id == node_hir; if last_stmt.hir_id == node_hir;

View File

@ -365,7 +365,7 @@ fn has_overlapping_values(&self, other: &Self) -> bool {
(Self::Slice(pats, None), Self::Slice(front, Some(back))) (Self::Slice(pats, None), Self::Slice(front, Some(back)))
| (Self::Slice(front, Some(back)), Self::Slice(pats, None)) => { | (Self::Slice(front, Some(back)), Self::Slice(pats, None)) => {
// Here `pats` is an exact size match. If the combined lengths of `front` and `back` are greater // Here `pats` is an exact size match. If the combined lengths of `front` and `back` are greater
// then the minium length required will be greater than the length of `pats`. // then the minimum length required will be greater than the length of `pats`.
if pats.len() < front.len() + back.len() { if pats.len() < front.len() + back.len() {
return false; return false;
} }

View File

@ -9,7 +9,7 @@
declare_clippy_lint! { declare_clippy_lint! {
/// ### What it does /// ### What it does
/// Checks for type parameters which are positioned inconsistently between /// Checks for type parameters which are positioned inconsistently between
/// a type definition and impl block. Specifically, a paramater in an impl /// a type definition and impl block. Specifically, a parameter in an impl
/// block which has the same name as a parameter in the type def, but is in /// block which has the same name as a parameter in the type def, but is in
/// a different place. /// a different place.
/// ///

View File

@ -1018,7 +1018,7 @@ fn visit_expr(&mut self, expr: &'hir hir::Expr<'hir>) {
/// This visitor finds the highest applicability value in the visited expressions /// This visitor finds the highest applicability value in the visited expressions
struct ApplicabilityResolver<'a, 'hir> { struct ApplicabilityResolver<'a, 'hir> {
cx: &'a LateContext<'hir>, cx: &'a LateContext<'hir>,
/// This is the index of hightest `Applicability` for `paths::APPLICABILITY_VALUES` /// This is the index of highest `Applicability` for `paths::APPLICABILITY_VALUES`
applicability_index: Option<usize>, applicability_index: Option<usize>,
} }

View File

@ -30,7 +30,7 @@ fn descend(&self) -> bool {
} }
} }
/// Allows for controlled descent whe using visitor functions. Use `()` instead when always /// Allows for controlled descent when using visitor functions. Use `()` instead when always
/// descending into child nodes. /// descending into child nodes.
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub enum Descend { pub enum Descend {

View File

@ -27,7 +27,7 @@ fn if_let_option() {
}; };
} }
// When mutexs are different don't warn // When mutexes are different don't warn
fn if_let_different_mutex() { fn if_let_different_mutex() {
let m = Mutex::new(Some(0_u8)); let m = Mutex::new(Some(0_u8));
let other = Mutex::new(None::<u8>); let other = Mutex::new(None::<u8>);

View File

@ -36,7 +36,7 @@ mod without_base {
// issue #7069. // issue #7069.
new_foo!(); new_foo!();
// Shoule NOT lint because the order is the same as in the definition. // Should NOT lint because the order is the same as in the definition.
Foo { x, y, z }; Foo { x, y, z };
// Should NOT lint because z is not a shorthand init. // Should NOT lint because z is not a shorthand init.

View File

@ -36,7 +36,7 @@ fn test() {
// issue #7069. // issue #7069.
new_foo!(); new_foo!();
// Shoule NOT lint because the order is the same as in the definition. // Should NOT lint because the order is the same as in the definition.
Foo { x, y, z }; Foo { x, y, z };
// Should NOT lint because z is not a shorthand init. // Should NOT lint because z is not a shorthand init.

View File

@ -58,7 +58,7 @@ fn issue8878() {
.and_then(|_| { .and_then(|_| {
// we need some newlines // we need some newlines
// so that the span is big enough // so that the span is big enough
// for a splitted output of the diagnostic // for a split output of the diagnostic
Some("") Some("")
// whitespace beforehand is important as well // whitespace beforehand is important as well
}); });

View File

@ -59,7 +59,7 @@ fn issue8878() {
.map(|_| { .map(|_| {
// we need some newlines // we need some newlines
// so that the span is big enough // so that the span is big enough
// for a splitted output of the diagnostic // for a split output of the diagnostic
Some("") Some("")
// whitespace beforehand is important as well // whitespace beforehand is important as well
}) })

View File

@ -78,7 +78,7 @@ LL | .map(|_| {
| __________^ | __________^
LL | | // we need some newlines LL | | // we need some newlines
LL | | // so that the span is big enough LL | | // so that the span is big enough
LL | | // for a splitted output of the diagnostic LL | | // for a split output of the diagnostic
... | ... |
LL | | }) LL | | })
LL | | .flatten(); LL | | .flatten();
@ -89,7 +89,7 @@ help: try replacing `map` with `and_then` and remove the `.flatten()`
LL ~ .and_then(|_| { LL ~ .and_then(|_| {
LL + // we need some newlines LL + // we need some newlines
LL + // so that the span is big enough LL + // so that the span is big enough
LL + // for a splitted output of the diagnostic LL + // for a split output of the diagnostic
LL + Some("") LL + Some("")
LL + // whitespace beforehand is important as well LL + // whitespace beforehand is important as well
LL ~ }); LL ~ });

View File

@ -62,7 +62,7 @@ fn foo() {}
impl T1 for S {} impl T1 for S {}
} }
mod mulitply_conflicit_trait { mod multiply_conflicit_trait {
use crate::{T1, T2}; use crate::{T1, T2};
struct S; struct S;

View File

@ -1,6 +1,6 @@
// run-rustfix // run-rustfix
#![warn(clippy::transmutes_expressible_as_ptr_casts)] #![warn(clippy::transmutes_expressible_as_ptr_casts)]
// These two warnings currrently cover the cases transmutes_expressible_as_ptr_casts // These two warnings currently cover the cases transmutes_expressible_as_ptr_casts
// would otherwise be responsible for // would otherwise be responsible for
#![warn(clippy::useless_transmute)] #![warn(clippy::useless_transmute)]
#![warn(clippy::transmute_ptr_to_ptr)] #![warn(clippy::transmute_ptr_to_ptr)]

View File

@ -1,6 +1,6 @@
// run-rustfix // run-rustfix
#![warn(clippy::transmutes_expressible_as_ptr_casts)] #![warn(clippy::transmutes_expressible_as_ptr_casts)]
// These two warnings currrently cover the cases transmutes_expressible_as_ptr_casts // These two warnings currently cover the cases transmutes_expressible_as_ptr_casts
// would otherwise be responsible for // would otherwise be responsible for
#![warn(clippy::useless_transmute)] #![warn(clippy::useless_transmute)]
#![warn(clippy::transmute_ptr_to_ptr)] #![warn(clippy::transmute_ptr_to_ptr)]

View File

@ -199,7 +199,7 @@ mod super_imports {
} }
} }
mod should_be_replaced_futher_inside { mod should_be_replaced_further_inside {
fn insidefoo() {} fn insidefoo() {}
mod inner { mod inner {
use super::insidefoo; use super::insidefoo;

View File

@ -200,7 +200,7 @@ fn with_super() {
} }
} }
mod should_be_replaced_futher_inside { mod should_be_replaced_further_inside {
fn insidefoo() {} fn insidefoo() {}
mod inner { mod inner {
use super::*; use super::*;