about summary refs log tree commit diff
path: root/library/core/src/slice
diff options
context:
space:
mode:
authorgavincrawford <94875769+gavincrawford@users.noreply.github.com>2024-11-05 10:05:56 -0700
committergavincrawford <94875769+gavincrawford@users.noreply.github.com>2024-11-11 13:36:42 -0700
commitfdef65bf6e36fcecd3df71d3a630c306f7acc784 (patch)
treee1d674f187537353440adb70eefa78e05dbef3a7 /library/core/src/slice
parent37c30aeb45d33b14dadb6c06c3f71b8e047bd2fe (diff)
downloadrust-fdef65bf6e36fcecd3df71d3a630c306f7acc784.tar.gz
rust-fdef65bf6e36fcecd3df71d3a630c306f7acc784.zip
Tag relevant functions with #[rustc_as_ptr] attribute
Diffstat (limited to 'library/core/src/slice')
-rw-r--r--library/core/src/slice/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 27e51afa800..5ab05a9f641 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -735,6 +735,7 @@ impl<T> [T] {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_stable(feature = "const_slice_as_ptr", since = "1.32.0")]
     #[rustc_never_returns_null_ptr]
+    #[cfg_attr(not(bootstrap), rustc_as_ptr)]
     #[inline(always)]
     #[must_use]
     pub const fn as_ptr(&self) -> *const T {
@@ -766,6 +767,7 @@ impl<T> [T] {
     #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
     #[rustc_allow_const_fn_unstable(const_mut_refs)]
     #[rustc_never_returns_null_ptr]
+    #[cfg_attr(not(bootstrap), rustc_as_ptr)]
     #[inline(always)]
     #[must_use]
     pub const fn as_mut_ptr(&mut self) -> *mut T {