diff options
| author | bors <bors@rust-lang.org> | 2014-06-13 20:57:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-13 20:57:30 +0000 |
| commit | 63dcc9a4df50680686bee852e82a52fbc59b3c27 (patch) | |
| tree | 2a5a941e0da26795babf286edf77f9f225bc906d /src/libstd/dynamic_lib.rs | |
| parent | e7f11f20e5e72a3b22863a9913df94303321a5ce (diff) | |
| parent | b7af25060a1b0451cb06085ba5893980bc4e5333 (diff) | |
| download | rust-63dcc9a4df50680686bee852e82a52fbc59b3c27.tar.gz rust-63dcc9a4df50680686bee852e82a52fbc59b3c27.zip | |
auto merge of #14867 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/dynamic_lib.rs')
| -rw-r--r-- | src/libstd/dynamic_lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index fa6efc8a4b1..76dbfa8c29e 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -134,7 +134,7 @@ impl DynamicLibrary { } /// Access the value at the symbol of the dynamic library - pub unsafe fn symbol<T>(&self, symbol: &str) -> Result<T, String> { + pub unsafe fn symbol<T>(&self, symbol: &str) -> Result<*T, String> { // This function should have a lifetime constraint of 'a on // T but that feature is still unimplemented @@ -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) } }; |
