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

@@ -16,7 +16,7 @@ use marker;
use mem::{align_of, size_of, needs_drop};
use mem;
use ops::{Deref, DerefMut};
use ptr::{self, Unique, Shared};
use ptr::{self, Unique, NonNull};
use self::BucketState::*;
@@ -873,7 +873,7 @@ impl<K, V> RawTable<K, V> {
elems_left,
marker: marker::PhantomData,
},
table: Shared::from(self),
table: NonNull::from(self),
marker: marker::PhantomData,
}
}
@@ -1020,7 +1020,7 @@ impl<K, V> IntoIter<K, V> {
/// Iterator over the entries in a table, clearing the table.
pub struct Drain<'a, K: 'a, V: 'a> {
table: Shared<RawTable<K, V>>,
table: NonNull<RawTable<K, V>>,
iter: RawBuckets<'static, K, V>,
marker: marker::PhantomData<&'a RawTable<K, V>>,
}

View File

@@ -283,6 +283,7 @@
#![feature(macro_vis_matcher)]
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![feature(nonnull)]
#![feature(num_bits_bytes)]
#![feature(old_wrapping)]
#![feature(on_unimplemented)]
@@ -297,7 +298,6 @@
#![feature(raw)]
#![feature(repr_align)]
#![feature(rustc_attrs)]
#![feature(shared)]
#![feature(sip_hash_13)]
#![feature(slice_bytes)]
#![feature(slice_concat_ext)]

View File

@@ -17,7 +17,7 @@ use cell::UnsafeCell;
use fmt;
use ops::{Deref, DerefMut};
use panicking;
use ptr::{Unique, Shared};
use ptr::{Unique, NonNull};
use rc::Rc;
use sync::{Arc, Mutex, RwLock, atomic};
use thread::Result;
@@ -198,8 +198,8 @@ impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *const T {}
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *mut T {}
#[unstable(feature = "unique", issue = "27730")]
impl<T: UnwindSafe + ?Sized> UnwindSafe for Unique<T> {}
#[unstable(feature = "shared", issue = "27730")]
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Shared<T> {}
#[unstable(feature = "nonnull", issue = "27730")]
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for NonNull<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: ?Sized> UnwindSafe for Mutex<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]