about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libnative/io/c_win32.rs25
-rw-r--r--src/libstd/dynamic_lib.rs3
-rw-r--r--src/libstd/io/fs.rs8
-rw-r--r--src/libstd/rt/backtrace.rs8
-rw-r--r--src/test/compile-fail/issue-14845.rs2
-rw-r--r--src/test/compile-fail/transmute-different-sizes.rs2
-rw-r--r--src/test/pretty/path-type-bounds.rs6
-rw-r--r--src/test/run-pass-fulldeps/quote-tokens.rs3
-rw-r--r--src/test/run-pass/issue-14837.rs2
9 files changed, 37 insertions, 22 deletions
diff --git a/src/libnative/io/c_win32.rs b/src/libnative/io/c_win32.rs
index e855b8bd4f2..1b6525c6e38 100644
--- a/src/libnative/io/c_win32.rs
+++ b/src/libnative/io/c_win32.rs
@@ -77,15 +77,20 @@ pub mod compat {
         fn GetProcAddress(hModule: HMODULE, lpProcName: LPCSTR) -> LPVOID;
     }
 
-    // store_func() is idempotent, so using relaxed ordering for the atomics should be enough.
-    // This way, calling a function in this compatibility layer (after it's loaded) shouldn't
-    // be any slower than a regular DLL call.
-    unsafe fn store_func<T: Copy>(ptr: *mut T, module: &str, symbol: &str, fallback: T) {
+    // store_func() is idempotent, so using relaxed ordering for the atomics
+    // should be enough.  This way, calling a function in this compatibility
+    // layer (after it's loaded) shouldn't be any slower than a regular DLL
+    // call.
+    unsafe fn store_func(ptr: *mut uint, module: &str, symbol: &str, fallback: uint) {
         let module = module.to_utf16().append_one(0);
         symbol.with_c_str(|symbol| {
             let handle = GetModuleHandleW(module.as_ptr());
-            let func: Option<T> = transmute(GetProcAddress(handle, symbol));
-            atomic_store_relaxed(ptr, func.unwrap_or(fallback))
+            let func: uint = transmute(GetProcAddress(handle, symbol));
+            atomic_store_relaxed(ptr, if func == 0 {
+                fallback
+            } else {
+                func
+            })
         })
     }
 
@@ -109,10 +114,10 @@ pub mod compat {
 
                 extern "system" fn thunk($($argname: $argtype),*) -> $rettype {
                     unsafe {
-                        ::io::c::compat::store_func(&mut ptr,
-                                                             stringify!($module),
-                                                             stringify!($symbol),
-                                                             fallback);
+                        ::io::c::compat::store_func(&mut ptr as *mut _ as *mut uint,
+                                                    stringify!($module),
+                                                    stringify!($symbol),
+                                                    fallback as uint);
                         ::std::intrinsics::atomic_load_relaxed(&ptr)($($argname),*)
                     }
                 }
diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs
index 61f7997071e..76dbfa8c29e 100644
--- a/src/libstd/dynamic_lib.rs
+++ b/src/libstd/dynamic_lib.rs
@@ -158,6 +158,7 @@ mod test {
     use super::*;
     use prelude::*;
     use libc;
+    use mem;
 
     #[test]
     #[ignore(cfg(windows))] // FIXME #8818
@@ -174,7 +175,7 @@ mod test {
         let cosine: extern fn(libc::c_double) -> libc::c_double = unsafe {
             match libm.symbol("cos") {
                 Err(error) => fail!("Could not load function cos: {}", error),
-                Ok(cosine) => cosine
+                Ok(cosine) => mem::transmute::<*u8, _>(cosine)
             }
         };
 
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index 008be8ffaae..10dfec0f566 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -977,7 +977,9 @@ mod test {
         let result = File::open_mode(filename, Open, Read);
 
         error!(result, "couldn't open file");
-        error!(result, "no such file or directory");
+        if cfg!(unix) {
+            error!(result, "no such file or directory");
+        }
         error!(result, format!("path={}; mode=open; access=read", filename.display()));
     })
 
@@ -988,7 +990,9 @@ mod test {
         let result = unlink(filename);
 
         error!(result, "couldn't unlink path");
-        error!(result, "no such file or directory");
+        if cfg!(unix) {
+            error!(result, "no such file or directory");
+        }
         error!(result, format!("path={}", filename.display()));
     })
 
diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs
index a1372b51d47..e2a963c5a87 100644
--- a/src/libstd/rt/backtrace.rs
+++ b/src/libstd/rt/backtrace.rs
@@ -873,12 +873,12 @@ mod imp {
             Err(..) => return Ok(()),
         };
 
-        macro_rules! sym( ($e:expr, $t:ident) => (
-            match unsafe { lib.symbol::<$t>($e) } {
-                Ok(f) => f,
+        macro_rules! sym( ($e:expr, $t:ident) => (unsafe {
+            match lib.symbol($e) {
+                Ok(f) => mem::transmute::<*u8, $t>(f),
                 Err(..) => return Ok(())
             }
-        ) )
+        }) )
 
         // Fetch the symbols necessary from dbghelp.dll
         let SymFromAddr = sym!("SymFromAddr", SymFromAddrFn);
diff --git a/src/test/compile-fail/issue-14845.rs b/src/test/compile-fail/issue-14845.rs
index d87eab7b6de..90366d09e2d 100644
--- a/src/test/compile-fail/issue-14845.rs
+++ b/src/test/compile-fail/issue-14845.rs
@@ -17,7 +17,7 @@ fn main() {
     let x = X { a: [0] };
     let _f = &x.a as *mut u8;
     //~^ ERROR mismatched types: expected `*mut u8` but found `&[u8, .. 1]`
-    
+
     let local = [0u8];
     let _v = &local as *mut u8;
     //~^ ERROR mismatched types: expected `*mut u8` but found `&[u8, .. 1]`
diff --git a/src/test/compile-fail/transmute-different-sizes.rs b/src/test/compile-fail/transmute-different-sizes.rs
index 5ea1c496c76..abdfe983e3a 100644
--- a/src/test/compile-fail/transmute-different-sizes.rs
+++ b/src/test/compile-fail/transmute-different-sizes.rs
@@ -10,6 +10,8 @@
 
 // Tests that `transmute` cannot be called on types of different size.
 
+#![allow(warnings)]
+
 use std::mem::transmute;
 
 unsafe fn f() {
diff --git a/src/test/pretty/path-type-bounds.rs b/src/test/pretty/path-type-bounds.rs
index 0fdbad67f16..f90937c34a6 100644
--- a/src/test/pretty/path-type-bounds.rs
+++ b/src/test/pretty/path-type-bounds.rs
@@ -14,11 +14,11 @@
 trait Tr { }
 impl Tr for int { }
 
-fn foo(x: Box<Tr: Share>) -> Box<Tr: Share> { x }
+fn foo(x: Box<Tr+ Share>) -> Box<Tr+ Share> { x }
 
 fn main() {
-    let x: Box<Tr: Share>;
+    let x: Box<Tr+ Share>;
 
-    box() 1 as Box<Tr: Share>;
+    box() 1 as Box<Tr+ Share>;
 }
 
diff --git a/src/test/run-pass-fulldeps/quote-tokens.rs b/src/test/run-pass-fulldeps/quote-tokens.rs
index 96f5fca5a2d..4b2e29135ad 100644
--- a/src/test/run-pass-fulldeps/quote-tokens.rs
+++ b/src/test/run-pass-fulldeps/quote-tokens.rs
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-android
+// ignore-pretty: does not work well with `--test`
+
 #![feature(quote)]
 #![feature(managed_boxes)]
 
diff --git a/src/test/run-pass/issue-14837.rs b/src/test/run-pass/issue-14837.rs
index c207980cd6e..7876fe86d47 100644
--- a/src/test/run-pass/issue-14837.rs
+++ b/src/test/run-pass/issue-14837.rs
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 #![feature(struct_variant)]
-#![deny(warnings)]
 
+#[deny(dead_code)]
 pub enum Foo {
     Bar {
         pub baz: int