Skip to content

Commit

Permalink
stabilize nonnull_cast feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaun committed Apr 17, 2018
1 parent 4a8f4b7 commit b84baf2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Expand Up @@ -99,7 +99,6 @@
#![feature(lang_items)]
#![feature(libc)]
#![feature(needs_allocator)]
#![feature(nonnull_cast)]
#![feature(nonzero)]
#![feature(optin_builtin_traits)]
#![feature(pattern)]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ptr.rs
Expand Up @@ -2742,7 +2742,7 @@ impl<T: ?Sized> NonNull<T> {
}

/// 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)
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Expand Up @@ -275,7 +275,6 @@
#![feature(macro_reexport)]
#![feature(macro_vis_matcher)]
#![feature(needs_panic_runtime)]
#![feature(nonnull_cast)]
#![feature(exhaustive_patterns)]
#![feature(nonzero)]
#![feature(num_bits_bytes)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/realloc-16687.rs
Expand Up @@ -13,7 +13,7 @@
// 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};
Expand Down

0 comments on commit b84baf2

Please sign in to comment.