1
Fork 0

stabilize nonnull_cast feature

This commit is contained in:
tinaun 2018-04-17 00:59:16 -04:00
parent 4a8f4b7e49
commit b84baf2378
4 changed files with 2 additions and 4 deletions

View file

@ -99,7 +99,6 @@
#![feature(lang_items)] #![feature(lang_items)]
#![feature(libc)] #![feature(libc)]
#![feature(needs_allocator)] #![feature(needs_allocator)]
#![feature(nonnull_cast)]
#![feature(nonzero)] #![feature(nonzero)]
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
#![feature(pattern)] #![feature(pattern)]

View file

@ -2742,7 +2742,7 @@ impl<T: ?Sized> NonNull<T> {
} }
/// Cast to a pointer of another type /// Cast to a pointer of another type
#[unstable(feature = "nonnull_cast", issue = "47653")] #[stable(feature = "nonnull_cast", since = "1.27.0")]
pub fn cast<U>(self) -> NonNull<U> { pub fn cast<U>(self) -> NonNull<U> {
unsafe { unsafe {
NonNull::new_unchecked(self.as_ptr() as *mut U) NonNull::new_unchecked(self.as_ptr() as *mut U)

View file

@ -275,7 +275,6 @@
#![feature(macro_reexport)] #![feature(macro_reexport)]
#![feature(macro_vis_matcher)] #![feature(macro_vis_matcher)]
#![feature(needs_panic_runtime)] #![feature(needs_panic_runtime)]
#![feature(nonnull_cast)]
#![feature(exhaustive_patterns)] #![feature(exhaustive_patterns)]
#![feature(nonzero)] #![feature(nonzero)]
#![feature(num_bits_bytes)] #![feature(num_bits_bytes)]

View file

@ -13,7 +13,7 @@
// Ideally this would be revised to use no_std, but for now it serves // Ideally this would be revised to use no_std, but for now it serves
// well enough to reproduce (and illustrate) the bug from #16687. // well enough to reproduce (and illustrate) the bug from #16687.
#![feature(heap_api, allocator_api, nonnull_cast)] #![feature(heap_api, allocator_api)]
use std::alloc::{Global, Alloc, Layout}; use std::alloc::{Global, Alloc, Layout};
use std::ptr::{self, NonNull}; use std::ptr::{self, NonNull};