Skip to content

Commit e83a0a4

Browse files
committed
Stabilize #![feature(non_null_from_ref)]
1 parent 7188f45 commit e83a0a4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
#![feature(is_ascii_octdigit)]
112112
#![feature(lazy_get)]
113113
#![feature(link_cfg)]
114-
#![feature(non_null_from_ref)]
115114
#![feature(offset_of_enum)]
116115
#![feature(panic_internals)]
117116
#![feature(ptr_alignment_type)]

library/core/src/ptr/non_null.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,17 @@ impl<T: ?Sized> NonNull<T> {
262262
}
263263

264264
/// Converts a reference to a `NonNull` pointer.
265-
#[unstable(feature = "non_null_from_ref", issue = "130823")]
265+
#[stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
266+
#[rustc_const_stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
266267
#[inline]
267268
pub const fn from_ref(r: &T) -> Self {
268269
// SAFETY: A reference cannot be null.
269270
unsafe { NonNull { pointer: r as *const T } }
270271
}
271272

272273
/// Converts a mutable reference to a `NonNull` pointer.
273-
#[unstable(feature = "non_null_from_ref", issue = "130823")]
274+
#[stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
275+
#[rustc_const_stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
274276
#[inline]
275277
pub const fn from_mut(r: &mut T) -> Self {
276278
// SAFETY: A mutable reference cannot be null.

0 commit comments

Comments
 (0)