diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2018-06-27 18:09:21 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-07-07 01:41:30 +0200 |
| commit | 41730b7e2e2c28a13fe6d08a7ad47d31d68eccea (patch) | |
| tree | a9c525a2caca2b58e2ac27be70a77c04ba49d86a /src/liballoc/sync.rs | |
| parent | 6e2c49ff0e61e13aa3381eefba7923672a3c085f (diff) | |
| download | rust-41730b7e2e2c28a13fe6d08a7ad47d31d68eccea.tar.gz rust-41730b7e2e2c28a13fe6d08a7ad47d31d68eccea.zip | |
Rc: remove unused allocation from Weak::new()
Same as https://github.com/rust-lang/rust/pull/50357
Diffstat (limited to 'src/liballoc/sync.rs')
| -rw-r--r-- | src/liballoc/sync.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index abc0befeb94..ea8616bf1d0 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -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 |
