Skip to content

Commit

Permalink
Rollup merge of rust-lang#108956 - Raekye:master, r=scottmcm
Browse files Browse the repository at this point in the history
Make ptr::from_ref and ptr::from_mut in rust-lang#106116 const.

As per rust-lang#106116 (comment)
  • Loading branch information
matthiaskrgr committed Mar 10, 2023
2 parents e0c8ba1 + e8fbf62 commit 65db3cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit 65db3cb

Please sign in to comment.