Skip to content

Commit

Permalink
Rollup merge of #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 #106116 const.

As per rust-lang/rust#106116 (comment)
  • Loading branch information
matthiaskrgr committed Mar 10, 2023
2 parents 73e0833 + 71f8ba3 commit 548a9eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 548a9eb

Please sign in to comment.