Rename std::ptr::Shared to NonNull

`Shared` is now a deprecated `type` alias.

CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
This commit is contained in:
Simon Sapin
2017-12-22 18:58:39 +01:00
parent ba5d7a66e8
commit f19baf0977
13 changed files with 100 additions and 95 deletions

View File

@@ -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")]