From 67a8e2cf85be9f1911775825c4b79623d458d323 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 13:51:08 +0300 Subject: [PATCH 01/24] fix few comment typos in compiler --- compiler/rustc_ast/src/ast.rs | 2 +- compiler/rustc_codegen_llvm/src/va_arg.rs | 2 +- compiler/rustc_codegen_ssa/src/back/link.rs | 4 ++-- compiler/rustc_codegen_ssa/src/back/metadata.rs | 2 +- compiler/rustc_codegen_ssa/src/traits/builder.rs | 2 +- .../rustc_const_eval/src/util/check_validity_requirement.rs | 2 +- compiler/rustc_data_structures/src/vec_cache.rs | 2 +- compiler/rustc_errors/src/markdown/parse.rs | 2 +- compiler/rustc_lint/src/if_let_rescope.rs | 2 +- compiler/rustc_lint_defs/src/builtin.rs | 6 +++--- compiler/rustc_middle/src/mir/syntax.rs | 2 +- compiler/rustc_middle/src/ty/sty.rs | 2 +- compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 4 ++-- compiler/rustc_monomorphize/src/collector.rs | 2 +- compiler/rustc_monomorphize/src/partitioning.rs | 2 +- compiler/rustc_next_trait_solver/src/solve/effect_goals.rs | 2 +- compiler/rustc_pattern_analysis/src/usefulness.rs | 2 +- .../src/error_reporting/traits/suggestions.rs | 2 +- compiler/rustc_trait_selection/src/errors.rs | 2 +- compiler/rustc_trait_selection/src/traits/mod.rs | 2 +- compiler/rustc_type_ir/src/infer_ctxt.rs | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 1b831c454e6d5..b15ba84e4c7d0 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -1245,7 +1245,7 @@ impl Expr { } } - /// Returns an expression with (when possible) *one* outter brace removed + /// Returns an expression with (when possible) *one* outer brace removed pub fn maybe_unwrap_block(&self) -> &Expr { if let ExprKind::Block(block, None) = &self.kind && let [stmt] = block.stmts.as_slice() diff --git a/compiler/rustc_codegen_llvm/src/va_arg.rs b/compiler/rustc_codegen_llvm/src/va_arg.rs index 8baa69cefe1e2..745df0c0be6ce 100644 --- a/compiler/rustc_codegen_llvm/src/va_arg.rs +++ b/compiler/rustc_codegen_llvm/src/va_arg.rs @@ -365,7 +365,7 @@ fn emit_xtensa_va_arg<'ll, 'tcx>( // On big-endian, for values smaller than the slot size we'd have to align the read to the end // of the slot rather than the start. While the ISA and GCC support big-endian, all the Xtensa - // targets supported by rustc are litte-endian so don't worry about it. + // targets supported by rustc are little-endian so don't worry about it. // if from_regsave { // unsafe { *regsave_value_ptr } diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 74597f6263d4f..ac82e20d9349f 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -3061,7 +3061,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo // Supported architecture names can be found in the source: // https://github.com/apple-oss-distributions/ld64/blob/ld64-951.9/src/abstraction/MachOFileAbstraction.hpp#L578-L648 // - // Intentially verbose to ensure that the list always matches correctly + // Intentionally verbose to ensure that the list always matches correctly // with the list in the source above. let ld64_arch = match llvm_arch { "armv7k" => "armv7k", @@ -3129,7 +3129,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo // We do not currently know the actual SDK version though, so we have a few options: // 1. Use the minimum version supported by rustc. // 2. Use the same as the deployment target. - // 3. Use an arbitary recent version. + // 3. Use an arbitrary recent version. // 4. Omit the version. // // The first option is too low / too conservative, and means that users will not get the diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 68b453ff42425..913aa17657d44 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -370,7 +370,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 { /// Mach-O files contain information about: /// - The platform/OS they were built for (macOS/watchOS/Mac Catalyst/iOS simulator etc). /// - The minimum OS version / deployment target. -/// - The version of the SDK they were targetting. +/// - The version of the SDK they were targeting. /// /// In the past, this was accomplished using the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, /// LC_VERSION_MIN_TVOS or LC_VERSION_MIN_WATCHOS load commands, which each contain information diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs index 5f91133d5b47e..7ba42784a44d3 100644 --- a/compiler/rustc_codegen_ssa/src/traits/builder.rs +++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs @@ -89,7 +89,7 @@ pub trait BuilderMethods<'a, 'tcx>: // // This function is opt-in for back ends. // - // The default implementation calls `self.expect()` before emiting the branch + // The default implementation calls `self.expect()` before emitting the branch // by calling `self.cond_br()` fn cond_br_with_expect( &mut self, diff --git a/compiler/rustc_const_eval/src/util/check_validity_requirement.rs b/compiler/rustc_const_eval/src/util/check_validity_requirement.rs index d7e97f32bae92..4ca39bbc68ec2 100644 --- a/compiler/rustc_const_eval/src/util/check_validity_requirement.rs +++ b/compiler/rustc_const_eval/src/util/check_validity_requirement.rs @@ -69,7 +69,7 @@ fn check_validity_requirement_strict<'tcx>( // require dereferenceability also require non-null, we don't actually get any false negatives // due to this. // The value we are validating is temporary and discarded at the end of this function, so - // there is no point in reseting provenance and padding. + // there is no point in resetting provenance and padding. cx.validate_operand( &allocated.into(), /*recursive*/ false, diff --git a/compiler/rustc_data_structures/src/vec_cache.rs b/compiler/rustc_data_structures/src/vec_cache.rs index 2ff60ab7f36f9..0ef6b87c28c6e 100644 --- a/compiler/rustc_data_structures/src/vec_cache.rs +++ b/compiler/rustc_data_structures/src/vec_cache.rs @@ -257,7 +257,7 @@ unsafe impl Drop for VecCache { // we are also guaranteed to just need to deallocate any large arrays (not iterate over // contents). // - // Confirm no need to deallocate invidual entries. Note that `V: Copy` is asserted on + // Confirm no need to deallocate individual entries. Note that `V: Copy` is asserted on // insert/lookup but not necessarily construction, primarily to avoid annoyingly propagating // the bounds into struct definitions everywhere. assert!(!std::mem::needs_drop::()); diff --git a/compiler/rustc_errors/src/markdown/parse.rs b/compiler/rustc_errors/src/markdown/parse.rs index f02387d833595..e1b1b32cd3ef9 100644 --- a/compiler/rustc_errors/src/markdown/parse.rs +++ b/compiler/rustc_errors/src/markdown/parse.rs @@ -352,7 +352,7 @@ fn normalize<'a>(MdStream(stream): MdStream<'a>, linkdefs: &mut Vec>) let new_defs = stream.iter().filter(|tt| matches!(tt, MdTree::LinkDef { .. })); linkdefs.extend(new_defs.cloned()); - // Run plaintest expansions on types that need it, call this function on nested types + // Run plaintext expansions on types that need it, call this function on nested types for item in stream { match item { MdTree::PlainText(txt) => expand_plaintext(txt, &mut new_stream, MdTree::PlainText), diff --git a/compiler/rustc_lint/src/if_let_rescope.rs b/compiler/rustc_lint/src/if_let_rescope.rs index 39ea8d8e3246c..91bcb5d7bbd7e 100644 --- a/compiler/rustc_lint/src/if_let_rescope.rs +++ b/compiler/rustc_lint/src/if_let_rescope.rs @@ -232,7 +232,7 @@ impl IfLetRescope { } } } - // At this point, any `if let` fragment in the cascade is definitely preceeded by `else`, + // At this point, any `if let` fragment in the cascade is definitely preceded by `else`, // so a opening bracket is mandatory before each `match`. add_bracket_to_match_head = true; if let Some(alt) = alt { diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 592c934997c01..6f33f8fa35778 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4399,7 +4399,7 @@ declare_lint! { declare_lint! { /// The `refining_impl_trait_reachable` lint detects `impl Trait` return - /// types in method signatures that are refined by a publically reachable + /// types in method signatures that are refined by a publicly reachable /// trait implementation, meaning the implementation adds information about /// the return type that is not present in the trait. /// @@ -4440,7 +4440,7 @@ declare_lint! { /// /// `refining_impl_trait` is a lint group composed of two lints: /// - /// * `refining_impl_trait_reachable`, for refinements that are publically + /// * `refining_impl_trait_reachable`, for refinements that are publicly /// reachable outside a crate, and /// * `refining_impl_trait_internal`, for refinements that are only visible /// within a crate. @@ -4496,7 +4496,7 @@ declare_lint! { /// /// `refining_impl_trait` is a lint group composed of two lints: /// - /// * `refining_impl_trait_reachable`, for refinements that are publically + /// * `refining_impl_trait_reachable`, for refinements that are publicly /// reachable outside a crate, and /// * `refining_impl_trait_internal`, for refinements that are only visible /// within a crate. diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 4f86703e95376..6870856da214d 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -374,7 +374,7 @@ pub enum StatementKind<'tcx> { /// computing these locals. /// /// If the local is already allocated, calling `StorageLive` again will implicitly free the - /// local and then allocate fresh uninitilized memory. If a local is already deallocated, + /// local and then allocate fresh uninitialized memory. If a local is already deallocated, /// calling `StorageDead` again is a NOP. StorageLive(Local), diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 74a94d8278453..43922716cb7d7 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1777,7 +1777,7 @@ impl<'tcx> Ty<'tcx> { /// This is particularly useful for getting the type of the result of /// [`UnOp::PtrMetadata`](crate::mir::UnOp::PtrMetadata). /// - /// Panics if `self` is not dereferencable. + /// Panics if `self` is not dereferenceable. #[track_caller] pub fn pointee_metadata_ty_or_projection(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> { let Some(pointee_ty) = self.builtin_deref(true) else { diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index 667d59d858e3a..009950deec944 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -379,11 +379,11 @@ fn extend_type_not_partial_eq<'tcx>( struct UsedParamsNeedInstantiationVisitor<'tcx> { tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, - /// The user has written `impl PartialEq for Ty` which means it's non-structual. + /// The user has written `impl PartialEq for Ty` which means it's non-structural. adts_with_manual_partialeq: FxHashSet, /// The type has no `PartialEq` implementation, neither manual or derived. adts_without_partialeq: FxHashSet, - /// The user has written `impl PartialEq for Ty` which means it's non-structual, + /// The user has written `impl PartialEq for Ty` which means it's non-structural, /// but we don't have a span to point at, so we'll just add them as a `note`. manual: FxHashSet>, /// The type has no `PartialEq` implementation, neither manual or derived, but diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 67fca1d7c2947..6ab84cab32344 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -528,7 +528,7 @@ fn collect_items_rec<'tcx>( }); } // Only updating `usage_map` for used items as otherwise we may be inserting the same item - // multiple times (if it is first 'mentioned' and then later actuall used), and the usage map + // multiple times (if it is first 'mentioned' and then later actually used), and the usage map // logic does not like that. // This is part of the output of collection and hence only relevant for "used" items. // ("Mentioned" items are only considered internally during collection.) diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index b1b6f10e0fe2c..86352d25598f7 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -890,7 +890,7 @@ fn mono_item_visibility<'tcx>( // * First is weak lang items. These are basically mechanisms for // libcore to forward-reference symbols defined later in crates like // the standard library or `#[panic_handler]` definitions. The - // definition of these weak lang items needs to be referencable by + // definition of these weak lang items needs to be referenceable by // libcore, so we're no longer a candidate for internalization. // Removal of these functions can't be done by LLVM but rather must be // done by the linker as it's a non-local decision. diff --git a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs index 0b61c368d8e8d..8b589bd4210fd 100644 --- a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs @@ -74,7 +74,7 @@ where /// Register additional assumptions for aliases corresponding to `~const` item bounds. /// /// Unlike item bounds, they are not simply implied by the well-formedness of the alias. - /// Instead, they only hold if the const conditons on the alias also hold. This is why + /// Instead, they only hold if the const conditions on the alias also hold. This is why /// we also register the const conditions of the alias after matching the goal against /// the assumption. fn consider_additional_alias_assumptions( diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index 11ebbea07fa4e..231e841d9832b 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -102,7 +102,7 @@ //! [`Constructor::is_covered_by`]. //! //! Note 1: variable bindings (like the `x` in `Some(x)`) match anything, so we treat them as wildcards. -//! Note 2: this only applies to matcheable values. For example a value of type `Rc` can't be +//! Note 2: this only applies to matchable values. For example a value of type `Rc` can't be //! deconstructed that way. //! //! diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index 393d175ea4cd0..24ba740530c44 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -4392,7 +4392,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { candidate_impls: &[ImplCandidate<'tcx>], span: Span, ) { - // We can only suggest the slice coersion for function and binary operation arguments, + // We can only suggest the slice coercion for function and binary operation arguments, // since the suggestion would make no sense in turbofish or call let (ObligationCauseCode::BinOp { .. } | ObligationCauseCode::FunctionArg { .. }) = obligation.cause.code() diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 7159397c4b1a4..55e9705a841bb 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -635,7 +635,7 @@ impl Subdiagnostic for AddLifetimeParamsSuggestion<'_> { // Do not suggest constraining the `&self` param, but rather the return type. // If that is wrong (because it is not sufficient), a follow up error will tell the // user to fix it. This way we lower the chances of *over* constraining, but still - // get the cake of "correctly" contrained in two steps. + // get the cake of "correctly" constrained in two steps. visitor.visit_ty_unambig(self.ty_sup); } visitor.visit_ty_unambig(self.ty_sub); diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index de337710b5ef7..e70b0a103af9d 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -483,7 +483,7 @@ pub enum EvaluateConstErr { /// some unevaluated constant with either generic parameters or inference variables in its /// generic arguments. HasGenericsOrInfers, - /// The type this constant evalauted to is not valid for use in const generics. This should + /// The type this constant evaluated to is not valid for use in const generics. This should /// always result in an error when checking the constant is correctly typed for the parameter /// it is an argument to, so a bug is delayed when encountering this. InvalidConstParamTy(ErrorGuaranteed), diff --git a/compiler/rustc_type_ir/src/infer_ctxt.rs b/compiler/rustc_type_ir/src/infer_ctxt.rs index 26c4951069626..f5c149269489b 100644 --- a/compiler/rustc_type_ir/src/infer_ctxt.rs +++ b/compiler/rustc_type_ir/src/infer_ctxt.rs @@ -12,7 +12,7 @@ use crate::{self as ty, Interner}; /// slightly different typing rules depending on the current context. See the /// doc comment for each variant for how and why they are used. /// -/// In most cases you can get the correct typing mode automically via: +/// In most cases you can get the correct typing mode automatically via: /// - `mir::Body::typing_mode` /// - `rustc_lint::LateContext::typing_mode` /// From f567bc78c099b64f66661959757401378fd412b1 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 14:12:56 +0300 Subject: [PATCH 02/24] fix typos in compiler code --- compiler/rustc_codegen_ssa/messages.ftl | 2 +- compiler/rustc_errors/src/tests.rs | 2 +- compiler/rustc_hir_analysis/messages.ftl | 2 +- compiler/rustc_hir_analysis/src/errors.rs | 2 +- compiler/rustc_resolve/src/errors.rs | 10 +++++----- compiler/rustc_resolve/src/late.rs | 8 ++++---- compiler/rustc_session/src/session.rs | 2 +- compiler/rustc_span/src/lib.rs | 2 +- compiler/rustc_trait_selection/src/traits/effects.rs | 4 ++-- src/librustdoc/doctest.rs | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/compiler/rustc_codegen_ssa/messages.ftl b/compiler/rustc_codegen_ssa/messages.ftl index 95912b0160072..749f1fb910f42 100644 --- a/compiler/rustc_codegen_ssa/messages.ftl +++ b/compiler/rustc_codegen_ssa/messages.ftl @@ -313,7 +313,7 @@ codegen_ssa_thorin_missing_referenced_unit = unit {$unit} referenced by executab codegen_ssa_thorin_missing_required_section = input object missing required section `{$section}` -codegen_ssa_thorin_mixed_input_encodings = input objects haved mixed encodings +codegen_ssa_thorin_mixed_input_encodings = input objects have mixed encodings codegen_ssa_thorin_multiple_debug_info_section = multiple `.debug_info.dwo` sections diff --git a/compiler/rustc_errors/src/tests.rs b/compiler/rustc_errors/src/tests.rs index 376fd24d57bab..eccc4d7fb03b9 100644 --- a/compiler/rustc_errors/src/tests.rs +++ b/compiler/rustc_errors/src/tests.rs @@ -97,7 +97,7 @@ fn wellformed_fluent() { } #[test] -fn misformed_fluent() { +fn malformed_fluent() { let dummy = make_dummy("mir_build_borrow_of_moved_value = borrow of moved value .label = value moved into `{name}` here .occurs_because_label = move occurs because `{$oops}` has type `{$ty}` which does not implement the `Copy` trait diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 194f2cd04e468..ea6ec4460ace8 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -522,7 +522,7 @@ hir_analysis_trait_object_declared_with_no_traits = at least one trait is required for an object type .alias_span = this alias does not contain a trait -hir_analysis_traits_with_defualt_impl = traits with a default impl, like `{$traits}`, cannot be implemented for {$problematic_kind} `{$self_ty}` +hir_analysis_traits_with_default_impl = traits with a default impl, like `{$traits}`, cannot be implemented for {$problematic_kind} `{$self_ty}` .note = a trait object implements `{$traits}` if and only if `{$traits}` is one of the trait object's trait bounds hir_analysis_transparent_enum_variant = transparent enum needs exactly one variant, but has {$number} diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index f2560f22874bc..82d0444b47c15 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -1327,7 +1327,7 @@ pub(crate) struct ImplForTyRequires { } #[derive(Diagnostic)] -#[diag(hir_analysis_traits_with_defualt_impl, code = E0321)] +#[diag(hir_analysis_traits_with_default_impl, code = E0321)] #[note] pub(crate) struct TraitsWithDefaultImpl<'a> { #[primary_span] diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs index 2ae6892bc93e6..2c724d3d6787d 100644 --- a/compiler/rustc_resolve/src/errors.rs +++ b/compiler/rustc_resolve/src/errors.rs @@ -894,12 +894,12 @@ pub(crate) struct MacroExpandedExternCrateCannotShadowExternArguments { #[derive(Diagnostic)] #[diag(resolve_elided_anonymous_lifetime_report_error, code = E0637)] -pub(crate) struct ElidedAnonymousLivetimeReportError { +pub(crate) struct ElidedAnonymousLifetimeReportError { #[primary_span] #[label] pub(crate) span: Span, #[subdiagnostic] - pub(crate) suggestion: Option, + pub(crate) suggestion: Option, } #[derive(Diagnostic)] @@ -913,7 +913,7 @@ pub(crate) struct LendingIteratorReportError { #[derive(Diagnostic)] #[diag(resolve_anonymous_lifetime_non_gat_report_error)] -pub(crate) struct AnonymousLivetimeNonGatReportError { +pub(crate) struct AnonymousLifetimeNonGatReportError { #[primary_span] #[label] pub(crate) lifetime: Span, @@ -924,7 +924,7 @@ pub(crate) struct AnonymousLivetimeNonGatReportError { resolve_elided_anonymous_lifetime_report_error_suggestion, applicability = "machine-applicable" )] -pub(crate) struct ElidedAnonymousLivetimeReportErrorSuggestion { +pub(crate) struct ElidedAnonymousLifetimeReportErrorSuggestion { #[suggestion_part(code = "for<'a> ")] pub(crate) lo: Span, #[suggestion_part(code = "'a ")] @@ -933,7 +933,7 @@ pub(crate) struct ElidedAnonymousLivetimeReportErrorSuggestion { #[derive(Diagnostic)] #[diag(resolve_explicit_anonymous_lifetime_report_error, code = E0637)] -pub(crate) struct ExplicitAnonymousLivetimeReportError { +pub(crate) struct ExplicitAnonymousLifetimeReportError { #[primary_span] #[label] pub(crate) span: Span, diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 6056a69ee71f6..186690cb0001f 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -1879,7 +1879,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { .. } = rib.kind { - Some(errors::ElidedAnonymousLivetimeReportErrorSuggestion { + Some(errors::ElidedAnonymousLifetimeReportErrorSuggestion { lo: span.shrink_to_lo(), hi: lifetime.ident.span.shrink_to_hi(), }) @@ -1905,18 +1905,18 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { ty: ty.span, }); } else { - self.r.dcx().emit_err(errors::AnonymousLivetimeNonGatReportError { + self.r.dcx().emit_err(errors::AnonymousLifetimeNonGatReportError { lifetime: lifetime.ident.span, }); } } else { - self.r.dcx().emit_err(errors::ElidedAnonymousLivetimeReportError { + self.r.dcx().emit_err(errors::ElidedAnonymousLifetimeReportError { span: lifetime.ident.span, suggestion, }); } } else { - self.r.dcx().emit_err(errors::ExplicitAnonymousLivetimeReportError { + self.r.dcx().emit_err(errors::ExplicitAnonymousLifetimeReportError { span: lifetime.ident.span, }); }; diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 1c9adea281dc7..26575cf6c5efd 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1474,7 +1474,7 @@ impl RemapFileNameExt for rustc_span::FileName { "one and only one scope should be passed to for_scope" ); if sess.opts.unstable_opts.remap_path_scope.contains(scope) { - self.prefer_remapped_unconditionaly() + self.prefer_remapped_unconditionally() } else { self.prefer_local() } diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index f19d4d9f3624e..400ff6b8f726c 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -426,7 +426,7 @@ impl FileName { } } - pub fn prefer_remapped_unconditionaly(&self) -> FileNameDisplay<'_> { + pub fn prefer_remapped_unconditionally(&self) -> FileNameDisplay<'_> { FileNameDisplay { inner: self, display_pref: FileNameDisplayPreference::Remapped } } diff --git a/compiler/rustc_trait_selection/src/traits/effects.rs b/compiler/rustc_trait_selection/src/traits/effects.rs index 3c127416cbf7c..f2aa3b54e448b 100644 --- a/compiler/rustc_trait_selection/src/traits/effects.rs +++ b/compiler/rustc_trait_selection/src/traits/effects.rs @@ -56,7 +56,7 @@ pub fn evaluate_host_effect_obligation<'tcx>( Err(EvaluationFailure::NoSolution) => {} } - match evaluate_host_effect_from_selection_candiate(selcx, obligation) { + match evaluate_host_effect_from_selection_candidate(selcx, obligation) { Ok(result) => return Ok(result), Err(EvaluationFailure::Ambiguous) => return Err(EvaluationFailure::Ambiguous), Err(EvaluationFailure::NoSolution) => {} @@ -334,7 +334,7 @@ fn evaluate_host_effect_for_destruct_goal<'tcx>( .collect()) } -fn evaluate_host_effect_from_selection_candiate<'tcx>( +fn evaluate_host_effect_from_selection_candidate<'tcx>( selcx: &mut SelectionContext<'_, 'tcx>, obligation: &HostEffectObligation<'tcx>, ) -> Result>, EvaluationFailure> { diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index a2808bddb3acc..0217db5c0c340 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -889,7 +889,7 @@ impl ScrapedDocTest { item_path.push(' '); } let name = - format!("{} - {item_path}(line {line})", filename.prefer_remapped_unconditionaly()); + format!("{} - {item_path}(line {line})", filename.prefer_remapped_unconditionally()); Self { filename, line, langstr, text, name } } From 6da50f34ecb66c5f1e54c09b680b2c368c2c26f2 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 14:50:49 +0300 Subject: [PATCH 03/24] setup typos check in ci --- typos.toml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 typos.toml diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000000000..cfe210ec21e61 --- /dev/null +++ b/typos.toml @@ -0,0 +1,41 @@ +[files] +extend-exclude = [ + # ./compiler excludes + "compiler/rustc_codegen_gcc", + "compiler/rustc_codegen_cranelift", + "compiler/rustc_baked_icu_data", +] + +[default.extend-words] +thir = "thir" +padd = "padd" +rplace = "rplace" +arange = "arange" +rela = "rela" +unstalled = "unstalled" +taits = "taits" +Datas = "Datas" +splitted = "splitted" +leafs = "leafs" +Lits = "Lits" +makro = "makro" +optin = "optin" +parm = "parm" +EXCED = "EXCED" +Shortern = "Shortern" +unparseable = "unparseable" +replacable = "replacable" +matcheable = "matcheable" + +[default] +extend-ignore-words-re = [ + # words with length <= 3 chars is likely noise + "^[a-zA-Z]{1,3}$", +] + +extend-ignore-re = [ + # ignore this intensional typo examples from lints + "/// 1 \\| #\\[cfg\\(widnows\\)\\]", + "/// warning: unexpected `cfg` condition name: `widnows`", + "/// #\\[cfg\\(widnows\\)\\]", +] \ No newline at end of file From 85cec137f2350bd82d10044b400de68dcbe9d266 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 15:37:46 +0300 Subject: [PATCH 04/24] fix for miri --- src/tools/miri/src/shims/backtrace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/src/shims/backtrace.rs b/src/tools/miri/src/shims/backtrace.rs index 7e667e70a1721..bf57a68576ab1 100644 --- a/src/tools/miri/src/shims/backtrace.rs +++ b/src/tools/miri/src/shims/backtrace.rs @@ -105,7 +105,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.tcx.sess.source_map().lookup_char_pos(BytePos(offset.bytes().try_into().unwrap())); let name = fn_instance.to_string(); - let filename = lo.file.name.prefer_remapped_unconditionaly().to_string(); + let filename = lo.file.name.prefer_remapped_unconditionally().to_string(); interp_ok((fn_instance, lo, name, filename)) } From ecc0f86d64cc2805016141502209b52a34e5c49c Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 16:20:01 +0300 Subject: [PATCH 05/24] review --- compiler/rustc_feature/src/accepted.rs | 2 +- compiler/rustc_mir_transform/src/gvn.rs | 2 +- compiler/rustc_mir_transform/src/ref_prop.rs | 20 +++++++++--------- .../rustc_pattern_analysis/src/usefulness.rs | 2 +- typos.toml | 21 +++++++++++++++---- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 980f394603549..40f48734d68f4 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -372,7 +372,7 @@ declare_features! ( (accepted, self_in_typedefs, "1.32.0", Some(49303)), /// Allows `Self` struct constructor (RFC 2302). (accepted, self_struct_ctor, "1.32.0", Some(51994)), - /// Shortern the tail expression lifetime + /// Shorten the tail expression lifetime (accepted, shorter_tail_lifetimes, "1.84.0", Some(123739)), /// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`. (accepted, slice_patterns, "1.42.0", Some(62254)), diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 0a54c780f31e5..a77b06fabb255 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -27,7 +27,7 @@ //! _b = some other value // also has VnIndex i //! ``` //! -//! We consider it to be replacable by: +//! We consider it to be replaceable by: //! ```ignore (MIR) //! _a = some value // has VnIndex i //! // some MIR diff --git a/compiler/rustc_mir_transform/src/ref_prop.rs b/compiler/rustc_mir_transform/src/ref_prop.rs index 368d5340ac34f..d1c2d6b508f2f 100644 --- a/compiler/rustc_mir_transform/src/ref_prop.rs +++ b/compiler/rustc_mir_transform/src/ref_prop.rs @@ -138,7 +138,7 @@ fn compute_replacement<'tcx>( // reborrowed references. let mut storage_to_remove = DenseBitSet::new_empty(body.local_decls.len()); - let fully_replacable_locals = fully_replacable_locals(ssa); + let fully_replaceable_locals = fully_replaceable_locals(ssa); // Returns true iff we can use `place` as a pointee. // @@ -204,7 +204,7 @@ fn compute_replacement<'tcx>( let needs_unique = ty.is_mutable_ptr(); // If this a mutable reference that we cannot fully replace, mark it as unknown. - if needs_unique && !fully_replacable_locals.contains(local) { + if needs_unique && !fully_replaceable_locals.contains(local) { debug!("not fully replaceable"); continue; } @@ -303,7 +303,7 @@ fn compute_replacement<'tcx>( // This a reborrow chain, recursively allow the replacement. // - // This also allows to detect cases where `target.local` is not replacable, + // This also allows to detect cases where `target.local` is not replaceable, // and mark it as such. if let &[PlaceElem::Deref] = &target.projection[..] { assert!(perform_opt); @@ -313,7 +313,7 @@ fn compute_replacement<'tcx>( } else if perform_opt { self.allowed_replacements.insert((target.local, loc)); } else if needs_unique { - // This mutable reference is not fully replacable, so drop it. + // This mutable reference is not fully replaceable, so drop it. self.targets[place.local] = Value::Unknown; } } @@ -326,22 +326,22 @@ fn compute_replacement<'tcx>( /// Compute the set of locals that can be fully replaced. /// -/// We consider a local to be replacable iff it's only used in a `Deref` projection `*_local` or +/// We consider a local to be replaceable iff it's only used in a `Deref` projection `*_local` or /// non-use position (like storage statements and debuginfo). -fn fully_replacable_locals(ssa: &SsaLocals) -> DenseBitSet { - let mut replacable = DenseBitSet::new_empty(ssa.num_locals()); +fn fully_replaceable_locals(ssa: &SsaLocals) -> DenseBitSet { + let mut replaceable = DenseBitSet::new_empty(ssa.num_locals()); // First pass: for each local, whether its uses can be fully replaced. for local in ssa.locals() { if ssa.num_direct_uses(local) == 0 { - replacable.insert(local); + replaceable.insert(local); } } // Second pass: a local can only be fully replaced if all its copies can. - ssa.meet_copy_equivalence(&mut replacable); + ssa.meet_copy_equivalence(&mut replaceable); - replacable + replaceable } /// Utility to help performing substitution of `*pattern` by `target`. diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index 231e841d9832b..11ebbea07fa4e 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -102,7 +102,7 @@ //! [`Constructor::is_covered_by`]. //! //! Note 1: variable bindings (like the `x` in `Some(x)`) match anything, so we treat them as wildcards. -//! Note 2: this only applies to matchable values. For example a value of type `Rc` can't be +//! Note 2: this only applies to matcheable values. For example a value of type `Rc` can't be //! deconstructed that way. //! //! diff --git a/typos.toml b/typos.toml index cfe210ec21e61..a87e527884ee4 100644 --- a/typos.toml +++ b/typos.toml @@ -1,12 +1,15 @@ [files] extend-exclude = [ - # ./compiler excludes + # exclude git (sub)modules and generated content "compiler/rustc_codegen_gcc", "compiler/rustc_codegen_cranelift", "compiler/rustc_baked_icu_data", ] [default.extend-words] +# Add exclusions here, lines should be like `x = "x"`, where `x` is excluded word. +# +# Also see docs: https://github.com/crate-ci/typos/blob/v1.28.2/docs/reference.md thir = "thir" padd = "padd" rplace = "rplace" @@ -21,11 +24,21 @@ Lits = "Lits" makro = "makro" optin = "optin" parm = "parm" -EXCED = "EXCED" -Shortern = "Shortern" unparseable = "unparseable" -replacable = "replacable" matcheable = "matcheable" +smove = "smove" +childs = "childs" +filetimes = "filetimes" + +[default.extend-identifiers] +ERROR_FILENAME_EXCED_RANGE = "ERROR_FILENAME_EXCED_RANGE" +DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME = "DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME" +ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = "ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS" +ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC" +ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED" +ERRNO_ACCES = "ERRNO_ACCES" +tolen = "tolen" +pard = "pard" [default] extend-ignore-words-re = [ From 194b2bbad2d6629fa5565117731b943571fe3836 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 16:22:39 +0300 Subject: [PATCH 06/24] bless reuse --- REUSE.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/REUSE.toml b/REUSE.toml index 816c6d730c824..027b4ccbe259f 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -36,6 +36,7 @@ path = [ "rustfmt.toml", "rust-bors.toml", "triagebot.toml", + "typos.toml", "x", "x.ps1", "x.py", From 1df0913298d381605d29c1b48deabda6e995cf7a Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 21:07:26 +0300 Subject: [PATCH 07/24] check ./library too --- library/alloc/src/fmt.rs | 2 +- library/core/src/future/async_drop.rs | 4 ++-- library/core/src/intrinsics/mod.rs | 2 +- library/core/src/intrinsics/simd.rs | 4 ++-- library/core/src/lib.rs | 2 +- library/core/src/pin.rs | 2 +- library/core/src/primitive_docs.rs | 4 ++-- library/core/src/ptr/const_ptr.rs | 2 +- library/panic_unwind/src/seh.rs | 2 +- library/std/src/sys/net/connection/socket/wasip2.rs | 2 +- library/std/src/sys/pal/uefi/helpers.rs | 4 ++-- library/std/src/sys/pal/unix/time.rs | 4 ++-- library/std/src/sys/random/linux.rs | 4 ++-- library/std/src/sys/random/unsupported.rs | 2 +- library/std/src/sys/thread_local/guard/key.rs | 4 ++-- library/std/src/sys_common/mod.rs | 12 ++++++------ library/std/src/thread/spawnhook.rs | 2 +- typos.toml | 12 ++++++++++-- 18 files changed, 39 insertions(+), 31 deletions(-) diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index e40de13f3d4a9..30f42050ac8ac 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -109,7 +109,7 @@ //! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These //! parameters affect the string representation of what's being formatted. //! -//! The colon `:` in format syntax divides indentifier of the input data and +//! The colon `:` in format syntax divides identifier of the input data and //! the formatting options, the colon itself does not change anything, only //! introduces the options. //! diff --git a/library/core/src/future/async_drop.rs b/library/core/src/future/async_drop.rs index f1778a4d782af..baf1b9544711c 100644 --- a/library/core/src/future/async_drop.rs +++ b/library/core/src/future/async_drop.rs @@ -41,7 +41,7 @@ impl Future for AsyncDropOwning { let dtor = Pin::new_unchecked( this.dtor.get_or_insert_with(|| async_drop_in_place(this.value.as_mut_ptr())), ); - // AsyncDestuctors are idempotent so Self gets idempotency as well + // AsyncDestructors are idempotent so Self gets idempotency as well dtor.poll(cx) } } @@ -247,7 +247,7 @@ async unsafe fn either, M: IntoFuture, T this: *mut T, discr: ::Discriminant, ) { - // SAFETY: Guaranteed by the safety section of this funtion's documentation + // SAFETY: Guaranteed by the safety section of this function's documentation if unsafe { discriminant_value(&*this) } == discr { drop(other); matched.await diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index cf03c07b6a564..78bb327c4f819 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -3190,7 +3190,7 @@ where /// used inside the `if const`. /// Note that the two arms of this `if` really each become their own function, which is why the /// macro supports setting attributes for those functions. The runtime function is always -/// markes as `#[inline]`. +/// marked as `#[inline]`. /// /// See [`const_eval_select()`] for the rules and requirements around that intrinsic. pub(crate) macro const_eval_select { diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs index ae6e1a779ed58..d95e3f900b30e 100644 --- a/library/core/src/intrinsics/simd.rs +++ b/library/core/src/intrinsics/simd.rs @@ -93,7 +93,7 @@ pub unsafe fn simd_shl(lhs: T, rhs: T) -> T; #[rustc_nounwind] pub unsafe fn simd_shr(lhs: T, rhs: T) -> T; -/// "Ands" vectors elementwise. +/// "And"s vectors elementwise. /// /// `T` must be a vector of integers. #[rustc_intrinsic] @@ -455,7 +455,7 @@ pub unsafe fn simd_reduce_max(x: T) -> U; #[rustc_nounwind] pub unsafe fn simd_reduce_min(x: T) -> U; -/// Logical "ands" all elements together. +/// Logical "and"s all elements together. /// /// `T` must be a vector of integers or floats. /// diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index e1ca69edcbbd9..997f7ce2a2c41 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -89,7 +89,7 @@ #![allow(internal_features)] #![deny(ffi_unwind_calls)] #![warn(unreachable_pub)] -// Do not check link redundancy on bootstraping phase +// Do not check link redundancy on bootstrapping phase #![allow(rustdoc::redundant_explicit_links)] #![warn(rustdoc::unescaped_backticks)] // diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index 7fcd19f67ee2d..cdd54f9e9ef98 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -792,7 +792,7 @@ //! //! 1. *Structural [`Unpin`].* A struct can be [`Unpin`] only if all of its //! structurally-pinned fields are, too. This is [`Unpin`]'s behavior by default. -//! However, as a libray author, it is your responsibility not to write something like +//! However, as a library author, it is your responsibility not to write something like //! impl\ [Unpin] for Struct\ {} and then offer a method that provides //! structural pinning to an inner field of `T`, which may not be [`Unpin`]! (Adding *any* //! projection operation requires unsafe code, so the fact that [`Unpin`] is a safe trait does diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 89c856fe10746..0c6d83168a006 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -1626,8 +1626,8 @@ mod prim_ref {} /// let ptr: fn(usize) -> usize = add_one; /// assert_eq!(ptr(5), 6); /// -/// let clos: fn(usize) -> usize = |x| x + 5; -/// assert_eq!(clos(5), 10); +/// let closure: fn(usize) -> usize = |x| x + 5; +/// assert_eq!(closure(5), 10); /// ``` /// /// In addition to varying based on their signature, function pointers come in two flavors: safe diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 7d0839aff3f73..c8ec0cb4de3f8 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -46,7 +46,7 @@ impl *const T { if const #[rustc_allow_const_fn_unstable(const_raw_ptr_comparison)] { match (ptr).guaranteed_eq(null_mut()) { Some(res) => res, - // To remain maximally convervative, we stop execution when we don't + // To remain maximally conservative, we stop execution when we don't // know whether the pointer is null or not. // We can *not* return `false` here, that would be unsound in `NonNull::new`! None => panic!("null-ness of this pointer cannot be determined in const context"), diff --git a/library/panic_unwind/src/seh.rs b/library/panic_unwind/src/seh.rs index 3794b56c0898f..9acec7f0604d6 100644 --- a/library/panic_unwind/src/seh.rs +++ b/library/panic_unwind/src/seh.rs @@ -264,7 +264,7 @@ static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor { // runtime under a try/catch block and the panic that we generate here will be // used as the result of the exception copy. This is used by the C++ runtime to // support capturing exceptions with std::exception_ptr, which we can't support -// because Box isn't clonable. +// because Box isn't cloneable. macro_rules! define_cleanup { ($abi:tt $abi2:tt) => { unsafe extern $abi fn exception_cleanup(e: *mut Exception) { diff --git a/library/std/src/sys/net/connection/socket/wasip2.rs b/library/std/src/sys/net/connection/socket/wasip2.rs index 73c2583187207..c77c50fece1a9 100644 --- a/library/std/src/sys/net/connection/socket/wasip2.rs +++ b/library/std/src/sys/net/connection/socket/wasip2.rs @@ -140,7 +140,7 @@ impl Socket { 0 => {} _ => { // WASI poll does not return POLLHUP or POLLERR in revents. Check if the - // connnection actually succeeded and return ok only when the socket is + // connection actually succeeded and return ok only when the socket is // ready and no errors were found. if let Some(e) = self.take_error()? { return Err(e); diff --git a/library/std/src/sys/pal/uefi/helpers.rs b/library/std/src/sys/pal/uefi/helpers.rs index 60c33c637d762..b2d4c34b97174 100644 --- a/library/std/src/sys/pal/uefi/helpers.rs +++ b/library/std/src/sys/pal/uefi/helpers.rs @@ -523,7 +523,7 @@ impl OwnedProtocol { let protocol: *mut T = Box::into_raw(Box::new(protocol)); let mut handle: r_efi::efi::Handle = crate::ptr::null_mut(); - // FIXME: Move into r-efi once extended_varargs_abi_support is stablized + // FIXME: Move into r-efi once extended_varargs_abi_support is stabilized let func: BootInstallMultipleProtocolInterfaces = unsafe { crate::mem::transmute((*bt.as_ptr()).install_multiple_protocol_interfaces) }; @@ -557,7 +557,7 @@ impl Drop for OwnedProtocol { // Do not deallocate a runtime protocol if let Some(bt) = boot_services() { let bt: NonNull = bt.cast(); - // FIXME: Move into r-efi once extended_varargs_abi_support is stablized + // FIXME: Move into r-efi once extended_varargs_abi_support is stabilized let func: BootUninstallMultipleProtocolInterfaces = unsafe { crate::mem::transmute((*bt.as_ptr()).uninstall_multiple_protocol_interfaces) }; diff --git a/library/std/src/sys/pal/unix/time.rs b/library/std/src/sys/pal/unix/time.rs index c0a3044660b7e..eb73a574f8680 100644 --- a/library/std/src/sys/pal/unix/time.rs +++ b/library/std/src/sys/pal/unix/time.rs @@ -271,8 +271,8 @@ impl Instant { // https://www.manpagez.com/man/3/clock_gettime/ // // CLOCK_UPTIME_RAW clock that increments monotonically, in the same man- - // ner as CLOCK_MONOTONIC_RAW, but that does not incre- - // ment while the system is asleep. The returned value + // ner as CLOCK_MONOTONIC_RAW, but that does not increment + // while the system is asleep. The returned value // is identical to the result of mach_absolute_time() // after the appropriate mach_timebase conversion is // applied. diff --git a/library/std/src/sys/random/linux.rs b/library/std/src/sys/random/linux.rs index e3cb79285cd15..851a611bda670 100644 --- a/library/std/src/sys/random/linux.rs +++ b/library/std/src/sys/random/linux.rs @@ -15,7 +15,7 @@ //! bytes, while the non-blocking pool, once initialized using the blocking //! pool, uses a CPRNG to return an unlimited number of random bytes. With a //! strong enough CPRNG however, the entropy estimation didn't contribute that -//! much towards security while being an excellent vector for DoS attacs. Thus, +//! much towards security while being an excellent vector for DoS attacks. Thus, //! the blocking pool was removed in kernel version 5.6.[^2] That patch did not //! magically increase the quality of the non-blocking pool, however, so we can //! safely consider it strong enough even in older kernel versions and use it @@ -30,7 +30,7 @@ //! data the system has available at the time. //! //! So in conclusion, we always want the output of the non-blocking pool, but -//! may need to wait until it is initalized. The default behavior of `getrandom` +//! may need to wait until it is initialized. The default behavior of `getrandom` //! is to wait until the non-blocking pool is initialized and then draw from there, //! so if `getrandom` is available, we use its default to generate the bytes. For //! `HashMap`, however, we need to specify the `GRND_INSECURE` flags, but that diff --git a/library/std/src/sys/random/unsupported.rs b/library/std/src/sys/random/unsupported.rs index d68ce4a9e8703..894409b395abb 100644 --- a/library/std/src/sys/random/unsupported.rs +++ b/library/std/src/sys/random/unsupported.rs @@ -6,7 +6,7 @@ pub fn fill_bytes(_: &mut [u8]) { pub fn hashmap_random_keys() -> (u64, u64) { // Use allocation addresses for a bit of randomness. This isn't - // particularily secure, but there isn't really an alternative. + // particularly secure, but there isn't really an alternative. let stack = 0u8; let heap = Box::new(0u8); let k1 = ptr::from_ref(&stack).addr() as u64; diff --git a/library/std/src/sys/thread_local/guard/key.rs b/library/std/src/sys/thread_local/guard/key.rs index 59581e6f281e6..f91471419c1cc 100644 --- a/library/std/src/sys/thread_local/guard/key.rs +++ b/library/std/src/sys/thread_local/guard/key.rs @@ -32,7 +32,7 @@ pub fn enable() { /// On platforms with key-based TLS, the system runs the destructors for us. /// We still have to make sure that [`crate::rt::thread_cleanup`] is called, -/// however. This is done by defering the execution of a TLS destructor to +/// however. This is done by deferring the execution of a TLS destructor to /// the next round of destruction inside the TLS destructors. #[cfg(not(target_thread_local))] pub fn enable() { @@ -46,7 +46,7 @@ pub fn enable() { unsafe extern "C" fn run(state: *mut u8) { if state == DEFER { // Make sure that this function is run again in the next round of - // TLS destruction. If there is no futher round, there will be leaks, + // TLS destruction. If there is no further round, there will be leaks, // but that's okay, `thread_cleanup` is not guaranteed to be called. unsafe { set(CLEANUP.force(), RUN) } } else { diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs index 2a5de7f66661c..80f471b04d259 100644 --- a/library/std/src/sys_common/mod.rs +++ b/library/std/src/sys_common/mod.rs @@ -52,17 +52,17 @@ pub trait FromInner { fn from_inner(inner: Inner) -> Self; } -// Computes (value*numer)/denom without overflow, as long as both -// (numer*denom) and the overall result fit into i64 (which is the case +// Computes (value*numerator)/denom without overflow, as long as both +// (numerator*denom) and the overall result fit into i64 (which is the case // for our time conversions). #[allow(dead_code)] // not used on all platforms -pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 { +pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 { let q = value / denom; let r = value % denom; // Decompose value as (value/denom*denom + value%denom), - // substitute into (value*numer)/denom and simplify. - // r < denom, so (denom*numer) is the upper bound of (r*numer) - q * numer + r * numer / denom + // substitute into (value*numerator)/denom and simplify. + // r < denom, so (denom*numerator) is the upper bound of (r*numerator) + q * numerator + r * numerator / denom } pub fn ignore_notfound(result: crate::io::Result) -> crate::io::Result<()> { diff --git a/library/std/src/thread/spawnhook.rs b/library/std/src/thread/spawnhook.rs index 99b5ad9cb9fe5..ba3658a7b6346 100644 --- a/library/std/src/thread/spawnhook.rs +++ b/library/std/src/thread/spawnhook.rs @@ -6,7 +6,7 @@ use crate::thread::Thread; crate::thread_local! { /// A thread local linked list of spawn hooks. /// - /// It is a linked list of Arcs, such that it can very cheaply be inhereted by spawned threads. + /// It is a linked list of Arcs, such that it can very cheaply be inherited by spawned threads. /// /// (That technically makes it a set of linked lists with shared tails, so a linked tree.) static SPAWN_HOOKS: Cell = const { Cell::new(SpawnHooks { first: None }) }; diff --git a/typos.toml b/typos.toml index a87e527884ee4..591c88ccb4851 100644 --- a/typos.toml +++ b/typos.toml @@ -4,6 +4,11 @@ extend-exclude = [ "compiler/rustc_codegen_gcc", "compiler/rustc_codegen_cranelift", "compiler/rustc_baked_icu_data", + "library/backtrace", + "library/stdarch", + # generated lorem ipsum texts + "library/alloc/benches/str.rs", + "library/alloc/tests/str.rs", ] [default.extend-words] @@ -47,8 +52,11 @@ extend-ignore-words-re = [ ] extend-ignore-re = [ - # ignore this intensional typo examples from lints + # ignore this intensional typo examples "/// 1 \\| #\\[cfg\\(widnows\\)\\]", "/// warning: unexpected `cfg` condition name: `widnows`", "/// #\\[cfg\\(widnows\\)\\]", -] \ No newline at end of file + "\\.arg\\(\"Oh no, a tpyo!\"\\)", + # string used in benches + "\"core::iter::adapters::Copie\"", +] From eaa78567facd95cf197393f6e729e942d2b7c273 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 21:40:02 +0300 Subject: [PATCH 08/24] review --- typos.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typos.toml b/typos.toml index 591c88ccb4851..8f783c8efdd49 100644 --- a/typos.toml +++ b/typos.toml @@ -52,7 +52,7 @@ extend-ignore-words-re = [ ] extend-ignore-re = [ - # ignore this intensional typo examples + # ignore these intentional typo examples "/// 1 \\| #\\[cfg\\(widnows\\)\\]", "/// warning: unexpected `cfg` condition name: `widnows`", "/// #\\[cfg\\(widnows\\)\\]", From e191bc78d9e932fdf988d43151114924df5bfebb Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 7 Dec 2024 21:43:41 +0300 Subject: [PATCH 09/24] [dont merge] add typo --- compiler/rustc_ast/src/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index b15ba84e4c7d0..3ad96db484fb1 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -1245,7 +1245,7 @@ impl Expr { } } - /// Returns an expression with (when possible) *one* outer brace removed + /// Returns an expression with (when possible) *one* outter outter brace removed pub fn maybe_unwrap_block(&self) -> &Expr { if let ExprKind::Block(block, None) = &self.kind && let [stmt] = block.stmts.as_slice() From 6b39f0d21960122a150055b91413e80e7adcac63 Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 8 Dec 2024 15:12:37 +0300 Subject: [PATCH 10/24] allow run spellchecker via test tidy --extra-checks=spellcheck --- src/tools/tidy/src/ext_tool_checks.rs | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 4f9a20fa9e294..8fe24dbbedd54 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -72,6 +72,8 @@ fn check_impl( let shell_lint = lint_args.contains(&"shell:lint") || shell_all; let cpp_all = lint_args.contains(&"cpp"); let cpp_fmt = lint_args.contains(&"cpp:fmt") || cpp_all; + let spellcheck_all = lint_args.contains(&"spellcheck"); + let spellcheck_fix = lint_args.contains(&"spellcheck:fix"); let mut py_path = None; @@ -224,6 +226,22 @@ fn check_impl( shellcheck_runner(&merge_args(&cfg_args, &file_args_shc))?; } + if spellcheck_all || spellcheck_fix { + let config_path = root_path.join("typos.toml"); + let mut args = + // sync target files with .github/workflows/ci.yml + vec!["-c", config_path.as_os_str().to_str().unwrap(), "./compiler", "./library"]; + + if spellcheck_all { + eprintln!("spellcheck files"); + spellcheck_runner(&args)?; + } else if spellcheck_fix { + eprintln!("spellcheck files and fix"); + args.push("--write-changes"); + spellcheck_runner(&args)?; + } + } + Ok(()) } @@ -491,6 +509,25 @@ fn shellcheck_runner(args: &[&OsStr]) -> Result<(), Error> { if status.success() { Ok(()) } else { Err(Error::FailedCheck("shellcheck")) } } +/// Check that spellchecker is installed then run it at the given path +fn spellcheck_runner(args: &[&str]) -> Result<(), Error> { + match Command::new("typos").arg("--version").status() { + Ok(_) => (), + Err(e) if e.kind() == io::ErrorKind::NotFound => { + return Err(Error::MissingReq( + "typos", + "spellcheck file checks", + // sync version with .github/workflows/ci.yml + Some("install tool via `cargo install typos-cli@1.28.2`".to_owned()), + )); + } + Err(e) => return Err(e.into()), + } + + let status = Command::new("typos").args(args).status()?; + if status.success() { Ok(()) } else { Err(Error::FailedCheck("typos")) } +} + /// Check git for tracked files matching an extension fn find_with_extension( root_path: &Path, From ba0ffecd491c4fec064f4ef7411121ef577dd944 Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 8 Dec 2024 15:16:02 +0300 Subject: [PATCH 11/24] update allowed extra checks for tidy --- src/bootstrap/src/core/config/flags.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs index 0f8efcfcc7656..2d68d58373488 100644 --- a/src/bootstrap/src/core/config/flags.rs +++ b/src/bootstrap/src/core/config/flags.rs @@ -374,7 +374,7 @@ pub enum Subcommand { bless: bool, #[arg(long)] /// comma-separated list of other files types to check (accepts py, py:lint, - /// py:fmt, shell) + /// py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck, spellcheck:fix) extra_checks: Option, #[arg(long)] /// rerun tests even if the inputs are unchanged From d51b9f472a9c5b8939aa64cf295060db8fe845fc Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 8 Dec 2024 15:49:31 +0300 Subject: [PATCH 12/24] regenerate completions --- src/etc/completions/x.py.fish | 2 +- src/etc/completions/x.py.ps1 | 2 +- src/etc/completions/x.py.zsh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish index 99cd4f0043b62..e0ae59f4737ea 100644 --- a/src/etc/completions/x.py.fish +++ b/src/etc/completions/x.py.fish @@ -286,7 +286,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand doc" -l skip-stage0-validation complete -c x.py -n "__fish_x.py_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x.py -n "__fish_x.py_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r -complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck, spellcheck:fix)' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l run -d 'whether to execute run-* tests' -r diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1 index 065689411d606..05958aaef9555 100644 --- a/src/etc/completions/x.py.ps1 +++ b/src/etc/completions/x.py.ps1 @@ -332,7 +332,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { 'x.py;test' { [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') [CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') - [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)') + [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck, spellcheck:fix)') [CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') [CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh index 417935630ab3b..13637ed0015bd 100644 --- a/src/etc/completions/x.py.zsh +++ b/src/etc/completions/x.py.zsh @@ -331,7 +331,7 @@ _arguments "${_arguments_options[@]}" : \ _arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \ '*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS:_default' \ -'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell)]:EXTRA_CHECKS:_default' \ +'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, shell\:lint, cpp, cpp\:fmt, spellcheck, spellcheck\:fix)]:EXTRA_CHECKS:_default' \ '--compare-mode=[mode describing what file the actual ui output will be compared to]:COMPARE MODE:_default' \ '--pass=[force {check,build,run}-pass tests to this mode]:check | build | run:_default' \ '--run=[whether to execute run-* tests]:auto | always | never:_default' \ From b3e74db15a237fa27d74835c7f2a00e6e1eb3e77 Mon Sep 17 00:00:00 2001 From: klensy Date: Mon, 9 Dec 2024 00:36:24 +0300 Subject: [PATCH 13/24] make this just fail, without additional actions --- .github/workflows/spellcheck.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/spellcheck.yml diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 0000000000000..2551d15b0a2f2 --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,23 @@ +# This workflow runs spellcheck job + +name: Spellcheck +on: + pull_request: + branches: + - "**" + +jobs: + spellcheck: + name: run spellchecker + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v4 + + - name: check typos + # sync version with src/tools/tidy/src/ext_tool_checks.rs + uses: crate-ci/typos@v1.28.2 + with: + # sync target files with src/tools/tidy/src/ext_tool_checks.rs + files: ./compiler ./library + config: ./typos.toml From 305d9c5eeec27e28bc94b296f14a6e719a7ebfad Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 11 Dec 2024 17:54:21 +0300 Subject: [PATCH 14/24] review --- compiler/rustc_codegen_ssa/src/back/metadata.rs | 2 +- compiler/rustc_errors/src/tests.rs | 2 +- compiler/rustc_lint_defs/src/builtin.rs | 2 +- library/std/src/sys_common/mod.rs | 12 ++++++------ src/tools/tidy/src/ext_tool_checks.rs | 5 ++--- typos.toml | 11 +++++++++++ 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 913aa17657d44..68b453ff42425 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -370,7 +370,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 { /// Mach-O files contain information about: /// - The platform/OS they were built for (macOS/watchOS/Mac Catalyst/iOS simulator etc). /// - The minimum OS version / deployment target. -/// - The version of the SDK they were targeting. +/// - The version of the SDK they were targetting. /// /// In the past, this was accomplished using the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, /// LC_VERSION_MIN_TVOS or LC_VERSION_MIN_WATCHOS load commands, which each contain information diff --git a/compiler/rustc_errors/src/tests.rs b/compiler/rustc_errors/src/tests.rs index eccc4d7fb03b9..376fd24d57bab 100644 --- a/compiler/rustc_errors/src/tests.rs +++ b/compiler/rustc_errors/src/tests.rs @@ -97,7 +97,7 @@ fn wellformed_fluent() { } #[test] -fn malformed_fluent() { +fn misformed_fluent() { let dummy = make_dummy("mir_build_borrow_of_moved_value = borrow of moved value .label = value moved into `{name}` here .occurs_because_label = move occurs because `{$oops}` has type `{$ty}` which does not implement the `Copy` trait diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 6f33f8fa35778..8fd580b98e542 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4399,7 +4399,7 @@ declare_lint! { declare_lint! { /// The `refining_impl_trait_reachable` lint detects `impl Trait` return - /// types in method signatures that are refined by a publicly reachable + /// types in method signatures that are refined by a publically reachable /// trait implementation, meaning the implementation adds information about /// the return type that is not present in the trait. /// diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs index 80f471b04d259..2a5de7f66661c 100644 --- a/library/std/src/sys_common/mod.rs +++ b/library/std/src/sys_common/mod.rs @@ -52,17 +52,17 @@ pub trait FromInner { fn from_inner(inner: Inner) -> Self; } -// Computes (value*numerator)/denom without overflow, as long as both -// (numerator*denom) and the overall result fit into i64 (which is the case +// Computes (value*numer)/denom without overflow, as long as both +// (numer*denom) and the overall result fit into i64 (which is the case // for our time conversions). #[allow(dead_code)] // not used on all platforms -pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 { +pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 { let q = value / denom; let r = value % denom; // Decompose value as (value/denom*denom + value%denom), - // substitute into (value*numerator)/denom and simplify. - // r < denom, so (denom*numerator) is the upper bound of (r*numerator) - q * numerator + r * numerator / denom + // substitute into (value*numer)/denom and simplify. + // r < denom, so (denom*numer) is the upper bound of (r*numer) + q * numer + r * numer / denom } pub fn ignore_notfound(result: crate::io::Result) -> crate::io::Result<()> { diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 8fe24dbbedd54..b5c8baca8b568 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -228,18 +228,17 @@ fn check_impl( if spellcheck_all || spellcheck_fix { let config_path = root_path.join("typos.toml"); - let mut args = // sync target files with .github/workflows/ci.yml + let mut args = vec!["-c", config_path.as_os_str().to_str().unwrap(), "./compiler", "./library"]; if spellcheck_all { eprintln!("spellcheck files"); - spellcheck_runner(&args)?; } else if spellcheck_fix { eprintln!("spellcheck files and fix"); args.push("--write-changes"); - spellcheck_runner(&args)?; } + spellcheck_runner(&args)?; } Ok(()) diff --git a/typos.toml b/typos.toml index 8f783c8efdd49..cf49a542ce5e5 100644 --- a/typos.toml +++ b/typos.toml @@ -34,8 +34,18 @@ matcheable = "matcheable" smove = "smove" childs = "childs" filetimes = "filetimes" +misformed = "misformed" +targetting = "targetting" +publically = "publically" [default.extend-identifiers] +# Entries goes here if typo is part of some existing ident +# where you want to keep it, but don't want to allow +# such typos everywhere. +# +# I.e. you don't want (or can't) fix some constant name, like +# `DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME` but actually +# want to see `INVAILD` typo fixed in other places. ERROR_FILENAME_EXCED_RANGE = "ERROR_FILENAME_EXCED_RANGE" DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME = "DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME" ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = "ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS" @@ -44,6 +54,7 @@ ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED" ERRNO_ACCES = "ERRNO_ACCES" tolen = "tolen" pard = "pard" +numer = "numer" [default] extend-ignore-words-re = [ From 9538ad0cc98fb51da1268960842d3af208d3aed6 Mon Sep 17 00:00:00 2001 From: klensy Date: Mon, 30 Dec 2024 12:06:44 +0300 Subject: [PATCH 15/24] review --- compiler/rustc_lint_defs/src/builtin.rs | 6 +++--- library/core/src/primitive_docs.rs | 4 ++-- library/std/src/sys/pal/unix/time.rs | 4 ++-- typos.toml | 16 ++++++---------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 8fd580b98e542..c1c591060f504 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -1226,7 +1226,7 @@ declare_lint! { /// /// ### Explanation /// - /// A public `use` declaration should not be used to publicly re-export a + /// A public `use` declaration should not be used to publically re-export a /// private `extern crate`. `pub extern crate` should be used instead. /// /// This was historically allowed, but is not the intended behavior @@ -4440,7 +4440,7 @@ declare_lint! { /// /// `refining_impl_trait` is a lint group composed of two lints: /// - /// * `refining_impl_trait_reachable`, for refinements that are publicly + /// * `refining_impl_trait_reachable`, for refinements that are publically /// reachable outside a crate, and /// * `refining_impl_trait_internal`, for refinements that are only visible /// within a crate. @@ -4496,7 +4496,7 @@ declare_lint! { /// /// `refining_impl_trait` is a lint group composed of two lints: /// - /// * `refining_impl_trait_reachable`, for refinements that are publicly + /// * `refining_impl_trait_reachable`, for refinements that are publically /// reachable outside a crate, and /// * `refining_impl_trait_internal`, for refinements that are only visible /// within a crate. diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 0c6d83168a006..89c856fe10746 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -1626,8 +1626,8 @@ mod prim_ref {} /// let ptr: fn(usize) -> usize = add_one; /// assert_eq!(ptr(5), 6); /// -/// let closure: fn(usize) -> usize = |x| x + 5; -/// assert_eq!(closure(5), 10); +/// let clos: fn(usize) -> usize = |x| x + 5; +/// assert_eq!(clos(5), 10); /// ``` /// /// In addition to varying based on their signature, function pointers come in two flavors: safe diff --git a/library/std/src/sys/pal/unix/time.rs b/library/std/src/sys/pal/unix/time.rs index eb73a574f8680..c0a3044660b7e 100644 --- a/library/std/src/sys/pal/unix/time.rs +++ b/library/std/src/sys/pal/unix/time.rs @@ -271,8 +271,8 @@ impl Instant { // https://www.manpagez.com/man/3/clock_gettime/ // // CLOCK_UPTIME_RAW clock that increments monotonically, in the same man- - // ner as CLOCK_MONOTONIC_RAW, but that does not increment - // while the system is asleep. The returned value + // ner as CLOCK_MONOTONIC_RAW, but that does not incre- + // ment while the system is asleep. The returned value // is identical to the result of mach_absolute_time() // after the appropriate mach_timebase conversion is // applied. diff --git a/typos.toml b/typos.toml index cf49a542ce5e5..4b7ef4e4e4034 100644 --- a/typos.toml +++ b/typos.toml @@ -15,22 +15,16 @@ extend-exclude = [ # Add exclusions here, lines should be like `x = "x"`, where `x` is excluded word. # # Also see docs: https://github.com/crate-ci/typos/blob/v1.28.2/docs/reference.md -thir = "thir" -padd = "padd" rplace = "rplace" arange = "arange" -rela = "rela" unstalled = "unstalled" taits = "taits" Datas = "Datas" splitted = "splitted" leafs = "leafs" -Lits = "Lits" makro = "makro" optin = "optin" -parm = "parm" unparseable = "unparseable" -matcheable = "matcheable" smove = "smove" childs = "childs" filetimes = "filetimes" @@ -38,8 +32,11 @@ misformed = "misformed" targetting = "targetting" publically = "publically" +# this can be valid word, depends on dictionary edition +#matcheable = "matcheable" + [default.extend-identifiers] -# Entries goes here if typo is part of some existing ident +# An entry goes here if the typo is part of some existing ident # where you want to keep it, but don't want to allow # such typos everywhere. # @@ -53,13 +50,12 @@ ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC" ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED" ERRNO_ACCES = "ERRNO_ACCES" tolen = "tolen" -pard = "pard" numer = "numer" [default] extend-ignore-words-re = [ - # words with length <= 3 chars is likely noise - "^[a-zA-Z]{1,3}$", + # words with length <= 4 chars is likely noise + "^[a-zA-Z]{1,4}$", ] extend-ignore-re = [ From 3e95a79be608d506c9cddbd62ee93bc089cf9f7d Mon Sep 17 00:00:00 2001 From: klensy Date: Mon, 30 Dec 2024 12:15:30 +0300 Subject: [PATCH 16/24] new fixes --- compiler/rustc_codegen_ssa/src/back/link.rs | 2 +- compiler/rustc_interface/src/passes.rs | 2 +- compiler/rustc_lint/src/default_could_be_derived.rs | 2 +- compiler/rustc_middle/src/query/mod.rs | 2 +- compiler/rustc_passes/messages.ftl | 2 +- compiler/rustc_passes/src/errors.rs | 2 +- compiler/rustc_pattern_analysis/src/usefulness.rs | 4 ++-- compiler/rustc_session/src/config.rs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index ac82e20d9349f..c9ac207118559 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2777,7 +2777,7 @@ fn add_upstream_rust_crates( if sess.target.is_like_aix { // Unlike ELF linkers, AIX doesn't feature `DT_SONAME` to override - // the dependency name when outputing a shared library. Thus, `ld` will + // the dependency name when outputting a shared library. Thus, `ld` will // use the full path to shared libraries as the dependency if passed it // by default unless `noipath` is passed. // https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command. diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index e47385d089944..b6755c60a04fa 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -850,7 +850,7 @@ pub fn create_and_enter_global_ctxt FnOnce(TyCtxt<'tcx>) -> T>( feed.output_filenames(Arc::new(outputs)); let res = f(tcx); - // FIXME maybe run finish even when a fatal error occured? or at least tcx.alloc_self_profile_query_strings()? + // FIXME maybe run finish even when a fatal error occurred? or at least tcx.alloc_self_profile_query_strings()? tcx.finish(); res }, diff --git a/compiler/rustc_lint/src/default_could_be_derived.rs b/compiler/rustc_lint/src/default_could_be_derived.rs index 78d129642dc78..e5e2e3a218023 100644 --- a/compiler/rustc_lint/src/default_could_be_derived.rs +++ b/compiler/rustc_lint/src/default_could_be_derived.rs @@ -133,7 +133,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultCouldBeDerived { // } // } // where `something()` would have to be a call or path. - // We have nothing meaninful to do with this. + // We have nothing meaningful to do with this. return; } diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 94a5a3769a322..04e34542181a9 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -264,7 +264,7 @@ rustc_queries! { /// Returns whether the type alias given by `DefId` is lazy. /// /// I.e., if the type alias expands / ought to expand to a [weak] [alias type] - /// instead of the underyling aliased type. + /// instead of the underlying aliased type. /// /// Relevant for features `lazy_type_alias` and `type_alias_impl_trait`. /// diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl index ed498d9d34429..afedb91c89a60 100644 --- a/compiler/rustc_passes/messages.ftl +++ b/compiler/rustc_passes/messages.ftl @@ -557,7 +557,7 @@ passes_no_sanitize = `#[no_sanitize({$attr_str})]` should be applied to {$accepted_kind} .label = not {$accepted_kind} -passes_non_exaustive_with_default_field_values = +passes_non_exhaustive_with_default_field_values = `#[non_exhaustive]` can't be used to annotate items with default field values .label = this struct has default field values diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index b8359c27e538f..9bf8a1ecb1fd4 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -128,7 +128,7 @@ pub(crate) struct NonExhaustiveWrongLocation { } #[derive(Diagnostic)] -#[diag(passes_non_exaustive_with_default_field_values)] +#[diag(passes_non_exhaustive_with_default_field_values)] pub(crate) struct NonExhaustiveWithDefaultFieldValues { #[primary_span] pub attr_span: Span, diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index 11ebbea07fa4e..652a61ef54322 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -70,7 +70,7 @@ //! # Constructors and fields //! //! In the value `Pair(Some(0), true)`, `Pair` is called the constructor of the value, and `Some(0)` -//! and `true` are its fields. Every matcheable value can be decomposed in this way. Examples of +//! and `true` are its fields. Every matchable value can be decomposed in this way. Examples of //! constructors are: `Some`, `None`, `(,)` (the 2-tuple constructor), `Foo {..}` (the constructor //! for a struct `Foo`), and `2` (the constructor for the number `2`). //! @@ -102,7 +102,7 @@ //! [`Constructor::is_covered_by`]. //! //! Note 1: variable bindings (like the `x` in `Some(x)`) match anything, so we treat them as wildcards. -//! Note 2: this only applies to matcheable values. For example a value of type `Rc` can't be +//! Note 2: this only applies to matchable values. For example a value of type `Rc` can't be //! deconstructed that way. //! //! diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 701d06e4fd403..8aaef40a86934 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -185,7 +185,7 @@ pub struct CoverageOptions { /// to keep supporting this flag, remove it. pub no_mir_spans: bool, - /// `-Zcoverage-options=discard-all-spans-in-codegen`: During codgen, + /// `-Zcoverage-options=discard-all-spans-in-codegen`: During codegen, /// discard all coverage spans as though they were invalid. Needed by /// regression tests for #133606, because we don't have an easy way to /// reproduce it from actual source code. From 5bee44d5edc3935eda2f91de8cdd57fe79beddba Mon Sep 17 00:00:00 2001 From: klensy Date: Tue, 31 Dec 2024 20:13:00 +0300 Subject: [PATCH 17/24] add bootstrap and librustdoc --- .github/workflows/spellcheck.yml | 2 +- src/bootstrap/src/utils/change_tracker.rs | 2 +- src/librustdoc/html/markdown/footnotes.rs | 4 ++-- src/librustdoc/html/render/write_shared.rs | 2 +- src/librustdoc/html/static/js/main.js | 2 +- src/librustdoc/passes/strip_aliased_non_local.rs | 2 +- src/librustdoc/passes/strip_hidden.rs | 2 +- src/tools/tidy/src/ext_tool_checks.rs | 10 ++++++++-- typos.toml | 1 + 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 2551d15b0a2f2..f62d291843547 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -19,5 +19,5 @@ jobs: uses: crate-ci/typos@v1.28.2 with: # sync target files with src/tools/tidy/src/ext_tool_checks.rs - files: ./compiler ./library + files: ./compiler ./library ./src/bootstrap ./src/librustdoc config: ./typos.toml diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 1a101b02f7095..4e2ccd36b5d57 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -153,7 +153,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ ChangeInfo { change_id: 121976, severity: ChangeSeverity::Info, - summary: "A new `boostrap-cache-path` option has been introduced which can be utilized to modify the cache path for bootstrap.", + summary: "A new `bootstrap-cache-path` option has been introduced which can be utilized to modify the cache path for bootstrap.", }, ChangeInfo { change_id: 122108, diff --git a/src/librustdoc/html/markdown/footnotes.rs b/src/librustdoc/html/markdown/footnotes.rs index ded0585ddccda..7ee012c4da239 100644 --- a/src/librustdoc/html/markdown/footnotes.rs +++ b/src/librustdoc/html/markdown/footnotes.rs @@ -38,7 +38,7 @@ impl<'a, I: Iterator>> Footnotes<'a, I> { let key = key.to_owned(); let FootnoteDef { content, id } = self.footnotes.entry(key).or_insert(FootnoteDef { content: Vec::new(), id: new_id }); - // Don't allow changing the ID of existing entrys, but allow changing the contents. + // Don't allow changing the ID of existing entries, but allow changing the contents. (content, *id) } @@ -82,7 +82,7 @@ impl<'a, I: Iterator>> Iterator for Footnotes<'a, I> { return Some((self.handle_footnote_reference(reference), range)); } Some((Event::Start(Tag::FootnoteDefinition(def)), _)) => { - // When we see a footnote definition, collect the assocated content, and store + // When we see a footnote definition, collect the associated content, and store // that for rendering later. let content = self.collect_footnote_def(); let (entry_content, _) = self.get_entry(&def); diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index b2bbf4614bf45..6552c65543698 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -447,7 +447,7 @@ impl CratesIndexPart { } } - /// Might return parts that are duplicate with ones in prexisting index.html + /// Might return parts that are duplicate with ones in preexisting index.html fn get(crate_name: &str, external_crates: &[String]) -> Result, Error> { let mut ret = PartsAndLocations::default(); let path = PathBuf::from("index.html"); diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 4150c5609a97e..878baa6d25062 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -1720,7 +1720,7 @@ function preLoadCss(cssUrl) { // 300px, and the RUSTDOC_MOBILE_BREAKPOINT is 700px, so BODY_MIN must be // at most 400px. Otherwise, it would start out at the default size, then // grabbing the resize handle would suddenly cause it to jank to - // its contraint-generated maximum. + // its constraint-generated maximum. const RUSTDOC_MOBILE_BREAKPOINT = 700; const BODY_MIN = 400; // At half-way past the minimum size, vanish the sidebar entirely diff --git a/src/librustdoc/passes/strip_aliased_non_local.rs b/src/librustdoc/passes/strip_aliased_non_local.rs index 7f5c7da363422..b53e3b4e3d7ab 100644 --- a/src/librustdoc/passes/strip_aliased_non_local.rs +++ b/src/librustdoc/passes/strip_aliased_non_local.rs @@ -42,7 +42,7 @@ struct NonLocalStripper<'tcx> { impl DocFolder for NonLocalStripper<'_> { fn fold_item(&mut self, i: Item) -> Option { // If not local, we want to respect the original visibility of - // the field and not the one given by the user for the currrent crate. + // the field and not the one given by the user for the current crate. // // FIXME(#125009): Not-local should probably consider same Cargo workspace if let Some(def_id) = i.def_id() diff --git a/src/librustdoc/passes/strip_hidden.rs b/src/librustdoc/passes/strip_hidden.rs index bcdca862862d4..f6137f58211dc 100644 --- a/src/librustdoc/passes/strip_hidden.rs +++ b/src/librustdoc/passes/strip_hidden.rs @@ -166,7 +166,7 @@ impl DocFolder for Stripper<'_, '_> { self.update_retained = old; if ret.item_id == clean::ItemId::DefId(CRATE_DEF_ID.into()) { // We don't strip the current crate, even if it has `#[doc(hidden)]`. - debug!("strip_hidden: Not strippping local crate"); + debug!("strip_hidden: Not stripping local crate"); Some(ret) } else { Some(strip_item(ret)) diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index b5c8baca8b568..b543974f48a8c 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -229,8 +229,14 @@ fn check_impl( if spellcheck_all || spellcheck_fix { let config_path = root_path.join("typos.toml"); // sync target files with .github/workflows/ci.yml - let mut args = - vec!["-c", config_path.as_os_str().to_str().unwrap(), "./compiler", "./library"]; + let mut args = vec![ + "-c", + config_path.as_os_str().to_str().unwrap(), + "./compiler", + "./library", + "./src/bootstrap", + "./src/librustdoc", + ]; if spellcheck_all { eprintln!("spellcheck files"); diff --git a/typos.toml b/typos.toml index 4b7ef4e4e4034..1b75255582085 100644 --- a/typos.toml +++ b/typos.toml @@ -66,4 +66,5 @@ extend-ignore-re = [ "\\.arg\\(\"Oh no, a tpyo!\"\\)", # string used in benches "\"core::iter::adapters::Copie\"", + "-Ccontrol-flow-guard", ] From e74695dc7f723bae76687f0ffdd238d6aa4e4b30 Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 5 Jan 2025 13:50:06 +0300 Subject: [PATCH 18/24] fresh fixes --- compiler/rustc_codegen_llvm/src/builder/autodiff.rs | 2 +- compiler/rustc_hir_typeck/src/pat.rs | 2 +- library/core/src/intrinsics/mod.rs | 2 +- library/core/src/marker.rs | 2 +- typos.toml | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs index 71705ecb4d0f5..36fbaaa56fccc 100644 --- a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs +++ b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs @@ -241,7 +241,7 @@ fn generate_enzyme_call<'ll>( let call = builder.call(enzyme_ty, ad_fn, &args, None); // This part is a bit iffy. LLVM requires that a call to an inlineable function has some - // metadata attachted to it, but we just created this code oota. Given that the + // metadata attached to it, but we just created this code oota. Given that the // differentiated function already has partly confusing metadata, and given that this // affects nothing but the auttodiff IR, we take a shortcut and just steal metadata from the // dummy code which we inserted at a higher level. diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index 56dae2d7d54a8..e9822e7a205a9 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -519,7 +519,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // This is maximally flexible, allowing e.g., `Some(mut x) | &Some(mut x)`. // In that example, `Some(mut x)` results in `Peel` whereas `&Some(mut x)` in `Reset`. | PatKind::Or(_) - // Like or-patterns, guard patterns just propogate to their subpatterns. + // Like or-patterns, guard patterns just propagate to their subpatterns. | PatKind::Guard(..) => AdjustMode::Pass, } } diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index 78bb327c4f819..c1c2770035b07 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -1329,7 +1329,7 @@ pub const fn unlikely(b: bool) -> bool { /// Therefore, implementations must not require the user to uphold /// any safety invariants. /// -/// The public form of this instrinsic is [`bool::select_unpredictable`]. +/// The public form of this intrinsic is [`bool::select_unpredictable`]. #[unstable(feature = "core_intrinsics", issue = "none")] #[rustc_intrinsic] #[rustc_nounwind] diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 68011310d2cad..ef2e03c7729c5 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -199,7 +199,7 @@ pub trait Unsize { /// /// Constants are only allowed as patterns if (a) their type implements /// `PartialEq`, and (b) interpreting the value of the constant as a pattern -/// is equialent to calling `PartialEq`. This ensures that constants used as +/// is equivalent to calling `PartialEq`. This ensures that constants used as /// patterns cannot expose implementation details in an unexpected way or /// cause semver hazards. /// diff --git a/typos.toml b/typos.toml index 1b75255582085..bd84d676a6646 100644 --- a/typos.toml +++ b/typos.toml @@ -67,4 +67,5 @@ extend-ignore-re = [ # string used in benches "\"core::iter::adapters::Copie\"", "-Ccontrol-flow-guard", + "concat!\\(\"CURRENT_RUSTC_VERSIO\", \"N\"\\)", ] From c0c6774b9b0216b1173f79a5a02b7582d4fa7458 Mon Sep 17 00:00:00 2001 From: klensy Date: Thu, 16 Jan 2025 13:25:37 +0300 Subject: [PATCH 19/24] bump typos and fix new issues --- .github/workflows/spellcheck.yml | 2 +- compiler/rustc_hir/src/hir.rs | 2 +- compiler/rustc_middle/src/mir/mod.rs | 2 +- src/tools/tidy/src/ext_tool_checks.rs | 2 +- typos.toml | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index f62d291843547..876c24eb429a8 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -16,7 +16,7 @@ jobs: - name: check typos # sync version with src/tools/tidy/src/ext_tool_checks.rs - uses: crate-ci/typos@v1.28.2 + uses: crate-ci/typos@v1.29.4 with: # sync target files with src/tools/tidy/src/ext_tool_checks.rs files: ./compiler ./library ./src/bootstrap ./src/librustdoc diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index b5857e359a2ce..a8fccb97546ec 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -4045,7 +4045,7 @@ impl fmt::Display for Constness { } } -/// The actualy safety specified in syntax. We may treat +/// The actually safety specified in syntax. We may treat /// its safety different within the type system to create a /// "sound by default" system that needs checking this enum /// explicitly to allow unsafe operations. diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 4dfb362f3a22b..beb307610f1c3 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -254,7 +254,7 @@ pub struct Body<'tcx> { /// us to see the difference and forego optimization on the inlined promoted items. pub phase: MirPhase, - /// How many passses we have executed since starting the current phase. Used for debug output. + /// How many passes we have executed since starting the current phase. Used for debug output. pub pass_count: usize, pub source: MirSource<'tcx>, diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index b543974f48a8c..4f7d566f75f6a 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -523,7 +523,7 @@ fn spellcheck_runner(args: &[&str]) -> Result<(), Error> { "typos", "spellcheck file checks", // sync version with .github/workflows/ci.yml - Some("install tool via `cargo install typos-cli@1.28.2`".to_owned()), + Some("install tool via `cargo install typos-cli@1.29.4`".to_owned()), )); } Err(e) => return Err(e.into()), diff --git a/typos.toml b/typos.toml index bd84d676a6646..cf163b8f52146 100644 --- a/typos.toml +++ b/typos.toml @@ -68,4 +68,5 @@ extend-ignore-re = [ "\"core::iter::adapters::Copie\"", "-Ccontrol-flow-guard", "concat!\\(\"CURRENT_RUSTC_VERSIO\", \"N\"\\)", + "\\*\\*v\\*\\*ariable" ] From 23b032185bb87d33dc81026dec67ce47cb82e95e Mon Sep 17 00:00:00 2001 From: klensy Date: Mon, 27 Jan 2025 12:06:11 +0300 Subject: [PATCH 20/24] rebase and new fixes --- compiler/rustc_hir/src/hir.rs | 6 +++--- compiler/rustc_target/src/callconv/s390x.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index a8fccb97546ec..74aa4963f4821 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -299,7 +299,7 @@ impl<'hir> ConstArg<'hir, AmbigArg> { } impl<'hir> ConstArg<'hir> { - /// Converts a `ConstArg` in an unambigous position to one in an ambiguous position. This is + /// Converts a `ConstArg` in an unambiguous position to one in an ambiguous position. This is /// fallible as the [`ConstArgKind::Infer`] variant is not present in ambiguous positions. /// /// Functions accepting ambiguous consts will not handle the [`ConstArgKind::Infer`] variant, if @@ -368,7 +368,7 @@ pub enum GenericArg<'hir> { Lifetime(&'hir Lifetime), Type(&'hir Ty<'hir, AmbigArg>), Const(&'hir ConstArg<'hir, AmbigArg>), - /// Inference variables in [`GenericArg`] are always represnted by + /// Inference variables in [`GenericArg`] are always represented by /// `GenericArg::Infer` instead of the `Infer` variants on [`TyKind`] and /// [`ConstArgKind`] as it is not clear until hir ty lowering whether a /// `_` argument is a type or const argument. @@ -3147,7 +3147,7 @@ impl<'hir> Ty<'hir, AmbigArg> { } impl<'hir> Ty<'hir> { - /// Converts a `Ty` in an unambigous position to one in an ambiguous position. This is + /// Converts a `Ty` in an unambiguous position to one in an ambiguous position. This is /// fallible as the [`TyKind::Infer`] variant is not present in ambiguous positions. /// /// Functions accepting ambiguous types will not handle the [`TyKind::Infer`] variant, if diff --git a/compiler/rustc_target/src/callconv/s390x.rs b/compiler/rustc_target/src/callconv/s390x.rs index 1ba792c5acc5a..d2ae404b23b8b 100644 --- a/compiler/rustc_target/src/callconv/s390x.rs +++ b/compiler/rustc_target/src/callconv/s390x.rs @@ -46,7 +46,7 @@ where } if arg.layout.is_single_vector_element(cx, size) { - // pass non-transparant wrappers around a vector as `PassMode::Cast` + // pass non-transparent wrappers around a vector as `PassMode::Cast` arg.cast_to(Reg { kind: RegKind::Vector, size }); return; } From 607d7f92063de260580316b5022571223ca2ab81 Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 7 Feb 2025 12:07:41 +0300 Subject: [PATCH 21/24] rebase and new fixes --- compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs | 4 ++-- library/core/src/intrinsics/mod.rs | 2 +- src/librustdoc/doctest/extracted.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 90bdb3c4b3739..516091dd4c4cf 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -2399,7 +2399,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } if !mismatched_params.is_empty() { - // For each mismatched paramter, create a two-way link to each matched parameter + // For each mismatched parameter, create a two-way link to each matched parameter // of the same type. let mut dependants = IndexVec::::from_fn_n( |_| SmallVec::<[u32; 4]>::new(), @@ -2442,7 +2442,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { spans.push_span_label(param.param.span(), ""); } } - // Highligh each parameter being depended on for a generic type. + // Highlight each parameter being depended on for a generic type. for ((&(_, param), deps), &(_, expected_ty)) in params_with_generics.iter().zip(&dependants).zip(formal_and_expected_inputs) { diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index c1c2770035b07..dfe9d1e23e472 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -3431,7 +3431,7 @@ pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) /// Returns whether we should perform contract-checking at runtime. /// /// This is meant to be similar to the ub_checks intrinsic, in terms -/// of not prematurely commiting at compile-time to whether contract +/// of not prematurely committing at compile-time to whether contract /// checking is turned on, so that we can specify contracts in libstd /// and let an end user opt into turning them on. #[rustc_const_unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)] diff --git a/src/librustdoc/doctest/extracted.rs b/src/librustdoc/doctest/extracted.rs index ce362eabfc4c9..af58dffbdb525 100644 --- a/src/librustdoc/doctest/extracted.rs +++ b/src/librustdoc/doctest/extracted.rs @@ -52,7 +52,7 @@ impl ExtractedDocTests { Some(&opts.crate_name), ); self.doctests.push(ExtractedDocTest { - file: filename.prefer_remapped_unconditionaly().to_string(), + file: filename.prefer_remapped_unconditionally().to_string(), line, doctest_attributes: langstr.into(), doctest_code: if size != 0 { Some(full_test_code) } else { None }, From 92f285a1c5f1a6c3c6dd894f702359b46981fc5c Mon Sep 17 00:00:00 2001 From: klensy Date: Tue, 25 Feb 2025 15:04:01 +0300 Subject: [PATCH 22/24] rebase and fix --- compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs | 2 +- library/std/src/time.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs index f6b238629075c..6736dcbf3e45d 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs @@ -25,7 +25,7 @@ unsafe extern "C" { pub(crate) fn LLVMDumpValue(V: &Value); pub(crate) fn LLVMGetFunctionCallConv(F: &Value) -> c_uint; pub(crate) fn LLVMGetReturnType(T: &Type) -> &Type; - pub(crate) fn LLVMGetParams(Fnc: &Value, parms: *mut &Value); + pub(crate) fn LLVMGetParams(Fnc: &Value, params: *mut &Value); pub(crate) fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>; } diff --git a/library/std/src/time.rs b/library/std/src/time.rs index 5ab71413586dc..19d59eac8981f 100644 --- a/library/std/src/time.rs +++ b/library/std/src/time.rs @@ -95,10 +95,10 @@ use crate::sys_common::{FromInner, IntoInner}; /// let now = Instant::now(); /// let days_per_10_millennia = 365_2425; /// let solar_seconds_per_day = 60 * 60 * 24; -/// let millenium_in_solar_seconds = 31_556_952_000; -/// assert_eq!(millenium_in_solar_seconds, days_per_10_millennia * solar_seconds_per_day / 10); +/// let millennium_in_solar_seconds = 31_556_952_000; +/// assert_eq!(millennium_in_solar_seconds, days_per_10_millennia * solar_seconds_per_day / 10); /// -/// let duration = Duration::new(millenium_in_solar_seconds, 0); +/// let duration = Duration::new(millennium_in_solar_seconds, 0); /// println!("{:?}", now + duration); /// ``` /// From c8d94829e134ea463aa0a998a9f1bcd02bbfee19 Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 5 Mar 2025 16:34:41 +0300 Subject: [PATCH 23/24] rebase and fix --- compiler/rustc_ast_lowering/src/lib.rs | 2 +- compiler/rustc_attr_parsing/src/attributes/mod.rs | 2 +- compiler/rustc_codegen_ssa/src/target_features.rs | 2 +- compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs | 2 +- compiler/rustc_macros/src/lib.rs | 2 +- compiler/rustc_middle/src/ty/significant_drop_order.rs | 2 +- compiler/rustc_type_ir/src/search_graph/mod.rs | 2 +- src/librustdoc/html/render/mod.rs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index e24b45c5b1947..0fd698b3ba7e4 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -885,7 +885,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let ret = self.arena.alloc_from_iter(lowered_attrs); // this is possible if an item contained syntactical attribute, - // but none of them parse succesfully or all of them were ignored + // but none of them parse successfully or all of them were ignored // for not being built-in attributes at all. They could be remaining // unexpanded attributes used as markers in proc-macro derives for example. // This will have emitted some diagnostics for the misparse, but will then diff --git a/compiler/rustc_attr_parsing/src/attributes/mod.rs b/compiler/rustc_attr_parsing/src/attributes/mod.rs index 6ecd6b4d7dbb7..c023417d72e56 100644 --- a/compiler/rustc_attr_parsing/src/attributes/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/mod.rs @@ -74,7 +74,7 @@ pub(crate) trait AttributeParser: Default + 'static { pub(crate) trait SingleAttributeParser: 'static { const PATH: &'static [rustc_span::Symbol]; - /// Caled when a duplicate attribute is found. + /// Called when a duplicate attribute is found. /// /// `first_span` is the span of the first occurrence of this attribute. // FIXME(jdonszelmann): default error diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index 8058cd1b1783a..2bfc89558dd94 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -171,7 +171,7 @@ pub(crate) fn provide(providers: &mut Providers) { // The stability in the entry is at least as good as the new one, just keep it. } _ => { - // Overwrite stabilite. + // Overwrite stability. occupied_entry.insert(stability); } } diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 516091dd4c4cf..b46fda5b54ae4 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -112,7 +112,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let mut deferred_repeat_expr_checks = self.deferred_repeat_expr_checks.borrow_mut(); debug!("FnCtxt::check_repeat_exprs: {} deferred checks", deferred_repeat_expr_checks.len()); for (element, element_ty, count) in deferred_repeat_expr_checks.drain(..) { - // We want to emit an error if the const is not structurally resolveable as otherwise + // We want to emit an error if the const is not structurally resolvable as otherwise // we can find up conservatively proving `Copy` which may infer the repeat expr count // to something that never required `Copy` in the first place. let count = diff --git a/compiler/rustc_macros/src/lib.rs b/compiler/rustc_macros/src/lib.rs index edb25e799045a..a737e23e51379 100644 --- a/compiler/rustc_macros/src/lib.rs +++ b/compiler/rustc_macros/src/lib.rs @@ -179,7 +179,7 @@ decl_derive! { [PrintAttribute] => /// Derives `PrintAttribute` for `AttributeKind`. /// This macro is pretty specific to `rustc_attr_data_structures` and likely not that useful in - /// other places. It's deriving something close to `Debug` without printing some extraenous + /// other places. It's deriving something close to `Debug` without printing some extraneous /// things like spans. print_attribute::print_attribute } diff --git a/compiler/rustc_middle/src/ty/significant_drop_order.rs b/compiler/rustc_middle/src/ty/significant_drop_order.rs index 2d9e0331451fd..85ebb2d331892 100644 --- a/compiler/rustc_middle/src/ty/significant_drop_order.rs +++ b/compiler/rustc_middle/src/ty/significant_drop_order.rs @@ -70,7 +70,7 @@ fn true_significant_drop_ty<'tcx>( } } -/// Returns the list of types with a "potentially sigificant" that may be dropped +/// Returns the list of types with a "potentially significant" that may be dropped /// by dropping a value of type `ty`. #[instrument(level = "trace", skip(tcx, typing_env))] pub fn extract_component_raw<'tcx>( diff --git a/compiler/rustc_type_ir/src/search_graph/mod.rs b/compiler/rustc_type_ir/src/search_graph/mod.rs index 1acd5d5c2af4b..f6d9a1f8cf445 100644 --- a/compiler/rustc_type_ir/src/search_graph/mod.rs +++ b/compiler/rustc_type_ir/src/search_graph/mod.rs @@ -514,7 +514,7 @@ pub struct SearchGraph, X: Cx = ::Cx> { /// /// `nested_goals` are only used when checking whether global cache entries /// are applicable. This only cares about whether a goal is actually accessed. -/// Given that the usage of the provisional cache is fully determinstic, we +/// Given that the usage of the provisional cache is fully deterministic, we /// don't need to track the nested goals used while computing a provisional /// cache entry. enum UpdateParentGoalCtxt<'a, X: Cx> { diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 8dfde1679fe11..37ac58b7f8c8b 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1917,7 +1917,7 @@ fn render_impl( // 3. Functions // // This order is because you can have associated constants used in associated types (like array - // length), and both in associcated functions. So with this order, when reading from top to + // length), and both in associated functions. So with this order, when reading from top to // bottom, you should see items definitions before they're actually used most of the time. let mut assoc_types = Vec::new(); let mut methods = Vec::new(); From 4bf25f452ebf83d5b4653418c3438bb271143ac4 Mon Sep 17 00:00:00 2001 From: klensy Date: Tue, 18 Mar 2025 14:57:01 +0300 Subject: [PATCH 24/24] rebase and bump typos to 1.30.2 --- .github/workflows/spellcheck.yml | 2 +- compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 2 +- compiler/rustc_codegen_ssa/src/errors.rs | 2 +- compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs | 2 +- compiler/rustc_ty_utils/src/opaque_types.rs | 2 +- library/core/src/num/dec2flt/float.rs | 2 +- library/std/src/sys/pal/uefi/helpers.rs | 2 +- src/librustdoc/html/static/js/rustdoc.d.ts | 2 +- src/tools/tidy/src/ext_tool_checks.rs | 2 +- typos.toml | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 876c24eb429a8..afdc2b2bdccff 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -16,7 +16,7 @@ jobs: - name: check typos # sync version with src/tools/tidy/src/ext_tool_checks.rs - uses: crate-ci/typos@v1.29.4 + uses: crate-ci/typos@v1.30.2 with: # sync target files with src/tools/tidy/src/ext_tool_checks.rs files: ./compiler ./library ./src/bootstrap ./src/librustdoc diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index d5972b5c9e649..85fe7e1e575bf 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -378,7 +378,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs { [sym::arm, sym::a32 | sym::t32] if !tcx.sess.target.has_thumb_interworking => { - tcx.dcx().emit_err(errors::UnsuportedInstructionSet { + tcx.dcx().emit_err(errors::UnsupportedInstructionSet { span: attr.span(), }); None diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index 0b7cad0c2fd8a..e8953028b0581 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -150,7 +150,7 @@ pub(crate) struct NullOnExport { #[derive(Diagnostic)] #[diag(codegen_ssa_unsupported_instruction_set, code = E0779)] -pub(crate) struct UnsuportedInstructionSet { +pub(crate) struct UnsupportedInstructionSet { #[primary_span] pub span: Span, } diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 76a880da41855..8b95723eca4f4 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -1059,7 +1059,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { ); // FIXME(#97583): Print associated item bindings properly (i.e., not as equality predicates!). - // FIXME: Turn this into a structured, translateable & more actionable suggestion. + // FIXME: Turn this into a structured, translatable & more actionable suggestion. let mut where_bounds = vec![]; for bound in [bound, bound2].into_iter().chain(matching_candidates) { let bound_id = bound.def_id(); diff --git a/compiler/rustc_ty_utils/src/opaque_types.rs b/compiler/rustc_ty_utils/src/opaque_types.rs index 3aad97d86cca1..7409228e72e02 100644 --- a/compiler/rustc_ty_utils/src/opaque_types.rs +++ b/compiler/rustc_ty_utils/src/opaque_types.rs @@ -179,7 +179,7 @@ impl<'tcx> OpaqueTypeCollector<'tcx> { } } - /// Checks the `#[define_opaque]` attributes on items and collectes opaques to define + /// Checks the `#[define_opaque]` attributes on items and collects opaques to define /// from the referenced types. #[instrument(level = "trace", skip(self))] fn collect_taits_from_defines_attr(&mut self) { diff --git a/library/core/src/num/dec2flt/float.rs b/library/core/src/num/dec2flt/float.rs index b8a28a6756917..f87de0ab8ea6e 100644 --- a/library/core/src/num/dec2flt/float.rs +++ b/library/core/src/num/dec2flt/float.rs @@ -143,7 +143,7 @@ pub trait RawFloat: /// smaller than `10^SMALLEST_POWER_OF_TEN`, which will round to zero. /// /// The smallest power of ten is represented by `⌊log10(2^-n / (2^64 - 1))⌋`, where `n` is - /// the smallest power of two. The `2^64 - 1)` denomenator comes from the number of values + /// the smallest power of two. The `2^64 - 1)` denominator comes from the number of values /// that are representable by the intermediate storage format. I don't actually know _why_ /// the storage format is relevant here. /// diff --git a/library/std/src/sys/pal/uefi/helpers.rs b/library/std/src/sys/pal/uefi/helpers.rs index b2d4c34b97174..f1da3ec129476 100644 --- a/library/std/src/sys/pal/uefi/helpers.rs +++ b/library/std/src/sys/pal/uefi/helpers.rs @@ -681,7 +681,7 @@ pub(crate) fn get_device_path_from_map(map: &Path) -> io::Result, diff --git a/src/librustdoc/html/static/js/rustdoc.d.ts b/src/librustdoc/html/static/js/rustdoc.d.ts index 4b43c00730d47..105f21d1630ea 100644 --- a/src/librustdoc/html/static/js/rustdoc.d.ts +++ b/src/librustdoc/html/static/js/rustdoc.d.ts @@ -429,7 +429,7 @@ declare namespace rustdoc { /** * Maps from crate names to trait implementation data. - * Provied by generated `trait.impl` files. + * Provided by generated `trait.impl` files. */ type Implementors = { [key: string]: Array<[string, number, Array]> diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 4f7d566f75f6a..b081b79bbcc15 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -523,7 +523,7 @@ fn spellcheck_runner(args: &[&str]) -> Result<(), Error> { "typos", "spellcheck file checks", // sync version with .github/workflows/ci.yml - Some("install tool via `cargo install typos-cli@1.29.4`".to_owned()), + Some("install tool via `cargo install typos-cli@1.30.2`".to_owned()), )); } Err(e) => return Err(e.into()), diff --git a/typos.toml b/typos.toml index cf163b8f52146..bb07219667694 100644 --- a/typos.toml +++ b/typos.toml @@ -7,8 +7,8 @@ extend-exclude = [ "library/backtrace", "library/stdarch", # generated lorem ipsum texts - "library/alloc/benches/str.rs", - "library/alloc/tests/str.rs", + "library/alloctests/benches/str.rs", + "library/alloctests/tests/str.rs", ] [default.extend-words]