Fix missing const for inherent pointer replace methods
This commit is contained in:
parent
8c61cd4df8
commit
7bca1f2675
2 changed files with 4 additions and 2 deletions
|
|
@ -1577,8 +1577,9 @@ impl<T: ?Sized> *mut T {
|
|||
///
|
||||
/// [`ptr::replace`]: crate::ptr::replace()
|
||||
#[stable(feature = "pointer_methods", since = "1.26.0")]
|
||||
#[rustc_const_stable(feature = "const_inherent_ptr_replace", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline(always)]
|
||||
pub unsafe fn replace(self, src: T) -> T
|
||||
pub const unsafe fn replace(self, src: T) -> T
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1169,7 +1169,8 @@ impl<T: ?Sized> NonNull<T> {
|
|||
/// [`ptr::replace`]: crate::ptr::replace()
|
||||
#[inline(always)]
|
||||
#[stable(feature = "non_null_convenience", since = "1.80.0")]
|
||||
pub unsafe fn replace(self, src: T) -> T
|
||||
#[rustc_const_stable(feature = "const_inherent_ptr_replace", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const unsafe fn replace(self, src: T) -> T
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue