From 90a007c73412c6444e7379688e609e29efd618d8 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Wed, 21 May 2025 14:33:56 -0400 Subject: [PATCH 1/2] Add spell checking job in the CI --- .github/workflows/ci.yml | 6 ++++++ _typos.toml | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 _typos.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef024258ffc..14a594cbb5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,12 @@ jobs: - uses: actions/checkout@v4 - run: python tools/check_intrinsics_duplicates.py + spell_check: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@v1.32.0 + build_system: runs-on: ubuntu-24.04 steps: diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000000..4a6a506a981 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,9 @@ +[default.extend-words] +ba = "ba" +hsa = "hsa" +olt = "olt" +seh = "seh" +typ = "typ" + +[files] +extend-exclude = ["src/intrinsic/archs.rs"] From c430b87539d49720346f2652ebf87fa7396776c5 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Wed, 21 May 2025 14:38:19 -0400 Subject: [PATCH 2/2] Fix typos --- example/std_example.rs | 24 ++++++++++++------------ src/attributes.rs | 4 ++-- src/type_of.rs | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/example/std_example.rs b/example/std_example.rs index 5fa1e0afb06..7587b4827ca 100644 --- a/example/std_example.rs +++ b/example/std_example.rs @@ -77,18 +77,18 @@ fn main() { assert_eq!(tmp as i128, -0x1234_5678_9ABC_DEF0i128); // Check that all u/i128 <-> float casts work correctly. - let houndred_u128 = 100u128; - let houndred_i128 = 100i128; - let houndred_f32 = 100.0f32; - let houndred_f64 = 100.0f64; - assert_eq!(houndred_u128 as f32, 100.0); - assert_eq!(houndred_u128 as f64, 100.0); - assert_eq!(houndred_f32 as u128, 100); - assert_eq!(houndred_f64 as u128, 100); - assert_eq!(houndred_i128 as f32, 100.0); - assert_eq!(houndred_i128 as f64, 100.0); - assert_eq!(houndred_f32 as i128, 100); - assert_eq!(houndred_f64 as i128, 100); + let hundred_u128 = 100u128; + let hundred_i128 = 100i128; + let hundred_f32 = 100.0f32; + let hundred_f64 = 100.0f64; + assert_eq!(hundred_u128 as f32, 100.0); + assert_eq!(hundred_u128 as f64, 100.0); + assert_eq!(hundred_f32 as u128, 100); + assert_eq!(hundred_f64 as u128, 100); + assert_eq!(hundred_i128 as f32, 100.0); + assert_eq!(hundred_i128 as f64, 100.0); + assert_eq!(hundred_f32 as i128, 100); + assert_eq!(hundred_f64 as i128, 100); let _a = 1u32 << 2u8; diff --git a/src/attributes.rs b/src/attributes.rs index e63091c6082..8779bb47ef0 100644 --- a/src/attributes.rs +++ b/src/attributes.rs @@ -16,7 +16,7 @@ use crate::gcc_util::to_gcc_features; /// Checks if the function `instance` is recursively inline. /// Returns `false` if a functions is guaranteed to be non-recursive, and `true` if it *might* be recursive. #[cfg(feature = "master")] -fn resursively_inline<'gcc, 'tcx>( +fn recursively_inline<'gcc, 'tcx>( cx: &CodegenCx<'gcc, 'tcx>, instance: ty::Instance<'tcx>, ) -> bool { @@ -61,7 +61,7 @@ fn inline_attr<'gcc, 'tcx>( // // That prevents issues steming from recursive `#[inline(always)]` at a *relatively* small cost. // We *only* need to check all the terminators of a function marked with this attribute. - if resursively_inline(cx, instance) { + if recursively_inline(cx, instance) { Some(FnAttribute::Inline) } else { Some(FnAttribute::AlwaysInline) diff --git a/src/type_of.rs b/src/type_of.rs index 5745acce6fe..093f902bc3d 100644 --- a/src/type_of.rs +++ b/src/type_of.rs @@ -217,7 +217,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> { let ty = match *self.ty.kind() { // NOTE: we cannot remove this match like in the LLVM codegen because the call // to fn_ptr_backend_type handle the on-stack attribute. - // TODO(antoyo): find a less hackish way to hande the on-stack attribute. + // TODO(antoyo): find a less hackish way to handle the on-stack attribute. ty::FnPtr(sig_tys, hdr) => cx .fn_ptr_backend_type(cx.fn_abi_of_fn_ptr(sig_tys.with(hdr), ty::List::empty())), _ => self.scalar_gcc_type_at(cx, scalar, Size::ZERO),