Skip to content

Commit 2f6cb4e

Browse files
authored
Unrolled build for #134006
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: rust-lang/compiler-team#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+.
2 parents 9e64506 + c76d032 commit 2f6cb4e

File tree

129 files changed

+326
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+326
-175
lines changed

.github/workflows/spellcheck.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This workflow runs spellcheck job
2+
3+
name: Spellcheck
4+
on:
5+
pull_request:
6+
branches:
7+
- "**"
8+
9+
jobs:
10+
spellcheck:
11+
name: run spellchecker
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the source code
15+
uses: actions/checkout@v4
16+
17+
- name: check typos
18+
# sync version with src/tools/tidy/src/ext_tool_checks.rs in spellcheck_runner
19+
uses: crate-ci/typos@v1.34.0
20+
with:
21+
# sync target files with src/tools/tidy/src/ext_tool_checks.rs in check_impl
22+
files: ./compiler ./library ./src/bootstrap ./src/librustdoc
23+
config: ./typos.toml

REUSE.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ path = [
3636
"rustfmt.toml",
3737
"rust-bors.toml",
3838
"triagebot.toml",
39+
"typos.toml",
3940
"x",
4041
"x.ps1",
4142
"x.py",

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ impl Expr {
13441344
}
13451345
}
13461346

1347-
/// Returns an expression with (when possible) *one* outter brace removed
1347+
/// Returns an expression with (when possible) *one* outer brace removed
13481348
pub fn maybe_unwrap_block(&self) -> &Expr {
13491349
if let ExprKind::Block(block, None) = &self.kind
13501350
&& let [stmt] = block.stmts.as_slice()

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ macro_rules! common_visitor_and_walkers {
142142
)?
143143

144144
// Methods in this trait have one of three forms, with the last two forms
145-
// only occuring on `MutVisitor`:
145+
// only occurring on `MutVisitor`:
146146
//
147147
// fn visit_t(&mut self, t: &mut T); // common
148148
// fn flat_map_t(&mut self, t: T) -> SmallVec<[T; 1]>; // rare

compiler/rustc_ast_passes/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ast_passes_abi_cannot_be_coroutine =
22
functions with the {$abi} ABI cannot be `{$coroutine_kind_str}`
3-
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definiton
3+
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definition
44
55
ast_passes_abi_custom_safe_foreign_function =
66
foreign functions with the "custom" ABI cannot be safe

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{fluent_generated, parse_version};
1414

1515
/// Emitter of a builtin lint from `cfg_matches`.
1616
///
17-
/// Used to support emiting a lint (currently on check-cfg), either:
17+
/// Used to support emitting a lint (currently on check-cfg), either:
1818
/// - as an early buffered lint (in `rustc`)
1919
/// - or has a "normal" lint from HIR (in `rustdoc`)
2020
pub trait CfgMatchesLintEmitter {

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl Stage for Late {
189189
}
190190
}
191191

192-
/// used when parsing attributes for miscelaneous things *before* ast lowering
192+
/// used when parsing attributes for miscellaneous things *before* ast lowering
193193
pub struct Early;
194194
/// used when parsing attributes during ast lowering
195195
pub struct Late;

compiler/rustc_builtin_macros/src/autodiff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ mod llvm_enzyme {
562562
/// so instead we manually build something that should pass the type checker.
563563
/// We also add a inline_asm line, as one more barrier for rustc to prevent inlining
564564
/// or const propagation. inline_asm will also triggers an Enzyme crash if due to another
565-
/// bug would ever try to accidentially differentiate this placeholder function body.
565+
/// bug would ever try to accidentally differentiate this placeholder function body.
566566
/// Finally, we also add back_box usages of all input arguments, to prevent rustc
567567
/// from optimizing any arguments away.
568568
fn gen_enzyme_body(
@@ -606,7 +606,7 @@ mod llvm_enzyme {
606606
return body;
607607
}
608608

609-
// Everything from here onwards just tries to fullfil the return type. Fun!
609+
// Everything from here onwards just tries to fulfil the return type. Fun!
610610

611611
// having an active-only return means we'll drop the original return type.
612612
// So that can be treated identical to not having one in the first place.

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn call_simple_intrinsic<'ll, 'tcx>(
107107
sym::minimumf32 => ("llvm.minimum", &[bx.type_f32()]),
108108
sym::minimumf64 => ("llvm.minimum", &[bx.type_f64()]),
109109
// There are issues on x86_64 and aarch64 with the f128 variant,
110-
// let's instead use the instrinsic fallback body.
110+
// let's instead use the intrinsic fallback body.
111111
// sym::minimumf128 => ("llvm.minimum", &[cx.type_f128()]),
112112
sym::maxnumf16 => ("llvm.maxnum", &[bx.type_f16()]),
113113
sym::maxnumf32 => ("llvm.maxnum", &[bx.type_f32()]),
@@ -118,7 +118,7 @@ fn call_simple_intrinsic<'ll, 'tcx>(
118118
sym::maximumf32 => ("llvm.maximum", &[bx.type_f32()]),
119119
sym::maximumf64 => ("llvm.maximum", &[bx.type_f64()]),
120120
// There are issues on x86_64 and aarch64 with the f128 variant,
121-
// let's instead use the instrinsic fallback body.
121+
// let's instead use the intrinsic fallback body.
122122
// sym::maximumf128 => ("llvm.maximum", &[cx.type_f128()]),
123123
sym::copysignf16 => ("llvm.copysign", &[bx.type_f16()]),
124124
sym::copysignf32 => ("llvm.copysign", &[bx.type_f32()]),

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ unsafe extern "C" {
4040
pub(crate) fn LLVMDumpValue(V: &Value);
4141
pub(crate) fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
4242
pub(crate) fn LLVMGetReturnType(T: &Type) -> &Type;
43-
pub(crate) fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);
43+
pub(crate) fn LLVMGetParams(Fnc: &Value, params: *mut &Value);
4444
pub(crate) fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>;
4545
}
4646

0 commit comments

Comments
 (0)