Skip to content

Commit a957cef

Browse files
committed
Fix a bunch of typos
1 parent 404c847 commit a957cef

File tree

29 files changed

+55
-55
lines changed

29 files changed

+55
-55
lines changed

library/alloc/tests/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::mem::MaybeUninit;
33
use std::ptr::NonNull;
44

55
#[test]
6-
fn unitialized_zero_size_box() {
6+
fn uninitialized_zero_size_box() {
77
assert_eq!(
88
&*Box::<()>::new_uninit() as *const _,
99
NonNull::<MaybeUninit<()>>::dangling().as_ptr(),

library/alloc/tests/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn test_join_for_different_lengths_with_long_separator() {
162162
}
163163

164164
#[test]
165-
fn test_join_isue_80335() {
165+
fn test_join_issue_80335() {
166166
use core::{borrow::Borrow, cell::Cell};
167167

168168
struct WeirdBorrow {

library/core/src/alloc/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ impl Layout {
157157
///
158158
/// - If `T` is `Sized`, this function is always safe to call.
159159
/// - If the unsized tail of `T` is:
160-
/// - a [slice], then the length of the slice tail must be an intialized
160+
/// - a [slice], then the length of the slice tail must be an initialized
161161
/// integer, and the size of the *entire value*
162162
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
163163
/// - a [trait object], then the vtable part of the pointer must point
164-
/// to a valid vtable for the type `T` acquired by an unsizing coersion,
164+
/// to a valid vtable for the type `T` acquired by an unsizing coercion,
165165
/// and the size of the *entire value*
166166
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
167167
/// - an (unstable) [extern type], then this function is always safe to

library/core/src/cell.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ impl<T: ?Sized> RefCell<T> {
898898
Ok(Ref { value: unsafe { &*self.value.get() }, borrow: b })
899899
}
900900
None => Err(BorrowError {
901-
// If a borrow occured, then we must already have an outstanding borrow,
901+
// If a borrow occurred, then we must already have an outstanding borrow,
902902
// so `borrowed_at` will be `Some`
903903
#[cfg(feature = "debug_refcell")]
904904
location: self.borrowed_at.get().unwrap(),
@@ -983,7 +983,7 @@ impl<T: ?Sized> RefCell<T> {
983983
Ok(RefMut { value: unsafe { &mut *self.value.get() }, borrow: b })
984984
}
985985
None => Err(BorrowMutError {
986-
// If a borrow occured, then we must already have an outstanding borrow,
986+
// If a borrow occurred, then we must already have an outstanding borrow,
987987
// so `borrowed_at` will be `Some`
988988
#[cfg(feature = "debug_refcell")]
989989
location: self.borrowed_at.get().unwrap(),
@@ -1104,7 +1104,7 @@ impl<T: ?Sized> RefCell<T> {
11041104
Ok(unsafe { &*self.value.get() })
11051105
} else {
11061106
Err(BorrowError {
1107-
// If a borrow occured, then we must already have an outstanding borrow,
1107+
// If a borrow occurred, then we must already have an outstanding borrow,
11081108
// so `borrowed_at` will be `Some`
11091109
#[cfg(feature = "debug_refcell")]
11101110
location: self.borrowed_at.get().unwrap(),

library/core/src/iter/adapters/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ impl<A: Debug + TrustedRandomAccessNoCoerce, B: Debug + TrustedRandomAccessNoCoe
517517
/// * It must also be safe to drop `self` after calling `self.__iterator_get_unchecked(idx)`.
518518
/// * If `T` is a subtype of `Self`, then it must be safe to coerce `self` to `T`.
519519
//
520-
// FIXME: Clarify interaction with SourceIter/InPlaceIterable. Calling `SouceIter::as_inner`
520+
// FIXME: Clarify interaction with SourceIter/InPlaceIterable. Calling `SourceIter::as_inner`
521521
// after `__iterator_get_unchecked` is supposed to be allowed.
522522
#[doc(hidden)]
523523
#[unstable(feature = "trusted_random_access", issue = "none")]

library/core/src/iter/range.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ range_exact_iter_impl! {
777777
usize u8 u16
778778
isize i8 i16
779779

780-
// These are incorect per the reasoning above,
780+
// These are incorrect per the reasoning above,
781781
// but removing them would be a breaking change as they were stabilized in Rust 1.0.0.
782782
// So e.g. `(0..66_000_u32).len()` for example will compile without error or warnings
783783
// on 16-bit platforms, but continue to give a wrong result.
@@ -805,7 +805,7 @@ range_incl_exact_iter_impl! {
805805
u8
806806
i8
807807

808-
// These are incorect per the reasoning above,
808+
// These are incorrect per the reasoning above,
809809
// but removing them would be a breaking change as they were stabilized in Rust 1.26.0.
810810
// So e.g. `(0..=u16::MAX).len()` for example will compile without error or warnings
811811
// on 16-bit platforms, but continue to give a wrong result.

library/core/src/num/dec2flt/number.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Number {
4040
&& !self.many_digits
4141
}
4242

43-
/// The fast path algorithmn using machine-sized integers and floats.
43+
/// The fast path algorithm using machine-sized integers and floats.
4444
///
4545
/// This is extracted into a separate function so that it can be attempted before constructing
4646
/// a Decimal. This only works if both the mantissa and the exponent

library/core/src/num/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Shared utilties used by both float and integer formatting.
1+
//! Shared utilities used by both float and integer formatting.
22
#![doc(hidden)]
33
#![unstable(
44
feature = "numfmt",

library/core/src/slice/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a, T> IterMut<'a, T> {
221221
// the length, to also allows for the fast `ptr == end` check.
222222
//
223223
// See the `next_unchecked!` and `is_empty!` macros as well as the
224-
// `post_inc_start` method for more informations.
224+
// `post_inc_start` method for more information.
225225
unsafe {
226226
assume(!ptr.is_null());
227227

library/core/src/slice/rotate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub unsafe fn ptr_rotate<T>(mut left: usize, mut mid: *mut T, mut right: usize)
104104
// - overflows cannot happen for `i` since the function's safety contract ask for
105105
// `mid+right-1 = x+left+right` to be valid for writing
106106
// - underflows cannot happen because `i` must be bigger or equal to `left` for
107-
// a substraction of `left` to happen.
107+
// a subtraction of `left` to happen.
108108
//
109109
// So `x+i` is valid for reading and writing if the caller respected the contract
110110
tmp = unsafe { x.add(i).replace(tmp) };
@@ -202,7 +202,7 @@ pub unsafe fn ptr_rotate<T>(mut left: usize, mut mid: *mut T, mut right: usize)
202202
loop {
203203
// SAFETY:
204204
// `left >= right` so `[mid-right, mid+right)` is valid for reading and writing
205-
// Substracting `right` from `mid` each turn is counterbalanced by the addition and
205+
// Subtracting `right` from `mid` each turn is counterbalanced by the addition and
206206
// check after it.
207207
unsafe {
208208
ptr::swap_nonoverlapping(mid.sub(right), mid, right);
@@ -218,7 +218,7 @@ pub unsafe fn ptr_rotate<T>(mut left: usize, mut mid: *mut T, mut right: usize)
218218
loop {
219219
// SAFETY: `[mid-left, mid+left)` is valid for reading and writing because
220220
// `left < right` so `mid+left < mid+right`.
221-
// Adding `left` to `mid` each turn is counterbalanced by the substraction and check
221+
// Adding `left` to `mid` each turn is counterbalanced by the subtraction and check
222222
// after it.
223223
unsafe {
224224
ptr::swap_nonoverlapping(mid.sub(left), mid, left);

0 commit comments

Comments
 (0)