diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2017-12-22 18:58:39 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-01-20 10:55:16 +0100 |
| commit | f19baf0977b176ba26277af479a19b71b7ee1fdb (patch) | |
| tree | 7c6eb9b86822c1dbca2535ea0b34569e3d65eb7a /src/liballoc/vec.rs | |
| parent | ba5d7a66e847f5713633cb792c379a11b774e21f (diff) | |
| download | rust-f19baf0977b176ba26277af479a19b71b7ee1fdb.tar.gz rust-f19baf0977b176ba26277af479a19b71b7ee1fdb.zip | |
Rename std::ptr::Shared to NonNull
`Shared` is now a deprecated `type` alias. CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 301e44632b8..b14b9d74765 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -78,7 +78,7 @@ use core::num::Float; use core::ops::{InPlace, Index, IndexMut, Place, Placer}; use core::ops; use core::ptr; -use core::ptr::Shared; +use core::ptr::NonNull; use core::slice; use borrow::ToOwned; @@ -1124,7 +1124,7 @@ impl<T> Vec<T> { tail_start: end, tail_len: len - end, iter: range_slice.iter(), - vec: Shared::from(self), + vec: NonNull::from(self), } } } @@ -1745,7 +1745,7 @@ impl<T> IntoIterator for Vec<T> { let cap = self.buf.cap(); mem::forget(self); IntoIter { - buf: Shared::new_unchecked(begin), + buf: NonNull::new_unchecked(begin), phantom: PhantomData, cap, ptr: begin, @@ -2267,7 +2267,7 @@ impl<'a, T> FromIterator<T> for Cow<'a, [T]> where T: Clone { /// [`IntoIterator`]: ../../std/iter/trait.IntoIterator.html #[stable(feature = "rust1", since = "1.0.0")] pub struct IntoIter<T> { - buf: Shared<T>, + buf: NonNull<T>, phantom: PhantomData<T>, cap: usize, ptr: *const T, @@ -2442,7 +2442,7 @@ pub struct Drain<'a, T: 'a> { tail_len: usize, /// Current remaining range to remove iter: slice::Iter<'a, T>, - vec: Shared<Vec<T>>, + vec: NonNull<Vec<T>>, } #[stable(feature = "collection_debug", since = "1.17.0")] |
