diff --git a/compiler/rustc_builtin_macros/messages.ftl b/compiler/rustc_builtin_macros/messages.ftl index cbdd8199d7ba3..5e498bf98fb55 100644 --- a/compiler/rustc_builtin_macros/messages.ftl +++ b/compiler/rustc_builtin_macros/messages.ftl @@ -283,7 +283,7 @@ builtin_macros_requires_cfg_pattern = macro requires a cfg-pattern as an argument .label = cfg-pattern required -builtin_macros_source_uitls_expected_item = expected item, found `{$token}` +builtin_macros_source_utils_expected_item = expected item, found `{$token}` builtin_macros_takes_no_arguments = {$name} takes no arguments diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs index 0993fdc5be453..d6ffbb5a4101d 100644 --- a/compiler/rustc_builtin_macros/src/errors.rs +++ b/compiler/rustc_builtin_macros/src/errors.rs @@ -952,7 +952,7 @@ pub(crate) struct AttributeOnlyUsableWithCrateType<'a> { } #[derive(Diagnostic)] -#[diag(builtin_macros_source_uitls_expected_item)] +#[diag(builtin_macros_source_utils_expected_item)] pub(crate) struct ExpectedItem<'a> { #[primary_span] pub span: Span, diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 6ce1cbe072c06..7e0199ba464b4 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -358,7 +358,7 @@ fn write_bitcode_to_file(module: &ModuleCodegen, path: &Path) { } } -/// In what context is a dignostic handler being attached to a codegen unit? +/// In what context is a diagnostic handler being attached to a codegen unit? pub(crate) enum CodegenDiagnosticsStage { /// Prelink optimization stage. Opt, diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs index 23e4a2921ea6e..312ebe7ddd09d 100644 --- a/compiler/rustc_const_eval/src/interpret/call.rs +++ b/compiler/rustc_const_eval/src/interpret/call.rs @@ -127,7 +127,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { } else if all_fields_1zst(def.variant(var1))? { def.variant(var0) } else { - // No varant is all-1-ZST, so no NPO. + // No variant is all-1-ZST, so no NPO. return interp_ok(layout); }; // The "relevant" variant must have exactly one field, and its type is the "inner" type. diff --git a/compiler/rustc_const_eval/src/interpret/projection.rs b/compiler/rustc_const_eval/src/interpret/projection.rs index 2fd1657f6ba3a..027e634ef7f7b 100644 --- a/compiler/rustc_const_eval/src/interpret/projection.rs +++ b/compiler/rustc_const_eval/src/interpret/projection.rs @@ -2,7 +2,7 @@ //! //! OpTy and PlaceTy generally work by "let's see if we are actually an MPlaceTy, and do something custom if not". //! For PlaceTy, the custom thing is basically always to call `force_allocation` and then use the MPlaceTy logic anyway. -//! For OpTy, the custom thing on field pojections has to be pretty clever (since `Operand::Immediate` can have fields), +//! For OpTy, the custom thing on field projections has to be pretty clever (since `Operand::Immediate` can have fields), //! but for array/slice operations it only has to worry about `Operand::Uninit`. That makes the value part trivial, //! but we still need to do bounds checking and adjust the layout. To not duplicate that with MPlaceTy, we actually //! implement the logic on OpTy, and MPlaceTy calls that. diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index f667823723c0a..b5cf6c4c3723c 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -74,7 +74,7 @@ impl EnteredTraceSpan for tracing::span::EnteredSpan { } } -/// Shortand for calling [crate::interpret::Machine::enter_trace_span] on a [tracing::info_span!]. +/// Shorthand for calling [crate::interpret::Machine::enter_trace_span] on a [tracing::info_span!]. /// This is supposed to be compiled out when [crate::interpret::Machine::enter_trace_span] has the /// default implementation (i.e. when it does not actually enter the span but instead returns `()`). /// This macro takes a type implementing the [crate::interpret::Machine] trait as its first argument diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index aacd2f511a3c3..d3325f68cfe80 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -479,10 +479,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - // If the shadowed binding has an itializer expression, + // If the shadowed binding has an initializer expression, // use the initializer expression's ty to try to find the method again. // For example like: `let mut x = Vec::new();`, - // `Vec::new()` is the itializer expression. + // `Vec::new()` is the initializer expression. if let Some(self_ty) = self.fcx.node_ty_opt(binding.init_hir_id) && self .fcx diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index d9bcd5e3481f3..d3468499b4b3a 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -2959,7 +2959,7 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels { for c in chars { // Inside a template format arg, any character is permitted for the - // puproses of label detection because we assume that it can be + // purposes of label detection because we assume that it can be // replaced with some other valid label string later. `options(raw)` // asm blocks cannot have format args, so they are excluded from this // special case. diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs index f25003bbfe92a..5692320a8a175 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs @@ -993,7 +993,7 @@ where } } - /// This sohuld only be used when we're either instantiating a previously + /// This should only be used when we're either instantiating a previously /// unconstrained "return value" or when we're sure that all aliases in /// the types are rigid. #[instrument(level = "trace", skip(self, param_env), ret)] diff --git a/compiler/rustc_next_trait_solver/src/solve/mod.rs b/compiler/rustc_next_trait_solver/src/solve/mod.rs index a58caeecc33c5..5916e58994815 100644 --- a/compiler/rustc_next_trait_solver/src/solve/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/mod.rs @@ -39,7 +39,7 @@ use crate::solve::assembly::Candidate; /// /// We previously used `cx.recursion_limit().0.checked_ilog2().unwrap_or(0)` for this. /// However, it feels unlikely that uncreasing the recursion limit by a power of two -/// to get one more itereation is every useful or desirable. We now instead used a constant +/// to get one more iteration is every useful or desirable. We now instead used a constant /// here. If there ever ends up some use-cases where a bigger number of fixpoint iterations /// is required, we can add a new attribute for that or revert this to be dependant on the /// recursion limit again. However, this feels very unlikely. diff --git a/compiler/rustc_public/src/mir/visit.rs b/compiler/rustc_public/src/mir/visit.rs index 1cb9bfe79a096..775237c8b3220 100644 --- a/compiler/rustc_public/src/mir/visit.rs +++ b/compiler/rustc_public/src/mir/visit.rs @@ -181,7 +181,7 @@ macro_rules! make_mir_visitor { self.visit_user_type_projection(projections); } StatementKind::Coverage(coverage) => visit_opaque(coverage), - StatementKind::Intrinsic(intrisic) => match intrisic { + StatementKind::Intrinsic(intrinsic) => match intrinsic { NonDivergingIntrinsic::Assume(operand) => { self.visit_operand(operand, location); } diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index f6f054708ac28..b2c72f19b78be 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -507,7 +507,7 @@ impl DepGraph { } } - /// This encodes a diagnostic by creating a node with an unique index and assoicating + /// This encodes a diagnostic by creating a node with an unique index and associating /// `diagnostic` with it, for use in the next session. #[inline] pub fn record_diagnostic(&self, qcx: Qcx, diagnostic: &DiagInner) { @@ -657,7 +657,7 @@ impl DepGraphData { self.debug_loaded_from_disk.lock().insert(dep_node); } - /// This encodes a diagnostic by creating a node with an unique index and assoicating + /// This encodes a diagnostic by creating a node with an unique index and associating /// `diagnostic` with it, for use in the next session. #[inline] fn encode_diagnostic( diff --git a/library/alloc/src/collections/vec_deque/tests.rs b/library/alloc/src/collections/vec_deque/tests.rs index ad76cb14deb86..2501534e95080 100644 --- a/library/alloc/src/collections/vec_deque/tests.rs +++ b/library/alloc/src/collections/vec_deque/tests.rs @@ -367,7 +367,7 @@ fn test_rotate_right_panic() { #[test] fn test_binary_search() { - // If the givin VecDeque is not sorted, the returned result is unspecified and meaningless, + // If the given VecDeque is not sorted, the returned result is unspecified and meaningless, // as this method performs a binary search. let tester: VecDeque<_> = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55].into(); @@ -391,7 +391,7 @@ fn test_binary_search() { #[test] fn test_binary_search_by() { - // If the givin VecDeque is not sorted, the returned result is unspecified and meaningless, + // If the given VecDeque is not sorted, the returned result is unspecified and meaningless, // as this method performs a binary search. let tester: VecDeque<_> = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55].into(); @@ -406,7 +406,7 @@ fn test_binary_search_by() { #[test] fn test_binary_search_key() { - // If the givin VecDeque is not sorted, the returned result is unspecified and meaningless, + // If the given VecDeque is not sorted, the returned result is unspecified and meaningless, // as this method performs a binary search. let tester: VecDeque<_> = [ diff --git a/library/core/src/asserting.rs b/library/core/src/asserting.rs index 3015aa562e6c0..acaee72c93016 100644 --- a/library/core/src/asserting.rs +++ b/library/core/src/asserting.rs @@ -73,12 +73,14 @@ where // ***** Others ***** +//spellchecker:off /// All possible captured `assert!` elements /// /// # Types /// /// * `E`: **E**lement that is going to be displayed. /// * `M`: **M**arker used to differentiate [Capture]s in regards to [Debug]. +//spellchecker:on #[unstable(feature = "generic_assert_internals", issue = "44838")] pub struct Capture { // If None, then `E` does not implements [Printable] or `E` wasn't evaluated (`assert!( ... )` diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs index 722af55103839..21dbd09f49606 100644 --- a/library/core/src/panic/unwind_safe.rs +++ b/library/core/src/panic/unwind_safe.rs @@ -101,9 +101,9 @@ pub auto trait UnwindSafe {} #[rustc_diagnostic_item = "ref_unwind_safe_trait"] #[diagnostic::on_unimplemented( message = "the type `{Self}` may contain interior mutability and a reference may not be safely \ - transferrable across a catch_unwind boundary", + transferable across a catch_unwind boundary", label = "`{Self}` may contain interior mutability and a reference may not be safely \ - transferrable across a catch_unwind boundary" + transferable across a catch_unwind boundary" )] pub auto trait RefUnwindSafe {} diff --git a/library/std/src/sys/fs/vexos.rs b/library/std/src/sys/fs/vexos.rs index 99b156d535768..381c87c62c688 100644 --- a/library/std/src/sys/fs/vexos.rs +++ b/library/std/src/sys/fs/vexos.rs @@ -106,7 +106,7 @@ impl FilePermissions { } pub fn set_readonly(&mut self, _readonly: bool) { - panic!("Perimissions do not exist") + panic!("Permissions do not exist") } } diff --git a/library/std/src/sys/pal/uefi/time.rs b/library/std/src/sys/pal/uefi/time.rs index c6636626fd58a..861b98da18daf 100644 --- a/library/std/src/sys/pal/uefi/time.rs +++ b/library/std/src/sys/pal/uefi/time.rs @@ -181,7 +181,7 @@ pub(crate) mod system_time_internal { /// The changes are to use 1900-01-01-00:00:00 with timezone -1440 as anchor instead of UNIX /// epoch used in the original algorithm. pub(crate) const fn to_uefi(dur: &Duration, timezone: i16, daylight: u8) -> Option