Rc: remove unused allocation from Weak::new()
Same as https://github.com/rust-lang/rust/pull/50357
This commit is contained in:
parent
6e2c49ff0e
commit
41730b7e2e
2 changed files with 37 additions and 24 deletions
|
@ -1038,7 +1038,7 @@ impl<T> Weak<T> {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_dangling<T: ?Sized>(ptr: NonNull<T>) -> bool {
|
||||
pub(crate) fn is_dangling<T: ?Sized>(ptr: NonNull<T>) -> bool {
|
||||
let address = ptr.as_ptr() as *mut () as usize;
|
||||
let align = align_of_val(unsafe { ptr.as_ref() });
|
||||
address == align
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue