Skip to content

Commit e8fbf62

Browse files
committed
Make ptr::from_ref and ptr::from_mut in rust-lang#106116 const.
1 parent 39f2657 commit e8fbf62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ where
691691
#[inline(always)]
692692
#[must_use]
693693
#[unstable(feature = "ptr_from_ref", issue = "106116")]
694-
pub fn from_ref<T: ?Sized>(r: &T) -> *const T {
694+
pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
695695
r
696696
}
697697

@@ -702,7 +702,7 @@ pub fn from_ref<T: ?Sized>(r: &T) -> *const T {
702702
#[inline(always)]
703703
#[must_use]
704704
#[unstable(feature = "ptr_from_ref", issue = "106116")]
705-
pub fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
705+
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
706706
r
707707
}
708708

0 commit comments

Comments
 (0)