diff options
| author | japm48 <japm48gh@gmail.com> | 2021-12-12 00:23:06 +0100 |
|---|---|---|
| committer | japm48 <japm48gh@gmail.com> | 2021-12-12 00:27:27 +0100 |
| commit | 0d7b830139a0d32bb835091fd702b2e256b1411b (patch) | |
| tree | 98eccd14d0e8406f4fe41d2439164eef782c23b5 /library/alloc/src | |
| parent | 928783de663bd855a96f14b2d38c1061603587c6 (diff) | |
| download | rust-0d7b830139a0d32bb835091fd702b2e256b1411b.tar.gz rust-0d7b830139a0d32bb835091fd702b2e256b1411b.zip | |
doc: fix typo in comments
dereferencable -> dereferenceable
Diffstat (limited to 'library/alloc/src')
| -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) } |
