@@ -246,6 +246,13 @@ impl<T: ?Sized> *mut T {
246
246
/// When calling this method, you have to ensure that *either* the pointer is null *or*
247
247
/// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion).
248
248
///
249
+ /// # Panics during const evaluation
250
+ ///
251
+ /// This method will panic during const evaluation if the pointer cannot be
252
+ /// determined to be null or not. See [`is_null`] for more information.
253
+ ///
254
+ /// [`is_null`]: #method.is_null-1
255
+ ///
249
256
/// # Examples
250
257
///
251
258
/// ```
@@ -330,6 +337,13 @@ impl<T: ?Sized> *mut T {
330
337
/// Note that because the created reference is to `MaybeUninit<T>`, the
331
338
/// source pointer can point to uninitialized memory.
332
339
///
340
+ /// # Panics during const evaluation
341
+ ///
342
+ /// This method will panic during const evaluation if the pointer cannot be
343
+ /// determined to be null or not. See [`is_null`] for more information.
344
+ ///
345
+ /// [`is_null`]: #method.is_null-1
346
+ ///
333
347
/// # Examples
334
348
///
335
349
/// ```
@@ -593,6 +607,12 @@ impl<T: ?Sized> *mut T {
593
607
/// the pointer is null *or*
594
608
/// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion).
595
609
///
610
+ /// # Panics during const evaluation
611
+ ///
612
+ /// This method will panic during const evaluation if the pointer cannot be
613
+ /// determined to be null or not. See [`is_null`] for more information.
614
+ ///
615
+ /// [`is_null`]: #method.is_null-1
596
616
///
597
617
/// # Examples
598
618
///
@@ -676,6 +696,13 @@ impl<T: ?Sized> *mut T {
676
696
///
677
697
/// When calling this method, you have to ensure that *either* the pointer is null *or*
678
698
/// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion).
699
+ ///
700
+ /// # Panics during const evaluation
701
+ ///
702
+ /// This method will panic during const evaluation if the pointer cannot be
703
+ /// determined to be null or not. See [`is_null`] for more information.
704
+ ///
705
+ /// [`is_null`]: #method.is_null-1
679
706
#[ inline]
680
707
#[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
681
708
pub const unsafe fn as_uninit_mut < ' a > ( self ) -> Option < & ' a mut MaybeUninit < T > >
@@ -1952,6 +1979,13 @@ impl<T> *mut [T] {
1952
1979
///
1953
1980
/// [valid]: crate::ptr#safety
1954
1981
/// [allocated object]: crate::ptr#allocated-object
1982
+ ///
1983
+ /// # Panics during const evaluation
1984
+ ///
1985
+ /// This method will panic during const evaluation if the pointer cannot be
1986
+ /// determined to be null or not. See [`is_null`] for more information.
1987
+ ///
1988
+ /// [`is_null`]: #method.is_null-1
1955
1989
#[ inline]
1956
1990
#[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
1957
1991
pub const unsafe fn as_uninit_slice < ' a > ( self ) -> Option < & ' a [ MaybeUninit < T > ] > {
@@ -2003,6 +2037,13 @@ impl<T> *mut [T] {
2003
2037
///
2004
2038
/// [valid]: crate::ptr#safety
2005
2039
/// [allocated object]: crate::ptr#allocated-object
2040
+ ///
2041
+ /// # Panics during const evaluation
2042
+ ///
2043
+ /// This method will panic during const evaluation if the pointer cannot be
2044
+ /// determined to be null or not. See [`is_null`] for more information.
2045
+ ///
2046
+ /// [`is_null`]: #method.is_null-1
2006
2047
#[ inline]
2007
2048
#[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
2008
2049
pub const unsafe fn as_uninit_slice_mut < ' a > ( self ) -> Option < & ' a mut [ MaybeUninit < T > ] > {
0 commit comments