Skip to content

Commit

Permalink
Document why Pin implementations aren't derived
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilaBorowska committed Dec 5, 2019
1 parent 1cf0db1 commit dfcf764
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libcore/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfcf764

Please sign in to comment.