Skip to content

Commit 6b88007

Browse files
committed
explain unsafe
1 parent bcc55e5 commit 6b88007

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/pin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ impl<P: Deref> Pin<P> {
359359
/// This constructor is unsafe because we cannot guarantee that the data
360360
/// pointed to by `pointer` is pinned, meaning that the data will not be moved or
361361
/// its storage invalidated until it gets dropped. If the constructed `Pin<P>` does
362-
/// not guarantee that the data `P` points to is pinned, constructing a
363-
/// `Pin<P>` is unsafe.
362+
/// not guarantee that the data `P` points to is pinned, that is a violation of
363+
/// the API contract and may lead to undefined behavior in later (safe) operations.
364364
///
365365
/// By using this method, you are making a promise about the `P::Deref` and
366366
/// `P::DerefMut` implementations, if they exist. Most importantly, they

0 commit comments

Comments
 (0)