soft-deprecate the addr_of macros
This commit is contained in:
parent
79503dd742
commit
b8464961a2
@ -2209,6 +2209,9 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|||||||
|
|
||||||
/// Creates a `const` raw pointer to a place, without creating an intermediate reference.
|
/// Creates a `const` raw pointer to a place, without creating an intermediate reference.
|
||||||
///
|
///
|
||||||
|
/// `addr_of!(expr)` is equivalent to `&raw const expr`. The macro is *soft-deprecated*;
|
||||||
|
/// use `&raw const` instead.
|
||||||
|
///
|
||||||
/// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned
|
/// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned
|
||||||
/// and points to initialized data. For cases where those requirements do not hold,
|
/// and points to initialized data. For cases where those requirements do not hold,
|
||||||
/// raw pointers should be used instead. However, `&expr as *const _` creates a reference
|
/// raw pointers should be used instead. However, `&expr as *const _` creates a reference
|
||||||
@ -2283,6 +2286,9 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|||||||
|
|
||||||
/// Creates a `mut` raw pointer to a place, without creating an intermediate reference.
|
/// Creates a `mut` raw pointer to a place, without creating an intermediate reference.
|
||||||
///
|
///
|
||||||
|
/// `addr_of_mut!(expr)` is equivalent to `&raw mut expr`. The macro is *soft-deprecated*;
|
||||||
|
/// use `&raw mut` instead.
|
||||||
|
///
|
||||||
/// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned
|
/// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned
|
||||||
/// and points to initialized data. For cases where those requirements do not hold,
|
/// and points to initialized data. For cases where those requirements do not hold,
|
||||||
/// raw pointers should be used instead. However, `&mut expr as *mut _` creates a reference
|
/// raw pointers should be used instead. However, `&mut expr as *mut _` creates a reference
|
||||||
|
Loading…
Reference in New Issue
Block a user