diff --git a/.github/ISSUE_TEMPLATE/ice.yml b/.github/ISSUE_TEMPLATE/ice.yml index 2a5b8b3c891..81bd9c5e032 100644 --- a/.github/ISSUE_TEMPLATE/ice.yml +++ b/.github/ISSUE_TEMPLATE/ice.yml @@ -10,7 +10,7 @@ body: attributes: label: Summary description: | - If possible, try to provide a minimal verifiable example. You can read ["Rust Bug Minimization Patterns"][mve] for how to create smaller examples. Otherwise, provide the crate where the ICE occured. + If possible, try to provide a minimal verifiable example. You can read ["Rust Bug Minimization Patterns"][mve] for how to create smaller examples. Otherwise, provide the crate where the ICE occurred. [mve]: http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/ validations: diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index a20aa12c9ff..e6a0162fd02 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -126,7 +126,7 @@ /// Duplicate code is less maintainable. /// /// ### Known problems - /// * The lint doesn't check if the moved expressions modify values that are beeing used in + /// * The lint doesn't check if the moved expressions modify values that are being used in /// the if condition. The suggestion can in that case modify the behavior of the program. /// See [rust-clippy#7452](https://github.com/rust-lang/rust-clippy/issues/7452) /// diff --git a/clippy_lints/src/fallible_impl_from.rs b/clippy_lints/src/fallible_impl_from.rs index 574678b5542..088d9996516 100644 --- a/clippy_lints/src/fallible_impl_from.rs +++ b/clippy_lints/src/fallible_impl_from.rs @@ -86,9 +86,9 @@ fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { // check for `unwrap` if let Some(arglists) = method_chain_args(expr, &["unwrap"]) { - let reciever_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs(); - if is_type_diagnostic_item(self.lcx, reciever_ty, sym::Option) - || is_type_diagnostic_item(self.lcx, reciever_ty, sym::Result) + let receiver_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs(); + if is_type_diagnostic_item(self.lcx, receiver_ty, sym::Option) + || is_type_diagnostic_item(self.lcx, receiver_ty, sym::Result) { self.result.push(expr.span); } diff --git a/clippy_lints/src/float_equality_without_abs.rs b/clippy_lints/src/float_equality_without_abs.rs index ca8886228de..98aee7592ae 100644 --- a/clippy_lints/src/float_equality_without_abs.rs +++ b/clippy_lints/src/float_equality_without_abs.rs @@ -20,7 +20,7 @@ /// /// ### Known problems /// If the user can ensure that b is larger than a, the `.abs()` is - /// technically unneccessary. However, it will make the code more robust and doesn't have any + /// technically unnecessary. However, it will make the code more robust and doesn't have any /// large performance implications. If the abs call was deliberately left out for performance /// reasons, it is probably better to state this explicitly in the code, which then can be done /// with an allow. @@ -69,7 +69,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { if_chain! { - // left hand side is a substraction + // left hand side is a subtraction if let ExprKind::Binary( Spanned { node: BinOpKind::Sub, @@ -84,7 +84,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { if let Res::Def(DefKind::AssocConst, def_id) = cx.qpath_res(epsilon_path, rhs.hir_id); if match_def_path(cx, def_id, &paths::F32_EPSILON) || match_def_path(cx, def_id, &paths::F64_EPSILON); - // values of the substractions on the left hand side are of the type float + // values of the subtractions on the left hand side are of the type float let t_val_l = cx.typeck_results().expr_ty(val_l); let t_val_r = cx.typeck_results().expr_ty(val_r); if let ty::Float(_) = t_val_l.kind(); diff --git a/clippy_lints/src/only_used_in_recursion.rs b/clippy_lints/src/only_used_in_recursion.rs index b828d9334ee..8e61f234776 100644 --- a/clippy_lints/src/only_used_in_recursion.rs +++ b/clippy_lints/src/only_used_in_recursion.rs @@ -224,7 +224,7 @@ pub fn is_array(ty: Ty<'_>) -> bool { /// This builds the graph of side effect. /// The edge `a -> b` means if `a` has side effect, `b` will have side effect. /// -/// There are some exmaple in following code: +/// There are some example in following code: /// ```rust, ignore /// let b = 1; /// let a = b; // a -> b diff --git a/clippy_lints/src/suspicious_operation_groupings.rs b/clippy_lints/src/suspicious_operation_groupings.rs index 940a8428f77..b5dd27ff80d 100644 --- a/clippy_lints/src/suspicious_operation_groupings.rs +++ b/clippy_lints/src/suspicious_operation_groupings.rs @@ -290,7 +290,7 @@ fn ident_swap_sugg( // used instead, in these cases. *applicability = Applicability::MaybeIncorrect; - // We arbitraily choose one side to suggest changing, + // We arbitrarily choose one side to suggest changing, // since we don't have a better guess. If the user // ends up duplicating a clause, the `logic_bug` lint // should catch it. @@ -374,19 +374,19 @@ fn strip_non_ident_wrappers(expr: &Expr) -> &Expr { } fn extract_related_binops(kind: &ExprKind) -> Option>> { - append_opt_vecs(chained_binops(kind), if_statment_binops(kind)) + append_opt_vecs(chained_binops(kind), if_statement_binops(kind)) } -fn if_statment_binops(kind: &ExprKind) -> Option>> { +fn if_statement_binops(kind: &ExprKind) -> Option>> { match kind { ExprKind::If(ref condition, _, _) => chained_binops(&condition.kind), - ExprKind::Paren(ref e) => if_statment_binops(&e.kind), + ExprKind::Paren(ref e) => if_statement_binops(&e.kind), ExprKind::Block(ref block, _) => { let mut output = None; for stmt in &block.stmts { match stmt.kind { StmtKind::Expr(ref e) | StmtKind::Semi(ref e) => { - output = append_opt_vecs(output, if_statment_binops(&e.kind)); + output = append_opt_vecs(output, if_statement_binops(&e.kind)); }, _ => {}, } diff --git a/clippy_lints/src/trailing_empty_array.rs b/clippy_lints/src/trailing_empty_array.rs index c9b2ce476e8..58cc057a39e 100644 --- a/clippy_lints/src/trailing_empty_array.rs +++ b/clippy_lints/src/trailing_empty_array.rs @@ -10,7 +10,7 @@ /// Displays a warning when a struct with a trailing zero-sized array is declared without a `repr` attribute. /// /// ### Why is this bad? - /// Zero-sized arrays aren't very useful in Rust itself, so such a struct is likely being created to pass to C code or in some other situation where control over memory layout matters (for example, in conjuction with manual allocation to make it easy to compute the offset of the array). Either way, `#[repr(C)]` (or another `repr` attribute) is needed. + /// Zero-sized arrays aren't very useful in Rust itself, so such a struct is likely being created to pass to C code or in some other situation where control over memory layout matters (for example, in conjunction with manual allocation to make it easy to compute the offset of the array). Either way, `#[repr(C)]` (or another `repr` attribute) is needed. /// /// ### Example /// ```rust diff --git a/clippy_lints/src/trait_bounds.rs b/clippy_lints/src/trait_bounds.rs index be9d538c362..43e0132a7ec 100644 --- a/clippy_lints/src/trait_bounds.rs +++ b/clippy_lints/src/trait_bounds.rs @@ -46,7 +46,7 @@ /// /// ### Why is this bad? /// Duplicate bounds makes the code - /// less readable than specifing them only once. + /// less readable than specifying them only once. /// /// ### Example /// ```rust diff --git a/clippy_lints/src/unwrap_in_result.rs b/clippy_lints/src/unwrap_in_result.rs index 2c13f1049b5..b32be238cd5 100644 --- a/clippy_lints/src/unwrap_in_result.rs +++ b/clippy_lints/src/unwrap_in_result.rs @@ -83,9 +83,9 @@ impl<'a, 'tcx> Visitor<'tcx> for FindExpectUnwrap<'a, 'tcx> { fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { // check for `expect` if let Some(arglists) = method_chain_args(expr, &["expect"]) { - let reciever_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs(); - if is_type_diagnostic_item(self.lcx, reciever_ty, sym::Option) - || is_type_diagnostic_item(self.lcx, reciever_ty, sym::Result) + let receiver_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs(); + if is_type_diagnostic_item(self.lcx, receiver_ty, sym::Option) + || is_type_diagnostic_item(self.lcx, receiver_ty, sym::Result) { self.result.push(expr.span); } @@ -93,9 +93,9 @@ fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { // check for `unwrap` if let Some(arglists) = method_chain_args(expr, &["unwrap"]) { - let reciever_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs(); - if is_type_diagnostic_item(self.lcx, reciever_ty, sym::Option) - || is_type_diagnostic_item(self.lcx, reciever_ty, sym::Result) + let receiver_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs(); + if is_type_diagnostic_item(self.lcx, receiver_ty, sym::Option) + || is_type_diagnostic_item(self.lcx, receiver_ty, sym::Result) { self.result.push(expr.span); } diff --git a/clippy_lints/src/upper_case_acronyms.rs b/clippy_lints/src/upper_case_acronyms.rs index 7286d0a7bf9..02bf09ed506 100644 --- a/clippy_lints/src/upper_case_acronyms.rs +++ b/clippy_lints/src/upper_case_acronyms.rs @@ -114,7 +114,7 @@ fn check_item(&mut self, cx: &LateContext<'_>, it: &Item<'_>) { check_ident(cx, &it.ident, self.upper_case_acronyms_aggressive); }, ItemKind::Enum(ref enumdef, _) => { - // check enum variants seperately because again we only want to lint on private enums and + // check enum variants separately because again we only want to lint on private enums and // the fn check_variant does not know about the vis of the enum of its variants enumdef .variants diff --git a/rust-toolchain b/rust-toolchain index 9d5da4ed68f..5befb856a02 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2022-03-14" +channel = "nightly-2022-03-24" components = ["cargo", "llvm-tools-preview", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"] diff --git a/tests/lint_message_convention.rs b/tests/lint_message_convention.rs index b4d94dc983f..dc82ba891fb 100644 --- a/tests/lint_message_convention.rs +++ b/tests/lint_message_convention.rs @@ -16,7 +16,7 @@ impl Message { fn new(path: PathBuf) -> Self { let content: String = std::fs::read_to_string(&path).unwrap(); // we don't want the first letter after "error: ", "help: " ... to be capitalized - // also no puncutation (except for "?" ?) at the end of a line + // also no punctuation (except for "?" ?) at the end of a line let regex_set: RegexSet = RegexSet::new(&[ r"error: [A-Z]", r"help: [A-Z]", diff --git a/tests/ui/manual_memcpy/with_loop_counters.rs b/tests/ui/manual_memcpy/with_loop_counters.rs index ba388a05a28..c826b082adf 100644 --- a/tests/ui/manual_memcpy/with_loop_counters.rs +++ b/tests/ui/manual_memcpy/with_loop_counters.rs @@ -59,7 +59,7 @@ pub fn manual_copy_with_counters(src: &[i32], dst: &mut [i32], dst2: &mut [i32]) } // make sure parentheses are added properly to bitwise operators, which have lower precedence than - // arithmetric ones + // arithmetic ones let mut count = 0 << 1; for i in 0..1 << 1 { dst[count] = src[i + 2]; diff --git a/tests/workspace.rs b/tests/workspace.rs index 677b4a4d569..e13efb3e016 100644 --- a/tests/workspace.rs +++ b/tests/workspace.rs @@ -93,7 +93,7 @@ fn test_no_deps_ignores_path_deps_in_workspaces() { output }; - // Trigger a sucessful build, so Cargo would like to cache the build result. + // Trigger a successful build, so Cargo would like to cache the build result. successful_build(); // Make sure there's no spurious rebuild when nothing changes.