Skip to content

Commit dfcf764

Browse files
Document why Pin implementations aren't derived
1 parent 1cf0db1 commit dfcf764

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcore/pin.rs

+6
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ pub struct Pin<P> {
403403
pointer: P,
404404
}
405405

406+
// The following implementations aren't derived in order to avoid soundness
407+
// issues. `&self.pointer` should not be accessible to untrusted trait
408+
// implementations.
409+
//
410+
// See <https://internals.rust-lang.org/t/unsoundness-in-pin/11311/73> for more details.
411+
406412
#[stable(feature = "pin_trait_impls", since = "1.41.0")]
407413
impl<P: Deref, Q: Deref> PartialEq<Pin<Q>> for Pin<P>
408414
where

0 commit comments

Comments
 (0)