diff options
| author | Ralf Jung <post@ralfj.de> | 2019-02-21 15:33:55 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-02-21 15:33:55 +0100 |
| commit | 6b880074734e1916f6347d46de28fa44b1f1bae2 (patch) | |
| tree | 5e3ebc62df36407b571cd1eb3f9fac5c896d34ba | |
| parent | bcc55e5e79585baba752b5016a905dbb3d1b1ef8 (diff) | |
| download | rust-6b880074734e1916f6347d46de28fa44b1f1bae2.tar.gz rust-6b880074734e1916f6347d46de28fa44b1f1bae2.zip | |
explain unsafe
| -rw-r--r-- | src/libcore/pin.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index d4446faed7b..697c352550f 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -359,8 +359,8 @@ impl<P: Deref> Pin<P> { /// This constructor is unsafe because we cannot guarantee that the data /// pointed to by `pointer` is pinned, meaning that the data will not be moved or /// its storage invalidated until it gets dropped. If the constructed `Pin<P>` does - /// not guarantee that the data `P` points to is pinned, constructing a - /// `Pin<P>` is unsafe. + /// not guarantee that the data `P` points to is pinned, that is a violation of + /// the API contract and may lead to undefined behavior in later (safe) operations. /// /// By using this method, you are making a promise about the `P::Deref` and /// `P::DerefMut` implementations, if they exist. Most importantly, they |
