diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-12 07:45:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-12 07:45:30 +0100 |
| commit | 955e552d31d7a79adc90dc47e4b58fb8b3fb5249 (patch) | |
| tree | 820cb6a9adc4235effdab4b081016d3319d75ed9 /library/alloc | |
| parent | be20570a07067e0c5fad37581f1287835cffda65 (diff) | |
| parent | 0d7b830139a0d32bb835091fd702b2e256b1411b (diff) | |
| download | rust-955e552d31d7a79adc90dc47e4b58fb8b3fb5249.tar.gz rust-955e552d31d7a79adc90dc47e4b58fb8b3fb5249.zip | |
Rollup merge of #91814 - japm48:spelling-fix, r=RalfJung
doc: fix typo in comments `dereferencable -> dereferenceable` Fixes #91802.
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/collections/vec_deque/iter_mut.rs | 8 | ||||
| -rw-r--r-- | library/alloc/src/collections/vec_deque/mod.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/rc.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/library/alloc/src/collections/vec_deque/iter_mut.rs b/library/alloc/src/collections/vec_deque/iter_mut.rs index 31e6e3b06af..ee2df0d5160 100644 --- a/library/alloc/src/collections/vec_deque/iter_mut.rs +++ b/library/alloc/src/collections/vec_deque/iter_mut.rs @@ -12,7 +12,7 @@ use super::{count, wrap_index, RingSlices}; /// [`iter_mut`]: super::VecDeque::iter_mut #[stable(feature = "rust1", since = "1.0.0")] pub struct IterMut<'a, T: 'a> { - // Internal safety invariant: the entire slice is dereferencable. + // Internal safety invariant: the entire slice is dereferenceable. ring: *mut [T], tail: usize, head: usize, @@ -42,7 +42,7 @@ impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let (front, back) = RingSlices::ring_slices(self.ring, self.head, self.tail); // SAFETY: these are the elements we have not handed out yet, so aliasing is fine. - // The `IterMut` invariant also ensures everything is dereferencable. + // The `IterMut` invariant also ensures everything is dereferenceable. let (front, back) = unsafe { (&*front, &*back) }; f.debug_tuple("IterMut").field(&front).field(&back).finish() } @@ -78,7 +78,7 @@ impl<'a, T> Iterator for IterMut<'a, T> { { let (front, back) = RingSlices::ring_slices(self.ring, self.head, self.tail); // SAFETY: these are the elements we have not handed out yet, so aliasing is fine. - // The `IterMut` invariant also ensures everything is dereferencable. + // The `IterMut` invariant also ensures everything is dereferenceable. let (front, back) = unsafe { (&mut *front, &mut *back) }; accum = front.iter_mut().fold(accum, &mut f); back.iter_mut().fold(accum, &mut f) @@ -132,7 +132,7 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> { { let (front, back) = RingSlices::ring_slices(self.ring, self.head, self.tail); // SAFETY: these are the elements we have not handed out yet, so aliasing is fine. - // The `IterMut` invariant also ensures everything is dereferencable. + // The `IterMut` invariant also ensures everything is dereferenceable. let (front, back) = unsafe { (&mut *front, &mut *back) }; accum = back.iter_mut().rfold(accum, &mut f); front.iter_mut().rfold(accum, &mut f) diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs index 702d97858eb..075becfb7d1 100644 --- a/library/alloc/src/collections/vec_deque/mod.rs +++ b/library/alloc/src/collections/vec_deque/mod.rs @@ -1020,7 +1020,7 @@ impl<T, A: Allocator> VecDeque<T, A> { #[stable(feature = "rust1", since = "1.0.0")] pub fn iter_mut(&mut self) -> IterMut<'_, T> { // SAFETY: The internal `IterMut` safety invariant is established because the - // `ring` we create is a dereferencable slice for lifetime '_. + // `ring` we create is a dereferenceable slice for lifetime '_. let ring = ptr::slice_from_raw_parts_mut(self.ptr(), self.cap()); unsafe { IterMut::new(ring, self.tail, self.head, PhantomData) } @@ -1209,7 +1209,7 @@ impl<T, A: Allocator> VecDeque<T, A> { let (tail, head) = self.range_tail_head(range); // SAFETY: The internal `IterMut` safety invariant is established because the - // `ring` we create is a dereferencable slice for lifetime '_. + // `ring` we create is a dereferenceable slice for lifetime '_. let ring = ptr::slice_from_raw_parts_mut(self.ptr(), self.cap()); unsafe { IterMut::new(ring, tail, head, PhantomData) } diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index c4e5e44fec0..33bee4324fd 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -2121,7 +2121,7 @@ impl<T: ?Sized> Weak<T> { // a valid payload address, as the payload is at least as aligned as RcBox (usize). ptr as *const T } else { - // SAFETY: if is_dangling returns false, then the pointer is dereferencable. + // SAFETY: if is_dangling returns false, then the pointer is dereferenceable. // The payload may be dropped at this point, and we have to maintain provenance, // so use raw pointer manipulation. unsafe { ptr::addr_of_mut!((*ptr).value) } diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 733a898b285..7c065f37d1f 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1743,7 +1743,7 @@ impl<T: ?Sized> Weak<T> { // a valid payload address, as the payload is at least as aligned as ArcInner (usize). ptr as *const T } else { - // SAFETY: if is_dangling returns false, then the pointer is dereferencable. + // SAFETY: if is_dangling returns false, then the pointer is dereferenceable. // The payload may be dropped at this point, and we have to maintain provenance, // so use raw pointer manipulation. unsafe { ptr::addr_of_mut!((*ptr).data) } |
