@@ -29,16 +29,18 @@ impl<T: ?Sized> *const T {
29
29
/// assert!(!ptr.is_null());
30
30
/// ```
31
31
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
32
- #[ rustc_const_unstable ( feature = "const_ptr_is_null" , issue = "74939 " ) ]
32
+ #[ rustc_const_stable ( feature = "const_ptr_is_null" , since = "CURRENT_RUSTC_VERSION " ) ]
33
33
#[ rustc_diagnostic_item = "ptr_const_is_null" ]
34
34
#[ inline]
35
+ #[ rustc_allow_const_fn_unstable( const_eval_select) ]
35
36
pub const fn is_null ( self ) -> bool {
36
37
// Compare via a cast to a thin pointer, so fat pointers are only
37
38
// considering their "data" part for null-ness.
38
39
let ptr = self as * const u8 ;
39
40
const_eval_select ! (
40
41
@capture { ptr: * const u8 } -> bool :
41
- if const #[ rustc_const_unstable( feature = "const_ptr_is_null" , issue = "74939" ) ] {
42
+ // This use of `const_raw_ptr_comparison` has been explicitly blessed by t-lang.
43
+ if const #[ rustc_allow_const_fn_unstable( const_raw_ptr_comparison) ] {
42
44
match ( ptr) . guaranteed_eq( null_mut( ) ) {
43
45
Some ( res) => res,
44
46
// To remain maximally convervative, we stop execution when we don't
@@ -280,7 +282,7 @@ impl<T: ?Sized> *const T {
280
282
/// }
281
283
/// ```
282
284
#[ stable( feature = "ptr_as_ref" , since = "1.9.0" ) ]
283
- #[ rustc_const_unstable ( feature = "const_ptr_is_null" , issue = "74939 " ) ]
285
+ #[ rustc_const_stable ( feature = "const_ptr_is_null" , since = "CURRENT_RUSTC_VERSION " ) ]
284
286
#[ inline]
285
287
pub const unsafe fn as_ref < ' a > ( self ) -> Option < & ' a T > {
286
288
// SAFETY: the caller must guarantee that `self` is valid
0 commit comments