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> {}
2325
2325
///
2326
2326
/// # Safety
2327
2327
///
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.
2333
2330
unsafe fn data_offset < T : ?Sized > ( ptr : * const T ) -> isize {
2334
2331
// Align the unsized value to the end of the `RcBox`.
2335
2332
// 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> {}
2476
2476
///
2477
2477
/// # Safety
2478
2478
///
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.
2484
2481
unsafe fn data_offset < T : ?Sized > ( ptr : * const T ) -> isize {
2485
2482
// Align the unsized value to the end of the `ArcInner`.
2486
2483
// 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