diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-09-06 14:36:26 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-09-06 14:36:26 +0200 |
| commit | 76ceeddb2b6fd4589cf8292d8dafa65a91ace019 (patch) | |
| tree | 11106836a5a37fc73a209a905786431ea0f10117 /src/test/run-pass/allocator/auxiliary | |
| parent | 20ca02569ae3e1dc29962e92739fbab632abf241 (diff) | |
| download | rust-76ceeddb2b6fd4589cf8292d8dafa65a91ace019.tar.gz rust-76ceeddb2b6fd4589cf8292d8dafa65a91ace019.zip | |
Migrated remaining `src/test/run-pass/` subdirectories to `src/test/ui/run-pass/`.
Diffstat (limited to 'src/test/run-pass/allocator/auxiliary')
| -rw-r--r-- | src/test/run-pass/allocator/auxiliary/custom-as-global.rs | 26 | ||||
| -rw-r--r-- | src/test/run-pass/allocator/auxiliary/custom.rs | 31 | ||||
| -rw-r--r-- | src/test/run-pass/allocator/auxiliary/helper.rs | 19 |
3 files changed, 0 insertions, 76 deletions
diff --git a/src/test/run-pass/allocator/auxiliary/custom-as-global.rs b/src/test/run-pass/allocator/auxiliary/custom-as-global.rs deleted file mode 100644 index a3f05a01c5a..00000000000 --- a/src/test/run-pass/allocator/auxiliary/custom-as-global.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -#![crate_type = "rlib"] - -extern crate custom; - -use std::sync::atomic::{ATOMIC_USIZE_INIT, Ordering}; - -use custom::A; - -#[global_allocator] -static ALLOCATOR: A = A(ATOMIC_USIZE_INIT); - -pub fn get() -> usize { - ALLOCATOR.0.load(Ordering::SeqCst) -} diff --git a/src/test/run-pass/allocator/auxiliary/custom.rs b/src/test/run-pass/allocator/auxiliary/custom.rs deleted file mode 100644 index b17464e0419..00000000000 --- a/src/test/run-pass/allocator/auxiliary/custom.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -#![feature(allocator_api)] -#![crate_type = "rlib"] - -use std::alloc::{GlobalAlloc, System, Layout}; -use std::sync::atomic::{AtomicUsize, Ordering}; - -pub struct A(pub AtomicUsize); - -unsafe impl GlobalAlloc for A { - unsafe fn alloc(&self, layout: Layout) -> *mut u8 { - self.0.fetch_add(1, Ordering::SeqCst); - System.alloc(layout) - } - - unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { - self.0.fetch_add(1, Ordering::SeqCst); - System.dealloc(ptr, layout) - } -} diff --git a/src/test/run-pass/allocator/auxiliary/helper.rs b/src/test/run-pass/allocator/auxiliary/helper.rs deleted file mode 100644 index e75a432710d..00000000000 --- a/src/test/run-pass/allocator/auxiliary/helper.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -#![crate_type = "rlib"] - -use std::fmt; - -pub fn work_with(p: &fmt::Debug) { - drop(p); -} |
