@@ -29,16 +29,18 @@ impl<T: ?Sized> *const T {
2929/// assert!(!ptr.is_null());
3030/// ```
3131#[ 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 " ) ]
3333#[ rustc_diagnostic_item = "ptr_const_is_null" ]
3434#[ inline]
35+ #[ rustc_allow_const_fn_unstable( const_eval_select) ]
3536pub const fn is_null ( self ) -> bool {
3637// Compare via a cast to a thin pointer, so fat pointers are only
3738// considering their "data" part for null-ness.
3839let ptr = self as * const u8 ;
3940const_eval_select ! (
4041 @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) ] {
4244match ( ptr) . guaranteed_eq( null_mut( ) ) {
4345Some ( res) => res,
4446// To remain maximally convervative, we stop execution when we don't
@@ -280,7 +282,7 @@ impl<T: ?Sized> *const T {
280282/// }
281283/// ```
282284#[ 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 " ) ]
284286#[ inline]
285287pub const unsafe fn as_ref < ' a > ( self ) -> Option < & ' a T > {
286288// SAFETY: the caller must guarantee that `self` is valid
0 commit comments