File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -982,8 +982,14 @@ pub trait Tuple {}
982
982
983
983
/// A marker for pointer-like types.
984
984
///
985
- /// This trait can only be implemented for types that have the same size and alignment
986
- /// as a `usize` or `*const ()`.
985
+ /// This trait can only be implemented for types that are certain to have
986
+ /// the same size and alignment as a [`usize`] or [`*const ()`](pointer).
987
+ /// To ensure this, there are special requirements on implementations
988
+ /// of `PointerLike` (other than the already-provided implementations
989
+ /// for built-in types):
990
+ ///
991
+ /// * The type must have `#[repr(transparent)]`.
992
+ /// * The type’s sole non-zero-sized field must itself implement `PointerLike`.
987
993
#[ unstable( feature = "pointer_like_trait" , issue = "none" ) ]
988
994
#[ lang = "pointer_like" ]
989
995
#[ diagnostic:: on_unimplemented(
You can’t perform that action at this time.
0 commit comments