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

@@ -41,7 +41,7 @@ declare_lint! {
/// }
/// ```
///
/// Otherwise try to find an alternative way to achive your goals using only raw pointers:
/// Otherwise try to find an alternative way to achieve your goals using only raw pointers:
///
/// ```rust
/// use std::ptr;

View File

@@ -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;
}

View File

@@ -230,7 +230,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 {

View File

@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidReferenceCasting {
let init = cx.expr_or_init(e);
let orig_cast = if init.span != e.span { Some(init.span) } else { None };
// small cache to avoid recomputing needlesly computing peel_casts of init
// small cache to avoid recomputing needlessly computing peel_casts of init
let mut peel_casts = {
let mut peel_casts_cache = None;
move || *peel_casts_cache.get_or_insert_with(|| peel_casts(cx, init))