File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1705,9 +1705,9 @@ impl<T> Weak<T> {
1705
1705
let ptr: * mut RcBox < T > = NonNull :: as_ptr ( self . ptr ) ;
1706
1706
1707
1707
// SAFETY: we must offset the pointer manually, and said pointer may be
1708
- // a dangling weak (usize::MAX). data_offset is safe to call, because we
1709
- // know a pointer to unsized T must be derived from a real unsized T,
1710
- // because dangling weaks are only created for sized T. wrapping_offset
1708
+ // a dangling weak (usize::MAX) if T is sized . data_offset is safe to call,
1709
+ // because we know that a pointer to unsized T was derived from a real
1710
+ // unsized T, as dangling weaks are only created for sized T. wrapping_offset
1711
1711
// is used so that we can use the same code path for the non-dangling
1712
1712
// unsized case and the potentially dangling sized case.
1713
1713
unsafe {
Original file line number Diff line number Diff line change @@ -1473,9 +1473,9 @@ impl<T> Weak<T> {
1473
1473
let ptr: * mut ArcInner < T > = NonNull :: as_ptr ( self . ptr ) ;
1474
1474
1475
1475
// SAFETY: we must offset the pointer manually, and said pointer may be
1476
- // a dangling weak (usize::MAX). data_offset is safe to call, because we
1477
- // know a pointer to unsized T must be derived from a real unsized T,
1478
- // because dangling weaks are only created for sized T. wrapping_offset
1476
+ // a dangling weak (usize::MAX) if T is sized . data_offset is safe to call,
1477
+ // because we know that a pointer to unsized T was derived from a real
1478
+ // unsized T, as dangling weaks are only created for sized T. wrapping_offset
1479
1479
// is used so that we can use the same code path for the non-dangling
1480
1480
// unsized case and the potentially dangling sized case.
1481
1481
unsafe {
You can’t perform that action at this time.
0 commit comments