diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-20 01:12:56 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-20 01:26:03 +1100 |
| commit | c00104f36a1dd6aad318d410ffa41b9ec531880a (patch) | |
| tree | 2e317d3960f021384faa3f8ae7f19a9eed1ac849 /src/libstd/rt/args.rs | |
| parent | b3cee6203457b98c030a8597f97b037a8d447f40 (diff) | |
| download | rust-c00104f36a1dd6aad318d410ffa41b9ec531880a.tar.gz rust-c00104f36a1dd6aad318d410ffa41b9ec531880a.zip | |
std: silence warnings when compiling test.
Diffstat (limited to 'src/libstd/rt/args.rs')
| -rw-r--r-- | src/libstd/rt/args.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 7b27161ab5d..a767af4cc0e 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -64,23 +64,25 @@ pub unsafe fn init(argc: int, argv: **u8) { realargs::init(argc, argv) } #[cfg(target_os = "freebsd")] mod imp { use cast; - use libc; + #[cfg(not(test))] use libc; use option::{Option, Some, None}; use iter::Iterator; - use str; + #[cfg(not(test))] use str; use unstable::finally::Finally; use unstable::mutex::{Mutex, MUTEX_INIT}; use util; - use vec; + #[cfg(not(test))] use vec; static mut global_args_ptr: uint = 0; static mut lock: Mutex = MUTEX_INIT; + #[cfg(not(test))] pub unsafe fn init(argc: int, argv: **u8) { let args = load_argc_and_argv(argc, argv); put(args); } + #[cfg(not(test))] pub unsafe fn cleanup() { rtassert!(take().is_some()); lock.destroy(); @@ -127,6 +129,7 @@ mod imp { } // Copied from `os`. + #[cfg(not(test))] unsafe fn load_argc_and_argv(argc: int, argv: **u8) -> ~[~str] { vec::from_fn(argc as uint, |i| { str::raw::from_c_str(*(argv as **libc::c_char).offset(i as int)) @@ -163,8 +166,8 @@ mod imp { } } -#[cfg(target_os = "macos")] -#[cfg(target_os = "win32")] +#[cfg(target_os = "macos", not(test))] +#[cfg(target_os = "win32", not(test))] mod imp { use option::Option; |
