mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
leak checker: also test AtomicPtr stored via 'swap'
This commit is contained in:
@@ -12,5 +12,9 @@ fn main() {
|
||||
{
|
||||
static LEAK: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
|
||||
LEAK.store(Box::into_raw(Box::new(0usize)), Ordering::SeqCst);
|
||||
|
||||
static LEAK2: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
|
||||
// Make sure this also works when using 'swap'.
|
||||
LEAK2.swap(Box::into_raw(Box::new(0usize)), Ordering::SeqCst);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user