Skip to content

Commit 60913bf

Browse files
committed
constrain scope of mut ptr to please borrowck
1 parent bede54b commit 60913bf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libstd/arc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ type arc_data<T: const> = {
2424
resource arc_destruct<T: const>(data: *libc::c_void) {
2525
unsafe {
2626
let data: ~arc_data<T> = unsafe::reinterpret_cast(data);
27-
let ref_ptr = &mut data.count;
28-
29-
let new_count = rustrt::rust_atomic_decrement(ref_ptr);
27+
let new_count = rustrt::rust_atomic_decrement(&mut data.count);
3028
assert new_count >= 0;
3129
if new_count == 0 {
3230
// drop glue takes over.

0 commit comments

Comments
 (0)