Apply suggestions from code review
Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
parent
b5b6760c03
commit
c14e919f1e
2 changed files with 2 additions and 2 deletions
|
@ -1881,7 +1881,7 @@ impl<T: ?Sized> Weak<T> {
|
||||||
|
|
||||||
if is_dangling(ptr) {
|
if is_dangling(ptr) {
|
||||||
// If the pointer is dangling, we return the sentinel directly. This cannot be
|
// If the pointer is dangling, we return the sentinel directly. This cannot be
|
||||||
// a valid payload address, as it is at least as aligned as RcBox (usize).
|
// a valid payload address, as the payload is at least as aligned as RcBox (usize).
|
||||||
ptr as *const T
|
ptr as *const T
|
||||||
} else {
|
} else {
|
||||||
// SAFETY: if is_dangling returns false, then the pointer is dereferencable.
|
// SAFETY: if is_dangling returns false, then the pointer is dereferencable.
|
||||||
|
|
|
@ -1666,7 +1666,7 @@ impl<T: ?Sized> Weak<T> {
|
||||||
|
|
||||||
if is_dangling(ptr) {
|
if is_dangling(ptr) {
|
||||||
// If the pointer is dangling, we return the sentinel directly. This cannot be
|
// If the pointer is dangling, we return the sentinel directly. This cannot be
|
||||||
// a valid payload address, as it is at least as aligned as ArcInner (usize).
|
// a valid payload address, as the payload is at least as aligned as ArcInner (usize).
|
||||||
ptr as *const T
|
ptr as *const T
|
||||||
} else {
|
} else {
|
||||||
// SAFETY: if is_dangling returns false, then the pointer is dereferencable.
|
// SAFETY: if is_dangling returns false, then the pointer is dereferencable.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue