We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05fcf86 commit 3d151c8Copy full SHA for 3d151c8
tests/run-pass/leak-in-static.rs
@@ -12,5 +12,9 @@ fn main() {
12
{
13
static LEAK: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
14
LEAK.store(Box::into_raw(Box::new(0usize)), Ordering::SeqCst);
15
+
16
+ static LEAK2: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
17
+ // Make sure this also works when using 'swap'.
18
+ LEAK2.swap(Box::into_raw(Box::new(0usize)), Ordering::SeqCst);
19
}
20
0 commit comments