about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-04-03 14:09:16 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-04-03 17:11:26 -0700
commit487fa9568b69753fecb74a8460109239f4bf3631 (patch)
tree825968a6d9424674217c04ff35cc6f5daf42be43
parent57e0908af395af1c10e28600b785b5366a43660c (diff)
downloadrust-487fa9568b69753fecb74a8460109239f4bf3631.tar.gz
rust-487fa9568b69753fecb74a8460109239f4bf3631.zip
Test fixes from the rollup
-rw-r--r--src/libstd/rt/global_heap.rs10
-rw-r--r--src/libsyntax/abi.rs16
-rw-r--r--src/test/bench/rt-spawn-rate.rs10
3 files changed, 23 insertions, 13 deletions
diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs
index 3917857e1af..5c1b6cd4791 100644
--- a/src/libstd/rt/global_heap.rs
+++ b/src/libstd/rt/global_heap.rs
@@ -64,16 +64,16 @@ pub unsafe fn realloc_raw(ptr: *mut u8, size: uint) -> *mut u8 {
     }
 }
 
-// The compiler never calls `exchange_free` on ~ZeroSizeType, so zero-size
-// allocations can point to this `static`. It would be incorrect to use a null
-// pointer, due to enums assuming types like unique pointers are never null.
-static EMPTY: () = ();
-
 /// The allocator for unique pointers without contained managed pointers.
 #[cfg(not(test))]
 #[lang="exchange_malloc"]
 #[inline]
 pub unsafe fn exchange_malloc(size: uint) -> *mut u8 {
+    // The compiler never calls `exchange_free` on ~ZeroSizeType, so zero-size
+    // allocations can point to this `static`. It would be incorrect to use a null
+    // pointer, due to enums assuming types like unique pointers are never null.
+    static EMPTY: () = ();
+
     if size == 0 {
         &EMPTY as *() as *mut u8
     } else {
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs
index a40899de931..17251d31351 100644
--- a/src/libsyntax/abi.rs
+++ b/src/libsyntax/abi.rs
@@ -193,12 +193,12 @@ fn indices_are_correct() {
 
 #[test]
 fn pick_uniplatform() {
-    assert_eq!(Stdcall.for_arch(OsLinux, X86), Some(Stdcall));
-    assert_eq!(Stdcall.for_arch(OsLinux, Arm), None);
-    assert_eq!(System.for_arch(OsLinux, X86), Some(C));
-    assert_eq!(System.for_arch(OsWin32, X86), Some(Stdcall));
-    assert_eq!(System.for_arch(OsWin32, X86_64), Some(C));
-    assert_eq!(System.for_arch(OsWin32, Arm), Some(C));
-    assert_eq!(Stdcall.for_arch(OsWin32, X86), Some(Stdcall));
-    assert_eq!(Stdcall.for_arch(OsWin32, X86_64), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsLinux, X86), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsLinux, Arm), None);
+    assert_eq!(System.for_target(OsLinux, X86), Some(C));
+    assert_eq!(System.for_target(OsWin32, X86), Some(Stdcall));
+    assert_eq!(System.for_target(OsWin32, X86_64), Some(C));
+    assert_eq!(System.for_target(OsWin32, Arm), Some(C));
+    assert_eq!(Stdcall.for_target(OsWin32, X86), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsWin32, X86_64), Some(Stdcall));
 }
diff --git a/src/test/bench/rt-spawn-rate.rs b/src/test/bench/rt-spawn-rate.rs
index 5f445de069c..4f07660779b 100644
--- a/src/test/bench/rt-spawn-rate.rs
+++ b/src/test/bench/rt-spawn-rate.rs
@@ -8,6 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![no_start]
+
+extern crate green;
+extern crate rustuv;
+
 use std::task::spawn;
 use std::os;
 use std::uint;
@@ -15,6 +20,11 @@ use std::uint;
 // Very simple spawn rate test. Spawn N tasks that do nothing and
 // return.
 
+#[start]
+fn start(argc: int, argv: **u8) -> int {
+    green::start(argc, argv, rustuv::event_loop, main)
+}
+
 fn main() {
 
     let args = os::args();