]> git.lizzy.rs Git - rust.git/commitdiff
add note for future type-system adventurers
authorAlexis Beingessner <a.beingessner@gmail.com>
Fri, 19 Jun 2015 20:55:01 +0000 (13:55 -0700)
committerAlexis Beingessner <a.beingessner@gmail.com>
Fri, 19 Jun 2015 22:03:39 +0000 (15:03 -0700)
src/libcore/ptr.rs

index 31cdb6093c8d917a5c5a55739706d3b11153f91b..f2792a525d66b311f3fcdde63fe71af580b2642e 100644 (file)
@@ -512,6 +512,11 @@ fn ge(&self, other: &*mut T) -> bool { *self >= *other }
 #[unstable(feature = "unique", reason = "needs an RFC to flesh out design")]
 pub struct Unique<T: ?Sized> {
     pointer: NonZero<*const T>,
+    // NOTE: this marker has no consequences for variance, but is necessary
+    // for dropck to understand that we logically own a `T`.
+    //
+    // For details, see:
+    // https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md#phantom-data
     _marker: PhantomData<T>,
 }