Constify *const T::read[_unaligned] and *mut T::read[_unaligned]
This commit is contained in:
parent
7594d2a084
commit
d4fd7987b5
@ -725,8 +725,9 @@ impl<T: ?Sized> *const T {
|
||||
///
|
||||
/// [`ptr::read`]: crate::ptr::read()
|
||||
#[stable(feature = "pointer_methods", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_ptr_read", issue = "none")]
|
||||
#[inline]
|
||||
pub unsafe fn read(self) -> T
|
||||
pub const unsafe fn read(self) -> T
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
@ -763,8 +764,9 @@ impl<T: ?Sized> *const T {
|
||||
///
|
||||
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
|
||||
#[stable(feature = "pointer_methods", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_ptr_read", issue = "none")]
|
||||
#[inline]
|
||||
pub unsafe fn read_unaligned(self) -> T
|
||||
pub const unsafe fn read_unaligned(self) -> T
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
|
@ -832,8 +832,9 @@ impl<T: ?Sized> *mut T {
|
||||
///
|
||||
/// [`ptr::read`]: crate::ptr::read()
|
||||
#[stable(feature = "pointer_methods", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_ptr_read", issue = "none")]
|
||||
#[inline]
|
||||
pub unsafe fn read(self) -> T
|
||||
pub const unsafe fn read(self) -> T
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
@ -870,8 +871,9 @@ impl<T: ?Sized> *mut T {
|
||||
///
|
||||
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
|
||||
#[stable(feature = "pointer_methods", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_ptr_read", issue = "none")]
|
||||
#[inline]
|
||||
pub unsafe fn read_unaligned(self) -> T
|
||||
pub const unsafe fn read_unaligned(self) -> T
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user