Rollup merge of #134006 - klensy:typos, r=nnethercote

setup typos check in CI

This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying?

Also includes commits with actual typo fixes.

MCP: https://github.com/rust-lang/compiler-team/issues/817

typos check currently turned for:
* ./compiler
* ./library
* ./src/bootstrap
* ./src/librustdoc

After merging, PRs which enables checks for other crates (tools) can be implemented too.

Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr.

Check typos: `python x.py test tidy --extra-checks=spellcheck`
Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo)

Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
This commit is contained in:
Jana Dönszelmann
2025-07-03 13:29:35 +02:00
committed by GitHub
129 changed files with 326 additions and 175 deletions

View File

@@ -878,12 +878,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<ElidedAnonymousLivetimeReportErrorSuggestion>,
pub(crate) suggestion: Option<ElidedAnonymousLifetimeReportErrorSuggestion>,
}
#[derive(Diagnostic)]
@@ -897,7 +897,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,
@@ -908,7 +908,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 ")]
@@ -917,7 +917,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,

View File

@@ -1892,7 +1892,7 @@ impl<'a, 'ast, 'ra, '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(),
})
@@ -1918,18 +1918,18 @@ impl<'a, 'ast, 'ra, '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,
});
};

View File

@@ -627,7 +627,7 @@ pub fn source_span_for_markdown_range_inner(
let fragment = &fragments[i];
let sp = fragment.span;
// we need to calculate the span start,
// then use that in our calulations for the span end
// then use that in our calculations for the span end
let lo = sp.lo() + BytePos(match_start as u32);
return Some((
sp.with_lo(lo).with_hi(lo + BytePos((md_range.end - md_range.start) as u32)),