File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -646,15 +646,21 @@ introduce a `StableDeref` trait:
646
646
unsafe trait StableDeref : Deref { }
647
647
```
648
648
Then we make it so that you can only coerce pinned pointers when they implement
649
- ` StableDeref ` . We can do that by modifying its implementation of
650
- [ ` CoerceUnsized ` ] to this:
649
+ ` StableDeref ` . We can do that by modifying its trait implementations to this:
651
650
``` rs
652
651
impl <T , U > CoerceUnsized <Pin <U >> for Pin <T >
653
652
where
654
653
T : CoerceUnsized <U >,
655
654
T : StableDeref ,
656
655
U : StableDeref ,
657
656
{}
657
+
658
+ impl <T , U > DispatchFromDyn <Pin <U >> for Pin <T >
659
+ where
660
+ T : CoerceUnsized <U >,
661
+ T : StableDeref ,
662
+ U : StableDeref ,
663
+ {}
658
664
```
659
665
This way, the user must implement the unsafe trait before they can coerce
660
666
pinned versions of the pointer. Since the trait is unsafe, it is not our fault
You can’t perform that action at this time.
0 commit comments