diff options
| author | André Vennberg <andre.vennberg@gmail.com> | 2023-01-14 16:33:11 +0100 |
|---|---|---|
| committer | André Vennberg <andre.vennberg@gmail.com> | 2023-01-14 17:22:04 +0100 |
| commit | 0b35f448f8e9f39ed6fc1c494eeb331afba513bc (patch) | |
| tree | c2669a980d1b6d0414ec2fc0c79600f0d1b090cf /library/core/src | |
| parent | 44a500c8c187b245638684748f54bd6ec67e0b25 (diff) | |
| download | rust-0b35f448f8e9f39ed6fc1c494eeb331afba513bc.tar.gz rust-0b35f448f8e9f39ed6fc1c494eeb331afba513bc.zip | |
Remove various double spaces in source comments.
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/array/iter.rs | 6 | ||||
| -rw-r--r-- | library/core/src/iter/range.rs | 2 | ||||
| -rw-r--r-- | library/core/src/num/int_macros.rs | 4 | ||||
| -rw-r--r-- | library/core/src/ptr/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/slice/iter.rs | 4 | ||||
| -rw-r--r-- | library/core/src/slice/iter/macros.rs | 2 | ||||
| -rw-r--r-- | library/core/src/slice/mod.rs | 4 | ||||
| -rw-r--r-- | library/core/src/slice/sort.rs | 6 |
8 files changed, 15 insertions, 15 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index b91c630183d..8259c087d22 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -109,8 +109,8 @@ impl<T, const N: usize> IntoIter<T, N> { /// use std::array::IntoIter; /// use std::mem::MaybeUninit; /// - /// # // Hi! Thanks for reading the code. This is restricted to `Copy` because - /// # // otherwise it could leak. A fully-general version this would need a drop + /// # // Hi! Thanks for reading the code. This is restricted to `Copy` because + /// # // otherwise it could leak. A fully-general version this would need a drop /// # // guard to handle panics from the iterator, but this works for an example. /// fn next_chunk<T: Copy, const N: usize>( /// it: &mut impl Iterator<Item = T>, @@ -211,7 +211,7 @@ impl<T, const N: usize> IntoIter<T, N> { let initialized = 0..0; // SAFETY: We're telling it that none of the elements are initialized, - // which is trivially true. And ∀N: usize, 0 <= N. + // which is trivially true. And ∀N: usize, 0 <= N. unsafe { Self::new_unchecked(buffer, initialized) } } diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index ac7b389b15b..b5739f2f3c0 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -756,7 +756,7 @@ impl<A: Step> Iterator for ops::Range<A> { where Self: TrustedRandomAccessNoCoerce, { - // SAFETY: The TrustedRandomAccess contract requires that callers only pass an index + // SAFETY: The TrustedRandomAccess contract requires that callers only pass an index // that is in bounds. // Additionally Self: TrustedRandomAccess is only implemented for Copy types // which means even repeated reads of the same index would be safe. diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 21518a3f551..7071a656d61 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1538,7 +1538,7 @@ macro_rules! int_impl { /// /// ``` /// #![feature(bigint_helper_methods)] - /// // Only the most significant word is signed. + /// // Only the most significant word is signed. /// // #[doc = concat!("// 10 MAX (a = 10 × 2^", stringify!($BITS), " + 2^", stringify!($BITS), " - 1)")] #[doc = concat!("// + -5 9 (b = -5 × 2^", stringify!($BITS), " + 9)")] @@ -1646,7 +1646,7 @@ macro_rules! int_impl { /// /// ``` /// #![feature(bigint_helper_methods)] - /// // Only the most significant word is signed. + /// // Only the most significant word is signed. /// // #[doc = concat!("// 6 8 (a = 6 × 2^", stringify!($BITS), " + 8)")] #[doc = concat!("// - -5 9 (b = -5 × 2^", stringify!($BITS), " + 9)")] diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 5f30029eaa0..1ad9af1549a 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -1701,7 +1701,7 @@ pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usiz // offset is not a multiple of `stride`, the input pointer was misaligned and no pointer // offset will be able to produce a `p` aligned to the specified `a`. // - // The naive `-p (mod a)` equation inhibits LLVM's ability to select instructions + // The naive `-p (mod a)` equation inhibits LLVM's ability to select instructions // like `lea`. We compute `(round_up_to_next_alignment(p, a) - p)` instead. This // redistributes operations around the load-bearing, but pessimizing `and` instruction // sufficiently for LLVM to be able to utilize the various optimizations it knows about. diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index 06228976719..c3e7f2eb302 100644 --- a/library/core/src/slice/iter.rs +++ b/library/core/src/slice/iter.rs @@ -65,7 +65,7 @@ fn size_from_ptr<T>(_: *const T) -> usize { #[must_use = "iterators are lazy and do nothing unless consumed"] pub struct Iter<'a, T: 'a> { ptr: NonNull<T>, - end: *const T, // If T is a ZST, this is actually ptr+len. This encoding is picked so that + end: *const T, // If T is a ZST, this is actually ptr+len. This encoding is picked so that // ptr == end is a quick test for the Iterator being empty, that works // for both ZST and non-ZST. _marker: PhantomData<&'a T>, @@ -186,7 +186,7 @@ impl<T> AsRef<[T]> for Iter<'_, T> { #[must_use = "iterators are lazy and do nothing unless consumed"] pub struct IterMut<'a, T: 'a> { ptr: NonNull<T>, - end: *mut T, // If T is a ZST, this is actually ptr+len. This encoding is picked so that + end: *mut T, // If T is a ZST, this is actually ptr+len. This encoding is picked so that // ptr == end is a quick test for the Iterator being empty, that works // for both ZST and non-ZST. _marker: PhantomData<&'a mut T>, diff --git a/library/core/src/slice/iter/macros.rs b/library/core/src/slice/iter/macros.rs index ce51d48e3e5..55af4cb61dc 100644 --- a/library/core/src/slice/iter/macros.rs +++ b/library/core/src/slice/iter/macros.rs @@ -23,7 +23,7 @@ macro_rules! len { $self.end.addr().wrapping_sub(start.as_ptr().addr()) } else { // We know that `start <= end`, so can do better than `offset_from`, - // which needs to deal in signed. By setting appropriate flags here + // which needs to deal in signed. By setting appropriate flags here // we can tell LLVM this, which helps it remove bounds checks. // SAFETY: By the type invariant, `start <= end` let diff = unsafe { unchecked_sub($self.end.addr(), start.as_ptr().addr()) }; diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 2995cf0c644..caca2d0031d 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -703,7 +703,7 @@ impl<T> [T] { // Because this function is first compiled in isolation, // this check tells LLVM that the indexing below is - // in-bounds. Then after inlining -- once the actual + // in-bounds. Then after inlining -- once the actual // lengths of the slices are known -- it's removed. let (a, b) = (&mut a[..n], &mut b[..n]); @@ -2476,7 +2476,7 @@ impl<T> [T] { let mid = left + size / 2; // SAFETY: the while condition means `size` is strictly positive, so - // `size/2 < size`. Thus `left + size/2 < left + size`, which + // `size/2 < size`. Thus `left + size/2 < left + size`, which // coupled with the `left + size <= self.len()` invariant means // we have `left + size/2 < self.len()`, and this is in-bounds. let cmp = f(unsafe { self.get_unchecked(mid) }); diff --git a/library/core/src/slice/sort.rs b/library/core/src/slice/sort.rs index b8c0c3fd949..4d2fcd91784 100644 --- a/library/core/src/slice/sort.rs +++ b/library/core/src/slice/sort.rs @@ -18,9 +18,9 @@ struct CopyOnDrop<T> { impl<T> Drop for CopyOnDrop<T> { fn drop(&mut self) { - // SAFETY: This is a helper class. - // Please refer to its usage for correctness. - // Namely, one must be sure that `src` and `dst` does not overlap as required by `ptr::copy_nonoverlapping`. + // SAFETY: This is a helper class. + // Please refer to its usage for correctness. + // Namely, one must be sure that `src` and `dst` does not overlap as required by `ptr::copy_nonoverlapping`. unsafe { ptr::copy_nonoverlapping(self.src, self.dest, 1); } |
