Make ptr::from_ref and ptr::from_mut in #106116 const.
This commit is contained in:
parent
39f2657d11
commit
e8fbf6205e
1 changed files with 2 additions and 2 deletions
|
@ -691,7 +691,7 @@ where
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[unstable(feature = "ptr_from_ref", issue = "106116")]
|
#[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
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ pub fn from_ref<T: ?Sized>(r: &T) -> *const T {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[unstable(feature = "ptr_from_ref", issue = "106116")]
|
#[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
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue