about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2019-12-05 10:28:11 +0100
committerKonrad Borowski <konrad@borowski.pw>2019-12-05 13:44:03 +0100
commitdfcf764d093445d1c5eedbc7ef1f72c7fa5dcac8 (patch)
treee103a2ab8878706c84387895e32b18e51d83621c
parent1cf0db19d45ca9fb4a3a10999dc116c37e06adf8 (diff)
downloadrust-dfcf764d093445d1c5eedbc7ef1f72c7fa5dcac8.tar.gz
rust-dfcf764d093445d1c5eedbc7ef1f72c7fa5dcac8.zip
Document why Pin implementations aren't derived
-rw-r--r--src/libcore/pin.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs
index f4e0e647434..015a75ba3dc 100644
--- a/src/libcore/pin.rs
+++ b/src/libcore/pin.rs
@@ -403,6 +403,12 @@ pub struct Pin<P> {
     pointer: P,
 }
 
+// The following implementations aren't derived in order to avoid soundness
+// issues. `&self.pointer` should not be accessible to untrusted trait
+// implementations.
+//
+// See <https://internals.rust-lang.org/t/unsoundness-in-pin/11311/73> for more details.
+
 #[stable(feature = "pin_trait_impls", since = "1.41.0")]
 impl<P: Deref, Q: Deref> PartialEq<Pin<Q>> for Pin<P>
 where