From 55d9f7cb6c7880dc5e2b75f013666ad01e265d1f Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 16 Mar 2026 17:28:48 +1000 Subject: [PATCH] Fix typos and outdated comments --- compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs | 4 ++-- compiler/rustc_codegen_ssa/src/mir/mod.rs | 2 +- compiler/rustc_hir/src/def.rs | 2 +- compiler/rustc_hir/src/target.rs | 6 +----- src/tools/compiletest/src/runtest.rs | 4 ++-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs index a8db114129ff..652a783de322 100644 --- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs @@ -169,7 +169,7 @@ fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option, args: &ArgParser) -> Option>( assert_eq!( None, num_untupled.replace(tupled_arg_tys.len()), - "Replaced existing num_tupled" + "Replaced existing num_untupled" ); return LocalRef::Place(place); diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 3959ee7f9412..21abb5506fcc 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -192,7 +192,7 @@ pub enum DefKind { /// These are all represented with the same `ExprKind::Closure` in the AST and HIR, /// which makes it difficult to distinguish these during def collection. Therefore, /// we treat them all the same, and code which needs to distinguish them can match - /// or `hir::ClosureKind` or `type_of`. + /// on `hir::ClosureKind` or `type_of`. Closure, /// The definition of a synthetic coroutine body created by the lowering of a /// coroutine-closure, such as an async closure. diff --git a/compiler/rustc_hir/src/target.rs b/compiler/rustc_hir/src/target.rs index dd685c44ec47..07c33eb935f2 100644 --- a/compiler/rustc_hir/src/target.rs +++ b/compiler/rustc_hir/src/target.rs @@ -1,8 +1,4 @@ -//! This module implements some validity checks for attributes. -//! In particular it verifies that `#[inline]` and `#[repr]` attributes are -//! attached to items that actually support them and if there are -//! conflicts between multiple such attributes attached to the same -//! item. +//! This module lists attribute targets, with conversions from other types. use std::fmt::{self, Display}; diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index b674c6e29d42..b584d14b0c9f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2121,7 +2121,7 @@ fn output_base_name(&self) -> Utf8PathBuf { } /// Prints a message to (captured) stdout if `config.verbose` is true. - /// The message is also logged to `tracing::debug!` regardles of verbosity. + /// The message is also logged to `tracing::debug!` regardless of verbosity. /// /// Use `format_args!` as the argument to perform formatting if required. fn logv(&self, message: impl fmt::Display) { @@ -2748,7 +2748,7 @@ fn compare_output( return CompareOutcome::Same; } if expected_lines.is_empty() { - // if we have no lines to check, force a full overwite + // if we have no lines to check, force a full overwrite ("", actual) } else { // this prints/blesses the subset, not the actual