diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 19:13:38 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 22:58:37 -0800 |
| commit | 4b359e3aeeaf97a190c5a7ecff8815b7b5734ece (patch) | |
| tree | 0502e3fcb9ceaa41d36c707e95baf0d7740fc3fd /src/libstd | |
| parent | ee9921aaedb26de3cac4c1c174888528f68bbd3f (diff) | |
| download | rust-4b359e3aeeaf97a190c5a7ecff8815b7b5734ece.tar.gz rust-4b359e3aeeaf97a190c5a7ecff8815b7b5734ece.zip | |
More test fixes!
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/dynamic_lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rand/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 14 |
4 files changed, 9 insertions, 13 deletions
diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index 66cb1f2c948..2d013a8a5b8 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -128,8 +128,8 @@ impl DynamicLibrary { // This function should have a lifetime constraint of 'a on // T but that feature is still unimplemented + let raw_string = CString::from_slice(symbol.as_bytes()); let maybe_symbol_value = dl::check_for_errors_in(|| { - let raw_string = CString::from_slice(symbol.as_bytes()); dl::symbol(self.handle, raw_string.as_ptr()) }); diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index e937cd24d8d..b9f226c5aca 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -253,8 +253,6 @@ pub mod num; /* Runtime and platform support */ -pub mod thread_local; // first for macros - #[cfg_attr(stage0, macro_escape)] #[cfg_attr(not(stage0), macro_use)] pub mod thread_local; diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index cadaae5de5c..8855a7e5293 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -245,7 +245,7 @@ pub mod reader; /// The standard RNG. This is designed to be efficient on the current /// platform. -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] pub struct StdRng { rng: IsaacWordRng, } @@ -322,7 +322,7 @@ static THREAD_RNG_RESEED_THRESHOLD: uint = 32_768; type ThreadRngInner = reseeding::ReseedingRng<StdRng, ThreadRngReseeder>; /// The thread-local RNG. -#[deriving(Clone)] +#[derive(Clone)] pub struct ThreadRng { rng: Rc<RefCell<ThreadRngInner>>, } diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 9b3f2ca0373..7b667416b17 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -466,19 +466,17 @@ fn free_handle(handle: *mut ()) { #[cfg(test)] mod tests { - use c_str::ToCStr; + use prelude::v1::*; + use str; + use ffi::CString; + use super::make_command_line; #[test] fn test_make_command_line() { - use prelude::v1::*; - use str; - use c_str::CString; - use super::make_command_line; - fn test_wrapper(prog: &str, args: &[&str]) -> String { - make_command_line(&prog.to_c_str(), + make_command_line(&CString::from_slice(prog.as_bytes()), args.iter() - .map(|a| a.to_c_str()) + .map(|a| CString::from_slice(a.as_bytes())) .collect::<Vec<CString>>() .as_slice()) } |
