Skip to content

Commit 9750e17

Browse files
committed
check ./library too
1 parent 53cfc30 commit 9750e17

File tree

28 files changed

+50
-42
lines changed

28 files changed

+50
-42
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
if: ${{ env.CI_JOB_NAME == 'mingw-check-tidy' }}
109109
uses: crate-ci/[email protected]
110110
with:
111-
files: ./compiler
111+
files: ./compiler ./library
112112
config: ./typos.toml
113113

114114
# Free up disk space on Linux by removing preinstalled components that

Diff for: library/alloc/src/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
//! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
110110
//! parameters affect the string representation of what's being formatted.
111111
//!
112-
//! The colon `:` in format syntax divides indentifier of the input data and
112+
//! The colon `:` in format syntax divides identifier of the input data and
113113
//! the formatting options, the colon itself does not change anything, only
114114
//! introduces the options.
115115
//!

Diff for: library/alloc/src/raw_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl<A: Allocator> RawVecInner<A> {
420420
match Self::try_allocate_in(capacity, AllocInit::Uninitialized, alloc, elem_layout) {
421421
Ok(this) => {
422422
unsafe {
423-
// Make it more obvious that a subsquent Vec::reserve(capacity) will not allocate.
423+
// Make it more obvious that a subsequent Vec::reserve(capacity) will not allocate.
424424
hint::assert_unchecked(!this.needs_to_grow(0, capacity, elem_layout));
425425
}
426426
this

Diff for: library/alloc/tests/sort/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn check_is_sorted<T: Ord + Clone + Debug, S: Sort>(v: &mut [T]) {
3333
known_good_stable_sort::sort(known_good_sorted_vec.as_mut_slice());
3434

3535
if is_small_test {
36-
eprintln!("Orginal: {:?}", v_orig);
36+
eprintln!("Original: {:?}", v_orig);
3737
eprintln!("Expected: {:?}", known_good_sorted_vec);
3838
eprintln!("Got: {:?}", v);
3939
} else {

Diff for: library/core/benches/num/int_pow/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ macro_rules! pow_bench_template {
2525
let mut exp_iter = black_box(&exp_array).into_iter();
2626

2727
(0..ITERATIONS).fold((0 as IntType, false), |acc, _| {
28-
// Sometimes constants don't propogate all the way to the
28+
// Sometimes constants don't propagate all the way to the
2929
// inside of the loop, so we call a custom expression every cycle
3030
// rather than iter::repeat(CONST)
3131
let base: IntType = $base_macro!(base_iter);

Diff for: library/core/src/future/async_drop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl<T> Future for AsyncDropOwning<T> {
4141
let dtor = Pin::new_unchecked(
4242
this.dtor.get_or_insert_with(|| async_drop_in_place(this.value.as_mut_ptr())),
4343
);
44-
// AsyncDestuctors are idempotent so Self gets idempotency as well
44+
// AsyncDestructors are idempotent so Self gets idempotency as well
4545
dtor.poll(cx)
4646
}
4747
}
@@ -246,7 +246,7 @@ async unsafe fn either<O: IntoFuture<Output = ()>, M: IntoFuture<Output = ()>, T
246246
this: *mut T,
247247
discr: <T as DiscriminantKind>::Discriminant,
248248
) {
249-
// SAFETY: Guaranteed by the safety section of this funtion's documentation
249+
// SAFETY: Guaranteed by the safety section of this function's documentation
250250
if unsafe { discriminant_value(&*this) } == discr {
251251
drop(other);
252252
matched.await

Diff for: library/core/src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3780,7 +3780,7 @@ where
37803780
/// used inside the `if const`.
37813781
/// Note that the two arms of this `if` really each become their own function, which is why the
37823782
/// macro supports setting attributes for those functions. The runtime function is always
3783-
/// markes as `#[inline]`.
3783+
/// marked as `#[inline]`.
37843784
///
37853785
/// See [`const_eval_select()`] for the rules and requirements around that intrinsic.
37863786
pub(crate) macro const_eval_select {

Diff for: library/core/src/intrinsics/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extern "rust-intrinsic" {
8585
#[rustc_nounwind]
8686
pub fn simd_shr<T>(lhs: T, rhs: T) -> T;
8787

88-
/// "Ands" vectors elementwise.
88+
/// "And"s vectors elementwise.
8989
///
9090
/// `T` must be a vector of integer primitive types.
9191
#[rustc_nounwind]
@@ -419,7 +419,7 @@ extern "rust-intrinsic" {
419419
#[rustc_nounwind]
420420
pub fn simd_reduce_min<T, U>(x: T) -> U;
421421

422-
/// Logical "ands" all elements together.
422+
/// Logical "and"s all elements together.
423423
///
424424
/// `T` must be a vector of integer or floating-point primitive types.
425425
///

Diff for: library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
#![warn(multiple_supertrait_upcastable)]
102102
#![allow(internal_features)]
103103
#![deny(ffi_unwind_calls)]
104-
// Do not check link redundancy on bootstraping phase
104+
// Do not check link redundancy on bootstrapping phase
105105
#![allow(rustdoc::redundant_explicit_links)]
106106
#![warn(rustdoc::unescaped_backticks)]
107107
//

Diff for: library/core/src/macros/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ pub(crate) mod builtin {
15491549
/// NAME is a string that represents a valid function name.
15501550
/// MODE is any of Forward, Reverse, ForwardFirst, ReverseFirst.
15511551
/// INPUT_ACTIVITIES consists of one valid activity for each input parameter.
1552-
/// OUTPUT_ACTIVITY must not be set if we implicitely return nothing (or explicitely return
1552+
/// OUTPUT_ACTIVITY must not be set if we implicitly return nothing (or explicitly return
15531553
/// `-> ()`). Otherwise it must be set to one of the allowed activities.
15541554
#[unstable(feature = "autodiff", issue = "124509")]
15551555
#[allow_internal_unstable(rustc_attrs)]

Diff for: library/core/src/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@
792792
//!
793793
//! 1. *Structural [`Unpin`].* A struct can be [`Unpin`] only if all of its
794794
//! structurally-pinned fields are, too. This is [`Unpin`]'s behavior by default.
795-
//! However, as a libray author, it is your responsibility not to write something like
795+
//! However, as a library author, it is your responsibility not to write something like
796796
//! <code>impl\<T> [Unpin] for Struct\<T> {}</code> and then offer a method that provides
797797
//! structural pinning to an inner field of `T`, which may not be [`Unpin`]! (Adding *any*
798798
//! projection operation requires unsafe code, so the fact that [`Unpin`] is a safe trait does

Diff for: library/core/src/primitive_docs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1628,8 +1628,8 @@ mod prim_ref {}
16281628
/// let ptr: fn(usize) -> usize = add_one;
16291629
/// assert_eq!(ptr(5), 6);
16301630
///
1631-
/// let clos: fn(usize) -> usize = |x| x + 5;
1632-
/// assert_eq!(clos(5), 10);
1631+
/// let closure: fn(usize) -> usize = |x| x + 5;
1632+
/// assert_eq!(closure(5), 10);
16331633
/// ```
16341634
///
16351635
/// In addition to varying based on their signature, function pointers come in two flavors: safe

Diff for: library/core/src/ptr/const_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<T: ?Sized> *const T {
4343
if const #[rustc_allow_const_fn_unstable(const_raw_ptr_comparison)] {
4444
match (ptr).guaranteed_eq(null_mut()) {
4545
Some(res) => res,
46-
// To remain maximally convervative, we stop execution when we don't
46+
// To remain maximally conservative, we stop execution when we don't
4747
// know whether the pointer is null or not.
4848
// We can *not* return `false` here, that would be unsound in `NonNull::new`!
4949
None => panic!("null-ness of this pointer cannot be determined in const context"),

Diff for: library/core/src/ptr/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
// ^ we use this term instead of saying that the produced reference must
8585
// be valid, as the validity of a reference is easily confused for the
8686
// validity of the thing it refers to, and while the two concepts are
87-
// closly related, they are not identical.
87+
// closely related, they are not identical.
8888
//!
8989
//! These rules apply even if the result is unused!
9090
//! (The part about being initialized is not yet fully decided, but until

Diff for: library/core/src/str/lossy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ impl [u8] {
88
/// Creates an iterator over the contiguous valid UTF-8 ranges of this
99
/// slice, and the non-UTF-8 fragments in between.
1010
///
11-
/// See the [`Utf8Chunk`] type for documenation of the items yielded by this iterator.
11+
/// See the [`Utf8Chunk`] type for documentation of the items yielded by this iterator.
1212
///
1313
/// # Examples
1414
///
@@ -150,7 +150,7 @@ impl fmt::Debug for Debug<'_> {
150150
/// If you want a simple conversion from UTF-8 byte slices to string slices,
151151
/// [`from_utf8`] is easier to use.
152152
///
153-
/// See the [`Utf8Chunk`] type for documenation of the items yielded by this iterator.
153+
/// See the [`Utf8Chunk`] type for documentation of the items yielded by this iterator.
154154
///
155155
/// [byteslice]: slice
156156
/// [`from_utf8`]: super::from_utf8

Diff for: library/core/tests/iter/adapters/take.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fn test_reverse_on_zip() {
255255

256256
let zipped_iter = vec_1.iter().zip(core::iter::repeat(0).take(20));
257257

258-
// Cannot call rev here for automatic reversed zip constuction
258+
// Cannot call rev here for automatic reversed zip construction
259259
for (&one, zero) in zipped_iter.rev() {
260260
assert_eq!((1, 0), (one, zero));
261261
}

Diff for: library/panic_unwind/src/seh.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor {
264264
// runtime under a try/catch block and the panic that we generate here will be
265265
// used as the result of the exception copy. This is used by the C++ runtime to
266266
// support capturing exceptions with std::exception_ptr, which we can't support
267-
// because Box<dyn Any> isn't clonable.
267+
// because Box<dyn Any> isn't cloneable.
268268
macro_rules! define_cleanup {
269269
($abi:tt $abi2:tt) => {
270270
unsafe extern $abi fn exception_cleanup(e: *mut Exception) {

Diff for: library/std/src/sys/pal/uefi/helpers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl<T> OwnedProtocol<T> {
305305
let protocol: *mut T = Box::into_raw(Box::new(protocol));
306306
let mut handle: r_efi::efi::Handle = crate::ptr::null_mut();
307307

308-
// FIXME: Move into r-efi once extended_varargs_abi_support is stablized
308+
// FIXME: Move into r-efi once extended_varargs_abi_support is stabilized
309309
let func: BootInstallMultipleProtocolInterfaces =
310310
unsafe { crate::mem::transmute((*bt.as_ptr()).install_multiple_protocol_interfaces) };
311311

@@ -339,7 +339,7 @@ impl<T> Drop for OwnedProtocol<T> {
339339
// Do not deallocate a runtime protocol
340340
if let Some(bt) = boot_services() {
341341
let bt: NonNull<r_efi::efi::BootServices> = bt.cast();
342-
// FIXME: Move into r-efi once extended_varargs_abi_support is stablized
342+
// FIXME: Move into r-efi once extended_varargs_abi_support is stabilized
343343
let func: BootUninstallMultipleProtocolInterfaces = unsafe {
344344
crate::mem::transmute((*bt.as_ptr()).uninstall_multiple_protocol_interfaces)
345345
};

Diff for: library/std/src/sys/pal/uefi/os.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ mod uefi_env {
314314

315315
let mut start = 0;
316316

317-
// UEFI Shell returns all keys seperated by NULL.
317+
// UEFI Shell returns all keys separated by NULL.
318318
// End of string is denoted by two NULLs
319319
for i in 0.. {
320320
if unsafe { *val.add(i) } == 0 {

Diff for: library/std/src/sys/pal/unix/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ impl Instant {
261261
// https://www.manpagez.com/man/3/clock_gettime/
262262
//
263263
// CLOCK_UPTIME_RAW clock that increments monotonically, in the same man-
264-
// ner as CLOCK_MONOTONIC_RAW, but that does not incre-
265-
// ment while the system is asleep. The returned value
264+
// ner as CLOCK_MONOTONIC_RAW, but that does not increment
265+
// while the system is asleep. The returned value
266266
// is identical to the result of mach_absolute_time()
267267
// after the appropriate mach_timebase conversion is
268268
// applied.

Diff for: library/std/src/sys/pal/wasip2/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl Socket {
141141
0 => {}
142142
_ => {
143143
// WASI poll does not return POLLHUP or POLLERR in revents. Check if the
144-
// connnection actually succeeded and return ok only when the socket is
144+
// connection actually succeeded and return ok only when the socket is
145145
// ready and no errors were found.
146146
if let Some(e) = self.take_error()? {
147147
return Err(e);

Diff for: library/std/src/sys/random/linux.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! bytes, while the non-blocking pool, once initialized using the blocking
1616
//! pool, uses a CPRNG to return an unlimited number of random bytes. With a
1717
//! strong enough CPRNG however, the entropy estimation didn't contribute that
18-
//! much towards security while being an excellent vector for DoS attacs. Thus,
18+
//! much towards security while being an excellent vector for DoS attacks. Thus,
1919
//! the blocking pool was removed in kernel version 5.6.[^2] That patch did not
2020
//! magically increase the quality of the non-blocking pool, however, so we can
2121
//! safely consider it strong enough even in older kernel versions and use it
@@ -30,7 +30,7 @@
3030
//! data the system has available at the time.
3131
//!
3232
//! So in conclusion, we always want the output of the non-blocking pool, but
33-
//! may need to wait until it is initalized. The default behavior of `getrandom`
33+
//! may need to wait until it is initialized. The default behavior of `getrandom`
3434
//! is to wait until the non-blocking pool is initialized and then draw from there,
3535
//! so if `getrandom` is available, we use its default to generate the bytes. For
3636
//! `HashMap`, however, we need to specify the `GRND_INSECURE` flags, but that

Diff for: library/std/src/sys/random/unsupported.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn fill_bytes(_: &mut [u8]) {
66

77
pub fn hashmap_random_keys() -> (u64, u64) {
88
// Use allocation addresses for a bit of randomness. This isn't
9-
// particularily secure, but there isn't really an alternative.
9+
// particularly secure, but there isn't really an alternative.
1010
let stack = 0u8;
1111
let heap = Box::new(0u8);
1212
let k1 = ptr::from_ref(&stack).addr() as u64;

Diff for: library/std/src/sys/thread_local/guard/key.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn enable() {
3232

3333
/// On platforms with key-based TLS, the system runs the destructors for us.
3434
/// We still have to make sure that [`crate::rt::thread_cleanup`] is called,
35-
/// however. This is done by defering the execution of a TLS destructor to
35+
/// however. This is done by deferring the execution of a TLS destructor to
3636
/// the next round of destruction inside the TLS destructors.
3737
#[cfg(not(target_thread_local))]
3838
pub fn enable() {
@@ -46,7 +46,7 @@ pub fn enable() {
4646
unsafe extern "C" fn run(state: *mut u8) {
4747
if state == DEFER {
4848
// Make sure that this function is run again in the next round of
49-
// TLS destruction. If there is no futher round, there will be leaks,
49+
// TLS destruction. If there is no further round, there will be leaks,
5050
// but that's okay, `thread_cleanup` is not guaranteed to be called.
5151
unsafe { set(CLEANUP.force(), RUN) }
5252
} else {

Diff for: library/std/src/sys_common/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ pub trait FromInner<Inner> {
6868
fn from_inner(inner: Inner) -> Self;
6969
}
7070

71-
// Computes (value*numer)/denom without overflow, as long as both
72-
// (numer*denom) and the overall result fit into i64 (which is the case
71+
// Computes (value*numerator)/denom without overflow, as long as both
72+
// (numerator*denom) and the overall result fit into i64 (which is the case
7373
// for our time conversions).
7474
#[allow(dead_code)] // not used on all platforms
75-
pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 {
75+
pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 {
7676
let q = value / denom;
7777
let r = value % denom;
7878
// Decompose value as (value/denom*denom + value%denom),
79-
// substitute into (value*numer)/denom and simplify.
80-
// r < denom, so (denom*numer) is the upper bound of (r*numer)
81-
q * numer + r * numer / denom
79+
// substitute into (value*numerator)/denom and simplify.
80+
// r < denom, so (denom*numerator) is the upper bound of (r*numerator)
81+
q * numerator + r * numerator / denom
8282
}
8383

8484
pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {

Diff for: library/std/src/thread/current.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub(crate) fn set_current(thread: Thread) -> Result<(), Thread> {
136136
/// one thread and is guaranteed not to call the global allocator.
137137
#[inline]
138138
pub(crate) fn current_id() -> ThreadId {
139-
// If accessing the persistant thread ID takes multiple TLS accesses, try
139+
// If accessing the persistent thread ID takes multiple TLS accesses, try
140140
// to retrieve it from the current thread handle, which will only take one
141141
// TLS access.
142142
if !id::CHEAP {

Diff for: library/std/src/thread/spawnhook.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::thread::Thread;
66
crate::thread_local! {
77
/// A thread local linked list of spawn hooks.
88
///
9-
/// It is a linked list of Arcs, such that it can very cheaply be inhereted by spawned threads.
9+
/// It is a linked list of Arcs, such that it can very cheaply be inherited by spawned threads.
1010
///
1111
/// (That technically makes it a set of linked lists with shared tails, so a linked tree.)
1212
static SPAWN_HOOKS: Cell<SpawnHooks> = const { Cell::new(SpawnHooks { first: None }) };

Diff for: typos.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ extend-exclude = [
44
"compiler/rustc_codegen_gcc",
55
"compiler/rustc_codegen_cranelift",
66
"compiler/rustc_baked_icu_data",
7+
"library/backtrace",
8+
"library/stdarch",
9+
# generated lorem ipsum texts
10+
"library/alloc/benches/str.rs",
11+
"library/alloc/tests/str.rs",
712
]
813

914
[default.extend-words]
@@ -47,8 +52,11 @@ extend-ignore-words-re = [
4752
]
4853

4954
extend-ignore-re = [
50-
# ignore this intensional typo examples from lints
55+
# ignore this intensional typo examples
5156
"/// 1 \\| #\\[cfg\\(widnows\\)\\]",
5257
"/// warning: unexpected `cfg` condition name: `widnows`",
5358
"/// #\\[cfg\\(widnows\\)\\]",
54-
]
59+
"\\.arg\\(\"Oh no, a tpyo!\"\\)",
60+
# string used in benches
61+
"\"core::iter::adapters::Copie\"",
62+
]

0 commit comments

Comments
 (0)