about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRaekye <Raekye@users.noreply.github.com>2023-03-09 16:36:20 -0500
committerRaekye <Raekye@users.noreply.github.com>2023-03-09 16:36:20 -0500
commite8fbf6205e99172254a0b130819abc9e6711f2bc (patch)
treec7d3f25d2e2d4eba2f916e4231154f3342ea39c8
parent39f2657d1101b50f9b71ae460b762d330cc8426b (diff)
Make ptr::from_ref and ptr::from_mut in #106116 const.
-rw-r--r--library/core/src/ptr/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 1ad9af1549a..f41be46abc9 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -691,7 +691,7 @@ where
 #[inline(always)]
 #[must_use]
 #[unstable(feature = "ptr_from_ref", issue = "106116")]
-pub fn from_ref<T: ?Sized>(r: &T) -> *const T {
+pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
     r
 }
 
@@ -702,7 +702,7 @@ pub fn from_ref<T: ?Sized>(r: &T) -> *const T {
 #[inline(always)]
 #[must_use]
 #[unstable(feature = "ptr_from_ref", issue = "106116")]
-pub fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
+pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
     r
 }