Rollup merge of #130164 - RalfJung:const_ptr_as_ref, r=dtolnay · qinheping/verify-rust-std@7e4cfbc (original) (raw)
`@@ -261,7 +261,7 @@ impl<T: ?Sized> *mut T {
`
261
261
`/// }
`
262
262
```` /// ```
`263`
`263`
`#[stable(feature = "ptr_as_ref", since = "1.9.0")]
`
`264`
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
`264`
`+
#[rustc_const_unstable(feature = "const_ptr_is_null", issue = "74939")]
`
`265`
`265`
`#[inline]
`
`266`
`266`
`pub const unsafe fn as_ref<'a>(self) -> Option<&'a T> {
`
`267`
`267`
`` // SAFETY: the caller must guarantee that `self` is valid for a
``
`@@ -295,7 +295,7 @@ impl<T: ?Sized> *mut T {
`
`295`
`295`
```` /// ```
296
296
`` // FIXME: mention it in the docs for as_ref and as_uninit_ref once stabilized.
``
297
297
`#[unstable(feature = "ptr_as_ref_unchecked", issue = "122034")]
`
298
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
298
`+
#[rustc_const_unstable(feature = "ptr_as_ref_unchecked", issue = "122034")]
`
299
299
`#[inline]
`
300
300
`#[must_use]
`
301
301
`pub const unsafe fn as_ref_unchecked<'a>(self) -> &'a T {
`
`@@ -334,7 +334,7 @@ impl<T: ?Sized> *mut T {
`
334
334
```` /// ```
`335`
`335`
`#[inline]
`
`336`
`336`
`#[unstable(feature = "ptr_as_uninit", issue = "75402")]
`
`337`
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
`337`
`+
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
`
`338`
`338`
`pub const unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>>
`
`339`
`339`
`where
`
`340`
`340`
`T: Sized,
`
`@@ -580,7 +580,7 @@ impl<T: ?Sized> *mut T {
`
`580`
`580`
`/// println!("{s:?}"); // It'll print: "[4, 2, 3]".
`
`581`
`581`
```` /// ```
582
582
`#[stable(feature = "ptr_as_ref", since = "1.9.0")]
`
583
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
583
`+
#[rustc_const_unstable(feature = "const_ptr_is_null", issue = "74939")]
`
584
584
`#[inline]
`
585
585
`pub const unsafe fn as_mut<'a>(self) -> Option<&'a mut T> {
`
586
586
`` // SAFETY: the caller must guarantee that self is be valid for
``
`@@ -616,7 +616,7 @@ impl<T: ?Sized> *mut T {
`
616
616
```` /// ```
````
617
617
`` // FIXME: mention it in the docs for as_mut and as_uninit_mut once stabilized.
``
618
618
`#[unstable(feature = "ptr_as_ref_unchecked", issue = "122034")]
`
619
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
619
`+
#[rustc_const_unstable(feature = "ptr_as_ref_unchecked", issue = "122034")]
`
620
620
`#[inline]
`
621
621
`#[must_use]
`
622
622
`pub const unsafe fn as_mut_unchecked<'a>(self) -> &'a mut T {
`
`@@ -639,7 +639,7 @@ impl<T: ?Sized> *mut T {
`
639
639
`/// the pointer is convertible to a reference.
`
640
640
`#[inline]
`
641
641
`#[unstable(feature = "ptr_as_uninit", issue = "75402")]
`
642
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
642
`+
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
`
643
643
`pub const unsafe fn as_uninit_mut<'a>(self) -> Option<&'a mut MaybeUninit>
`
644
644
`where
`
645
645
`T: Sized,
`
`@@ -2016,7 +2016,7 @@ impl *mut [T] {
`
2016
2016
`/// [allocated object]: crate::ptr#allocated-object
`
2017
2017
`#[inline]
`
2018
2018
`#[unstable(feature = "ptr_as_uninit", issue = "75402")]
`
2019
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
2019
`+
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
`
2020
2020
`pub const unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit]> {
`
2021
2021
`if self.is_null() {
`
2022
2022
`None
`
`@@ -2068,7 +2068,7 @@ impl *mut [T] {
`
2068
2068
`/// [allocated object]: crate::ptr#allocated-object
`
2069
2069
`#[inline]
`
2070
2070
`#[unstable(feature = "ptr_as_uninit", issue = "75402")]
`
2071
``
`-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
`
``
2071
`+
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
`
2072
2072
`pub const unsafe fn as_uninit_slice_mut<'a>(self) -> Option<&'a mut [MaybeUninit]> {
`
2073
2073
`if self.is_null() {
`
2074
2074
`None
`