from_ref, from_mut: clarify domain of quantification · model-checking/verify-rust-std@7953644 (original) (raw)

`@@ -777,8 +777,8 @@ where

`

777

777

``

778

778

`/// Convert a reference to a raw pointer.

`

779

779

`///

`

780

``

`` -

/// This is equivalent to r as *const T, but is a bit safer since it will never silently change

``

781

``

`-

/// type or mutability, in particular if the code is refactored.

`

``

780

`` +

/// For r: &T, from_ref(r) is equivalent to r as *const T, but is a bit safer since it will

``

``

781

`+

/// never silently change type or mutability, in particular if the code is refactored.

`

782

782

`#[inline(always)]

`

783

783

`#[must_use]

`

784

784

`#[stable(feature = "ptr_from_ref", since = "1.76.0")]

`

`@@ -791,8 +791,8 @@ pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {

`

791

791

``

792

792

`/// Convert a mutable reference to a raw pointer.

`

793

793

`///

`

794

``

`` -

/// This is equivalent to r as *mut T, but is a bit safer since it will never silently change

``

795

``

`-

/// type or mutability, in particular if the code is refactored.

`

``

794

`` +

/// For r: &mut T, from_mut(r) is equivalent to r as *mut T, but is a bit safer since it will

``

``

795

`+

/// never silently change type or mutability, in particular if the code is refactored.

`

796

796

`#[inline(always)]

`

797

797

`#[must_use]

`

798

798

`#[stable(feature = "ptr_from_ref", since = "1.76.0")]

`