mirror of
https://github.com/rust-lang/rust
synced 2024-10-17 05:53:41 +00:00
Rollup merge of #108956 - Raekye:master, r=scottmcm
Make ptr::from_ref and ptr::from_mut in #106116 const. As per https://github.com/rust-lang/rust/issues/106116#issuecomment-1462571833
This commit is contained in:
commit
65db3cb794
|
@ -691,7 +691,7 @@ pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T
|
|||
#[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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue