#![feature(lang_items)]
#![feature(libc)]
#![feature(needs_allocator)]
-#![feature(nonnull_cast)]
#![feature(nonzero)]
#![feature(optin_builtin_traits)]
#![feature(pattern)]
}
/// 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> {
unsafe {
NonNull::new_unchecked(self.as_ptr() as *mut U)
#![feature(macro_reexport)]
#![feature(macro_vis_matcher)]
#![feature(needs_panic_runtime)]
-#![feature(nonnull_cast)]
#![feature(exhaustive_patterns)]
#![feature(nonzero)]
#![feature(num_bits_bytes)]
// Ideally this would be revised to use no_std, but for now it serves
// 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::ptr::{self, NonNull};