]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/dynamic_lib.rs
Auto merge of #28355 - DiamondLovesYou:pnacl-librustc-trans, r=alexcrichton
[rust.git] / src / libstd / dynamic_lib.rs
index 43bfce9b9e9e476ef85f2283f54225457dfbed25..5629cba1e0b3c4675c1da38816e00e81a746414c 100644 (file)
@@ -22,7 +22,6 @@
 
 use env;
 use ffi::{CString, OsString};
-use mem;
 use path::{Path, PathBuf};
 
 pub struct DynamicLibrary {
@@ -114,7 +113,7 @@ pub unsafe fn symbol<T>(&self, symbol: &str) -> Result<*mut T, String> {
         // the destructor does not run.
         match maybe_symbol_value {
             Err(err) => Err(err),
-            Ok(symbol_value) => Ok(mem::transmute(symbol_value))
+            Ok(symbol_value) => Ok(symbol_value as *mut T)
         }
     }
 }
@@ -231,7 +230,7 @@ pub fn check_for_errors_in<T, F>(f: F) -> Result<T, String> where
                 Ok(result)
             } else {
                 let s = CStr::from_ptr(last_error).to_bytes();
-                Err(str::from_utf8(s).unwrap().to_string())
+                Err(str::from_utf8(s).unwrap().to_owned())
             };
 
             ret