Skip to content

Commit

Permalink
Mention ptr::addr_of(_mut) on raw pointers section
Browse files Browse the repository at this point in the history
  • Loading branch information
Havvy committed Mar 26, 2021
1 parent 31c2aa2 commit 4664361
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/types/pointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ they exist to support interoperability with foreign code, and writing performanc
When comparing raw pointers they are compared by their address, rather than by what they point to.
When comparing raw pointers to [dynamically sized types] they also have their additional data compared.

Raw pointers can be created directly using [`core::ptr::addr_of!`] for `*const` pointers and [`core::ptr::addr_of_mut!`] for `*mut` pointers.

## Smart Pointers

The standard library contains additional 'smart pointer' types beyond references and raw pointers.

[`core::ptr::addr_of!`]: ../../core/ptr/macro.addr_of.html
[`core::ptr::addr_of_mut!`]: ../../core/ptr/macro.addr_of_mut.html
[Interior mutability]: ../interior-mutability.md
[_Lifetime_]: ../trait-bounds.md
[_TypeNoBounds_]: ../types.md#type-expressions
Expand Down

0 comments on commit 4664361

Please sign in to comment.