Auto merge of #1645 - RalfJung:rustup, r=RalfJung

Rustup; make use of AtomicPtr fixes
This commit is contained in:
bors 2020-12-10 08:05:35 +00:00
commit 75ea76d6f5
2 changed files with 9 additions and 1 deletions

View file

@ -1 +1 @@
3ff10e74a74ed093fcabac1de27fe1cd65bbbb4a
f0f68778f798d6d34649745b41770829b17ba5b8

View file

@ -1,3 +1,5 @@
use std::{ptr, sync::atomic::{AtomicPtr, Ordering}};
static mut LEAKER: Option<Box<Vec<i32>>> = None;
fn main() {
@ -5,4 +7,10 @@ fn main() {
unsafe {
LEAKER = Some(Box::new(vec![0; 42]));
}
// Make sure this is allowed even when `AtomicPtr` is used.
{
static LEAK: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
LEAK.store(Box::into_raw(Box::new(0usize)), Ordering::SeqCst);
}
}