File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ impl<T: ?Sized> *const T {
684
684
#[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
685
685
#[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
686
686
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
687
- pub const unsafe fn byte_offset_from ( self , origin : * const T ) -> isize {
687
+ pub const unsafe fn byte_offset_from < U : ? Sized > ( self , origin : * const U ) -> isize {
688
688
// SAFETY: the caller must uphold the safety contract for `offset_from`.
689
689
unsafe { self . cast :: < u8 > ( ) . offset_from ( origin. cast :: < u8 > ( ) ) }
690
690
}
Original file line number Diff line number Diff line change @@ -861,7 +861,7 @@ impl<T: ?Sized> *mut T {
861
861
#[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
862
862
#[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
863
863
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
864
- pub const unsafe fn byte_offset_from ( self , origin : * const T ) -> isize {
864
+ pub const unsafe fn byte_offset_from < U : ? Sized > ( self , origin : * const U ) -> isize {
865
865
// SAFETY: the caller must uphold the safety contract for `offset_from`.
866
866
unsafe { self . cast :: < u8 > ( ) . offset_from ( origin. cast :: < u8 > ( ) ) }
867
867
}
You can’t perform that action at this time.
0 commit comments