]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/dynamic_lib.rs
auto merge of #15999 : Kimundi/rust/fix_folder, r=nikomatsakis
[rust.git] / src / libstd / dynamic_lib.rs
index 728875ce2601012f3d25b645de37fddae4212a36..2c4e0ea67010f2c9143d5b6a33ffc87a32cc7ec4 100644 (file)
@@ -20,6 +20,7 @@
 #![allow(missing_doc)]
 
 use clone::Clone;
+use collections::MutableSeq;
 use c_str::ToCStr;
 use iter::Iterator;
 use mem;
@@ -192,6 +193,7 @@ fn test_loading_cosine() {
     #[cfg(target_os = "linux")]
     #[cfg(target_os = "macos")]
     #[cfg(target_os = "freebsd")]
+    #[cfg(target_os = "dragonfly")]
     fn test_errors_do_not_crash() {
         // Open /dev/null as a library to get an error, and make sure
         // that only causes an error, and not a crash.
@@ -208,14 +210,13 @@ fn test_errors_do_not_crash() {
 #[cfg(target_os = "macos")]
 #[cfg(target_os = "ios")]
 #[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
 pub mod dl {
-    use prelude::*;
 
     use c_str::{CString, ToCStr};
     use libc;
     use ptr;
     use result::*;
-    use str::StrAllocating;
     use string::String;
 
     pub unsafe fn open_external<T: ToCStr>(filename: T) -> *mut u8 {
@@ -243,9 +244,8 @@ pub fn check_for_errors_in<T>(f: || -> T) -> Result<T, String> {
             let ret = if ptr::null() == last_error {
                 Ok(result)
             } else {
-                Err(CString::new(last_error, false).as_str()
-                                                   .unwrap()
-                                                   .to_string())
+                Err(String::from_str(CString::new(last_error, false).as_str()
+                    .unwrap()))
             };
 
             ret