File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2325,11 +2325,8 @@ impl<T: ?Sized> Unpin for Rc<T> {}
23252325///
23262326/// # Safety
23272327///
2328- /// This has the same safety requirements as `align_of_val_raw`. In effect:
2329- ///
2330- /// - This function is safe for any argument if `T` is sized, and
2331- /// - if `T` is unsized, the pointer must have appropriate pointer metadata
2332- /// acquired from the real instance that you are getting this offset for.
2328+ /// The pointer must point to (and have valid metadata for) a previously
2329+ /// valid instance of T, but the T is allowed to be dropped.
23332330unsafe fn data_offset < T : ?Sized > ( ptr : * const T ) -> isize {
23342331 // Align the unsized value to the end of the `RcBox`.
23352332 // Because it is ?Sized, it will always be the last field in memory.
Original file line number Diff line number Diff line change @@ -2476,11 +2476,8 @@ impl<T: ?Sized> Unpin for Arc<T> {}
24762476///
24772477/// # Safety
24782478///
2479- /// This has the same safety requirements as `align_of_val_raw`. In effect:
2480- ///
2481- /// - This function is safe for any argument if `T` is sized, and
2482- /// - if `T` is unsized, the pointer must have appropriate pointer metadata
2483- /// acquired from the real instance that you are getting this offset for.
2479+ /// The pointer must point to (and have valid metadata for) a previously
2480+ /// valid instance of T, but the T is allowed to be dropped.
24842481unsafe fn data_offset < T : ?Sized > ( ptr : * const T ) -> isize {
24852482 // Align the unsized value to the end of the `ArcInner`.
24862483 // Because it is `?Sized`, it will always be the last field in memory.
You can’t perform that action at this time.
0 commit comments