Skip to content

Commit 65db3cb

Browse files
authored
Rollup merge of rust-lang#108956 - Raekye:master, r=scottmcm
Make ptr::from_ref and ptr::from_mut in rust-lang#106116 const. As per rust-lang#106116 (comment)
2 parents e0c8ba1 + e8fbf62 commit 65db3cb

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)