Skip to content

Commit d5f2ce5

Browse files
authored
Rollup merge of rust-lang#88230 - steffahn:a_an, r=oli-obk
Fix typos “a”→“an” Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an. While automation was used to find these, every change was checked manually. Changes in submodules get separate PRs: * rust-lang/stdarch#1201 * rust-lang/cargo#9821 * rust-lang/miri#1874 * rust-lang/rls#1746 * rust-lang/rust-analyzer#9984 _folks @ rust-analyzer are fast at merging…_ * rust-lang/rust-analyzer#9985 * rust-lang/rust-analyzer#9987 * rust-lang/rust-analyzer#9989 _For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._ <hr> This has some overlap with rust-lang#88226, but neither is a strict superset of the other. If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.
2 parents 5540458 + 1730343 commit d5f2ce5

File tree

25 files changed

+39
-39
lines changed

25 files changed

+39
-39
lines changed

alloc/src/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ pub mod __alloc_error_handler {
387387
panic!("memory allocation of {} bytes failed", size)
388388
}
389389

390-
// if there is a `#[alloc_error_handler]`
390+
// if there is an `#[alloc_error_handler]`
391391
#[rustc_std_internal_symbol]
392392
pub unsafe extern "C" fn __rg_oom(size: usize, align: usize) -> ! {
393393
let layout = unsafe { Layout::from_size_align_unchecked(size, align) };

alloc/src/collections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
//! }
4747
//! }
4848
//!
49-
//! // Each node is represented as an `usize`, for a shorter implementation.
49+
//! // Each node is represented as a `usize`, for a shorter implementation.
5050
//! struct Edge {
5151
//! node: usize,
5252
//! cost: usize,

core/src/array/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<T, const N: usize> IntoIter<T, N> {
4545
/// use std::array;
4646
///
4747
/// for value in array::IntoIter::new([1, 2, 3, 4, 5]) {
48-
/// // The type of `value` is a `i32` here, instead of `&i32`
48+
/// // The type of `value` is an `i32` here, instead of `&i32`
4949
/// let _: i32 = value;
5050
/// }
5151
/// ```

core/src/char/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ impl char {
958958
/// Returns an iterator that yields the uppercase mapping of this `char` as one or more
959959
/// `char`s.
960960
///
961-
/// If this `char` does not have a uppercase mapping, the iterator yields the same `char`.
961+
/// If this `char` does not have an uppercase mapping, the iterator yields the same `char`.
962962
///
963963
/// If this `char` has a one-to-one uppercase mapping given by the [Unicode Character
964964
/// Database][ucd] [`UnicodeData.txt`], the iterator yields that `char`.

core/src/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ extern "rust-intrinsic" {
10131013
/// let val_casts = unsafe { &mut *(ptr as *mut i32 as *mut u32) };
10141014
/// ```
10151015
///
1016-
/// Turning an `&str` into an `&[u8]`:
1016+
/// Turning an `&str` into a `&[u8]`:
10171017
///
10181018
/// ```
10191019
/// // this is not a good way to do this.

core/src/iter/adapters/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ where
563563
}
564564

565565
unsafe trait SpecTrustedRandomAccess: Iterator {
566-
/// If `Self: TrustedRandomAccess`, it must be safe to call a
566+
/// If `Self: TrustedRandomAccess`, it must be safe to call
567567
/// `Iterator::__iterator_get_unchecked(self, index)`.
568568
unsafe fn try_get_unchecked(&mut self, index: usize) -> Self::Item;
569569
}

core/src/iter/traits/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<I: FusedIterator + ?Sized> FusedIterator for &mut I {}
2525
/// (lower bound is equal to upper bound), or the upper bound is [`None`].
2626
/// The upper bound must only be [`None`] if the actual iterator length is
2727
/// larger than [`usize::MAX`]. In that case, the lower bound must be
28-
/// [`usize::MAX`], resulting in a [`Iterator::size_hint()`] of
28+
/// [`usize::MAX`], resulting in an [`Iterator::size_hint()`] of
2929
/// `(usize::MAX, None)`.
3030
///
3131
/// The iterator must produce exactly the number of elements it reported

core/src/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ pub unsafe fn zeroed<T>() -> T {
660660
#[rustc_diagnostic_item = "mem_uninitialized"]
661661
#[track_caller]
662662
pub unsafe fn uninitialized<T>() -> T {
663-
// SAFETY: the caller must guarantee that an unitialized value is valid for `T`.
663+
// SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
664664
unsafe {
665665
intrinsics::assert_uninit_valid::<T>();
666666
MaybeUninit::uninit().assume_init()

core/src/num/dec2flt/lemire.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::num::dec2flt::table::{
99
/// Compute a float using an extended-precision representation.
1010
///
1111
/// Fast conversion of a the significant digits and decimal exponent
12-
/// a float to a extended representation with a binary float. This
12+
/// a float to an extended representation with a binary float. This
1313
/// algorithm will accurately parse the vast majority of cases,
1414
/// and uses a 128-bit representation (with a fallback 192-bit
1515
/// representation).

core/src/ptr/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
767767
///
768768
/// # Examples
769769
///
770-
/// Read an usize value from a byte buffer:
770+
/// Read a usize value from a byte buffer:
771771
///
772772
/// ```
773773
/// use std::mem;
@@ -960,7 +960,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
960960
///
961961
/// # Examples
962962
///
963-
/// Write an usize value to a byte buffer:
963+
/// Write a usize value to a byte buffer:
964964
///
965965
/// ```
966966
/// use std::mem;
@@ -1232,7 +1232,7 @@ pub(crate) unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
12321232
let smoda = stride & a_minus_one;
12331233
// SAFETY: a is power-of-two hence non-zero. stride == 0 case is handled above.
12341234
let gcdpow = unsafe { intrinsics::cttz_nonzero(stride).min(intrinsics::cttz_nonzero(a)) };
1235-
// SAFETY: gcdpow has an upper-bound that’s at most the number of bits in an usize.
1235+
// SAFETY: gcdpow has an upper-bound that’s at most the number of bits in a usize.
12361236
let gcd = unsafe { unchecked_shl(1usize, gcdpow) };
12371237

12381238
// SAFETY: gcd is always greater or equal to 1.

0 commit comments

Comments
 (0)