stabilize nonnull_cast feature
This commit is contained in:
@@ -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)]
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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)]
|
||||||
|
|||||||
@@ -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};
|
||||||
|
|||||||
Reference in New Issue
Block a user