soft-deprecate the addr_of macros
This commit is contained in:
parent
79503dd742
commit
b8464961a2
1 changed files with 6 additions and 0 deletions
|
@ -2209,6 +2209,9 @@ impl<F: FnPtr> fmt::Debug for F {
|
|||
|
||||
/// 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
|
||||
/// 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
|
||||
|
@ -2283,6 +2286,9 @@ pub macro addr_of($place:expr) {
|
|||
|
||||
/// 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
|
||||
/// 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
|
||||
|
|
Loading…
Add table
Reference in a new issue