Skip to content

Commit 6b1b211

Browse files
committed
more explicit guidance on "union of ptr and int is ptr"
1 parent 7610210 commit 6b1b211

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/core/src/ptr/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@
236236
//!
237237
//! Rust provides two ways of dealing with this situation: *Strict Provenance* and *Exposed Provenance*.
238238
//!
239+
//! Note that a pointer *can* represent a `usize` (via [`without_provenance`]), so the right type to
240+
//! use in situations where a value is "sometimes a pointer and sometimes a bare `usize`" is a
241+
//! pointer type.
242+
//!
239243
//! ## Strict Provenance
240244
//!
241245
//! "Strict Provenance" refers to a set of APIs designed to make working with provenance more

0 commit comments

Comments
 (0)