From b1430fb7ca499d517d9f4b3b6c5a81442129c88b Mon Sep 17 00:00:00 2001 From: Dezhi Wu Date: Thu, 18 Aug 2022 10:13:37 +0800 Subject: Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos --- compiler/rustc_codegen_cranelift/src/abi/mod.rs | 2 +- compiler/rustc_codegen_cranelift/src/constant.rs | 2 +- compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_codegen_cranelift/src') diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs index 815450f689e..0497c2570e6 100644 --- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs @@ -342,7 +342,7 @@ pub(crate) fn codegen_terminator_call<'tcx>( let ret_place = codegen_place(fx, destination); - // Handle special calls like instrinsics and empty drop glue. + // Handle special calls like intrinsics and empty drop glue. let instance = if let ty::FnDef(def_id, substs) = *fn_ty.kind() { let instance = ty::Instance::resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, substs) .unwrap() diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs index cb5d73a7e0b..9224f499339 100644 --- a/compiler/rustc_codegen_cranelift/src/constant.rs +++ b/compiler/rustc_codegen_cranelift/src/constant.rs @@ -59,7 +59,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool { ErrorHandled::TooGeneric => { span_bug!( constant.span, - "codgen encountered polymorphic constant: {:?}", + "codegen encountered polymorphic constant: {:?}", err ); } diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 95239f415a9..4aeb1e3aab9 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -203,7 +203,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>( sym::transmute => { crate::base::codegen_panic(fx, "Transmuting to uninhabited type.", source_info); } - _ => unimplemented!("unsupported instrinsic {}", intrinsic), + _ => unimplemented!("unsupported intrinsics {}", intrinsic), } return; }; -- cgit 1.4.1-3-g733a5 From 17706937710756ccc9504caf121f09326446523b Mon Sep 17 00:00:00 2001 From: Dezhi Wu Date: Thu, 18 Aug 2022 16:36:49 +0800 Subject: Correct typo --- RELEASES.md | 2 +- compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs | 2 +- library/core/src/slice/mod.rs | 2 +- library/std/src/sys/windows/cmath.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_codegen_cranelift/src') diff --git a/RELEASES.md b/RELEASES.md index 5de30039417..72b2c16a01f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1442,7 +1442,7 @@ Compatibility Notes - [Mixing Option and Result via `?` is no longer permitted in closures for inferred types.][86831] - [Previously unsound code is no longer permitted where different constructors in branches could require different lifetimes.][85574] -- As previously mentioned the [`std::arch` intrinsic now uses stricter const checking][83278] +- As previously mentioned the [`std::arch` intrinsics now uses stricter const checking][83278] than before and may reject some previously accepted code. - [`i128` multiplication on Cortex M0+ platforms currently unconditionally causes overflow when compiled with `codegen-units = 1`.][86063] diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 4aeb1e3aab9..39e9e784a47 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -203,7 +203,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>( sym::transmute => { crate::base::codegen_panic(fx, "Transmuting to uninhabited type.", source_info); } - _ => unimplemented!("unsupported intrinsics {}", intrinsic), + _ => unimplemented!("unsupported intrinsic {}", intrinsic), } return; }; diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 3bd296f37ca..1958745b586 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -2321,7 +2321,7 @@ impl [T] { } /// Binary searches this slice for a given element. - /// This behaves similar to [`contains`] if this slice is sorted. + /// This behaves similarly to [`contains`] if this slice is sorted. /// /// If the value is found then [`Result::Ok`] is returned, containing the /// index of the matching element. If there are multiple matches, then any diff --git a/library/std/src/sys/windows/cmath.rs b/library/std/src/sys/windows/cmath.rs index 74bb552527f..43ab8c7ee65 100644 --- a/library/std/src/sys/windows/cmath.rs +++ b/library/std/src/sys/windows/cmath.rs @@ -44,7 +44,7 @@ mod shims { } // On 32-bit x86 MSVC these functions aren't defined, so we just define shims -// which promote everything for f64, perform the calculation, and then demote +// which promote everything to f64, perform the calculation, and then demote // back to f32. While not precisely correct should be "correct enough" for now. #[cfg(all(target_env = "msvc", target_arch = "x86"))] mod shims { -- cgit 1.4.1-3-g733a5