diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2019-09-14 21:17:11 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2019-09-15 09:15:38 +0100 |
| commit | 8ab67c8f560a730b8978f4a42deb70d01ca1cdfc (patch) | |
| tree | 5b6728330dafce3a7036175624022ec9168e1e05 /src/test/ui/allocator | |
| parent | 5ae3830d589ec75494ff26bd9c92e9f77e49173f (diff) | |
Remove `with_legacy_ctxt`
Diffstat (limited to 'src/test/ui/allocator')
| -rw-r--r-- | src/test/ui/allocator/hygiene.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/allocator/hygiene.rs b/src/test/ui/allocator/hygiene.rs new file mode 100644 index 00000000000..9bd8406a276 --- /dev/null +++ b/src/test/ui/allocator/hygiene.rs @@ -0,0 +1,31 @@ +// run-pass +// no-prefer-dynamic +// aux-build:custom.rs +// aux-build:helper.rs + +#![allow(nonstandard_style)] + +extern crate custom; +extern crate helper; + +use custom::A; +use std::sync::atomic::{AtomicUsize, Ordering}; + +#[allow(dead_code)] +struct u8; +#[allow(dead_code)] +struct usize; +#[allow(dead_code)] +static arg0: () = (); + +#[global_allocator] +pub static GLOBAL: A = A(AtomicUsize::new(0)); + +fn main() { + let n = GLOBAL.0.load(Ordering::SeqCst); + let s = Box::new(0); + helper::work_with(&s); + assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 1); + drop(s); + assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2); +} |
