File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -695,6 +695,9 @@ mod impls {
695
695
// Fat pointer
696
696
// SAFETY: we are accessing the memory occupied by `self`
697
697
// which is guaranteed to be valid.
698
+ // This assumes a fat pointer can be represented by a `(usize, usize)`,
699
+ // which is safe to do in `std` because it is shipped and kept in sync
700
+ // with the implementation of fat pointers in `rustc`.
698
701
let ( a, b) = unsafe { * ( self as * const Self as * const ( usize , usize ) ) } ;
699
702
state. write_usize ( a) ;
700
703
state. write_usize ( b) ;
@@ -712,6 +715,9 @@ mod impls {
712
715
// Fat pointer
713
716
// SAFETY: we are accessing the memory occupied by `self`
714
717
// which is guaranteed to be valid.
718
+ // This assumes a fat pointer can be represented by a `(usize, usize)`,
719
+ // which is safe to do in `std` because it is shipped and kept in sync
720
+ // with the implementation of fat pointers in `rustc`.
715
721
let ( a, b) = unsafe { * ( self as * const Self as * const ( usize , usize ) ) } ;
716
722
state. write_usize ( a) ;
717
723
state. write_usize ( b) ;
You can’t perform that action at this time.
0 commit comments