Skip to content

Commit 8ae194b

Browse files
committed
alloc tests: avoid aliasing &mut and &
1 parent eb67092 commit 8ae194b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/alloctests/tests/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,15 @@ fn weak_self_cyclic() {
332332
#[test]
333333
fn drop_arc() {
334334
let mut canary = AtomicUsize::new(0);
335-
let x = Arc::new(Canary(&mut canary as *mut AtomicUsize));
335+
let x = Arc::new(Canary(&raw mut canary));
336336
drop(x);
337337
assert!(canary.load(Acquire) == 1);
338338
}
339339

340340
#[test]
341341
fn drop_arc_weak() {
342342
let mut canary = AtomicUsize::new(0);
343-
let arc = Arc::new(Canary(&mut canary as *mut AtomicUsize));
343+
let arc = Arc::new(Canary(&raw mut canary));
344344
let arc_weak = Arc::downgrade(&arc);
345345
assert!(canary.load(Acquire) == 0);
346346
drop(arc);

0 commit comments

Comments
 (0)