diff options
| author | bors <bors@rust-lang.org> | 2018-01-20 12:28:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-01-20 12:28:13 +0000 |
| commit | bdda8d61151a91fcc95b059918dd834c8e7ac09e (patch) | |
| tree | 392c16311de525e9573a63486a6e7d32469b6fb1 /src/libstd/panic.rs | |
| parent | 816d765716f25b0008049d89a0e41f0a48d03c78 (diff) | |
| parent | 602a445b92b37ec6af4d3d7f331e1a0d1360b8d2 (diff) | |
| download | rust-bdda8d61151a91fcc95b059918dd834c8e7ac09e.tar.gz rust-bdda8d61151a91fcc95b059918dd834c8e7ac09e.zip | |
Auto merge of #46952 - SimonSapin:nonnull, r=alexcrichton
Rename std::ptr::Shared to NonNull and stabilize it This implements the changes proposed at https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629: > * Rename `Shared<T>` to `NonNull<T>` and stabilize it. (Being in the `ptr` module is enough to say that it’s a pointer. I’m not very attached to this specific name though.) > * Rename `Box<T>` methods ~~`from_unique`~~/`into_unique` to ~~`from_nonnull`~~/`into_nonnull` (or whatever names are deemed appropriate), replace `Unique<T>` with `NonNull<T>` in their signatures, and stabilize them. > * Replace `Unique<T>` with `NonNull<T>` in the signatures of methods of the `Alloc` trait. > * Mark `Unique` “permanently-unstable” by replacing remaining occurrences of `#[unstable(feature = "unique", issue = "27730")]` with: > > ```rust > #[unstable(feature = "ptr_internals", issue = "0", reason = "\ > use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), \ > Send, and/or Sync")] > ``` > > (Maybe the `reason` string is only useful on the struct definition.) Ideally it would be made private to some crate instead, but it needs to be used in both liballoc and libstd. > * (Leave `NonZero` and `Zeroable` unstable for now, and subject to future bikeshedding.)
Diffstat (limited to 'src/libstd/panic.rs')
| -rw-r--r-- | src/libstd/panic.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs index 53c2211745c..560876006d3 100644 --- a/src/libstd/panic.rs +++ b/src/libstd/panic.rs @@ -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; @@ -196,10 +196,10 @@ impl<'a, T: RefUnwindSafe + ?Sized> UnwindSafe for &'a T {} impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *const T {} #[stable(feature = "catch_unwind", since = "1.9.0")] impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *mut T {} -#[unstable(feature = "unique", issue = "27730")] +#[unstable(feature = "ptr_internals", issue = "0")] impl<T: UnwindSafe + ?Sized> UnwindSafe for Unique<T> {} -#[unstable(feature = "shared", issue = "27730")] -impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Shared<T> {} +#[stable(feature = "nonnull", since = "1.24.0")] +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")] |
