Skip to content

Commit 4664361

Browse files
committed
Mention ptr::addr_of(_mut) on raw pointers section
1 parent 31c2aa2 commit 4664361

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/types/pointer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ they exist to support interoperability with foreign code, and writing performanc
4444
When comparing raw pointers they are compared by their address, rather than by what they point to.
4545
When comparing raw pointers to [dynamically sized types] they also have their additional data compared.
4646

47+
Raw pointers can be created directly using [`core::ptr::addr_of!`] for `*const` pointers and [`core::ptr::addr_of_mut!`] for `*mut` pointers.
48+
4749
## Smart Pointers
4850

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

53+
[`core::ptr::addr_of!`]: ../../core/ptr/macro.addr_of.html
54+
[`core::ptr::addr_of_mut!`]: ../../core/ptr/macro.addr_of_mut.html
5155
[Interior mutability]: ../interior-mutability.md
5256
[_Lifetime_]: ../trait-bounds.md
5357
[_TypeNoBounds_]: ../types.md#type-expressions

0 commit comments

Comments
 (0)