diff options
| author | bors <bors@rust-lang.org> | 2014-04-06 02:56:39 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-06 02:56:39 -0700 |
| commit | f1f50565a1fda0dfd60d89fea65e2328f42cc5e0 (patch) | |
| tree | c6afc2ec113c761b4a284e1370f00f29155f7025 /src/test | |
| parent | 667f82a79b2275a696b21086ddf5148a617fe20a (diff) | |
| parent | 38f7a1b41b0ff9c1bcaec9a892c8ffb64ad6139f (diff) | |
| download | rust-f1f50565a1fda0dfd60d89fea65e2328f42cc5e0.tar.gz rust-f1f50565a1fda0dfd60d89fea65e2328f42cc5e0.zip | |
auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,me
Rebasing of #12526 with a very obscure bug fixed on windows.
Diffstat (limited to 'src/test')
51 files changed, 105 insertions, 69 deletions
diff --git a/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs b/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs index aa6ee35a077..fe4a397b786 100644 --- a/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs +++ b/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs @@ -10,7 +10,7 @@ #[crate_id="anonexternmod#0.1"]; -use std::libc; +extern crate libc; #[link(name="rustrt")] extern { diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs index d2c79bbe9cb..7185ac413c5 100644 --- a/src/test/auxiliary/extern-crosscrate-source.rs +++ b/src/test/auxiliary/extern-crosscrate-source.rs @@ -11,10 +11,10 @@ #[crate_id="externcallback#0.1"]; #[crate_type = "lib"]; -use std::libc; +extern crate libc; pub mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/auxiliary/foreign_lib.rs b/src/test/auxiliary/foreign_lib.rs index e59fae34636..396e136f6f0 100644 --- a/src/test/auxiliary/foreign_lib.rs +++ b/src/test/auxiliary/foreign_lib.rs @@ -11,7 +11,7 @@ #[crate_id="foreign_lib"]; pub mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/auxiliary/issue-3012-1.rs b/src/test/auxiliary/issue-3012-1.rs index af83c5561db..9bb47fcfad3 100644 --- a/src/test/auxiliary/issue-3012-1.rs +++ b/src/test/auxiliary/issue-3012-1.rs @@ -12,7 +12,7 @@ #[crate_type = "lib"]; pub mod socket { - use std::libc; + extern crate libc; pub struct socket_handle { sockfd: libc::c_int, diff --git a/src/test/auxiliary/issue_5844_aux.rs b/src/test/auxiliary/issue_5844_aux.rs index 78e87f32b79..0f898ae8385 100644 --- a/src/test/auxiliary/issue_5844_aux.rs +++ b/src/test/auxiliary/issue_5844_aux.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; extern "C" { pub fn rand() -> libc::c_int; diff --git a/src/test/compile-fail/attrs-after-extern-mod.rs b/src/test/compile-fail/attrs-after-extern-mod.rs index 44b6ecdee70..df747618696 100644 --- a/src/test/compile-fail/attrs-after-extern-mod.rs +++ b/src/test/compile-fail/attrs-after-extern-mod.rs @@ -12,7 +12,7 @@ // statics cannot. This ensures that there's some form of error if this is // attempted. -use std::libc; +extern crate libc; extern { static mut rust_dbg_static_mut: libc::c_int; diff --git a/src/test/compile-fail/lint-ctypes.rs b/src/test/compile-fail/lint-ctypes.rs index 352a31cf67b..3de0a0446d8 100644 --- a/src/test/compile-fail/lint-ctypes.rs +++ b/src/test/compile-fail/lint-ctypes.rs @@ -10,7 +10,7 @@ #![deny(ctypes)] -use std::libc; +extern crate libc; extern { pub fn bare_type1(size: int); //~ ERROR: found rust type diff --git a/src/test/compile-fail/lint-dead-code-3.rs b/src/test/compile-fail/lint-dead-code-3.rs index 7c8a4c2a22c..95c1d131b7b 100644 --- a/src/test/compile-fail/lint-dead-code-3.rs +++ b/src/test/compile-fail/lint-dead-code-3.rs @@ -14,6 +14,8 @@ #![crate_type="lib"] +extern crate libc; + struct Foo; //~ ERROR: code is never used impl Foo { fn foo(&self) { //~ ERROR: code is never used @@ -46,7 +48,7 @@ pub fn pub_fn() { } mod blah { - use std::libc::size_t; + use libc::size_t; // not warned because it's used in the parameter of `free` and return of // `malloc` below, which are also used. enum c_void {} diff --git a/src/test/compile-fail/non-copyable-void.rs b/src/test/compile-fail/non-copyable-void.rs index bd9547d5e1c..5025e2e509b 100644 --- a/src/test/compile-fail/non-copyable-void.rs +++ b/src/test/compile-fail/non-copyable-void.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; fn main() { let x : *Vec<int> = &vec!(1,2,3); diff --git a/src/test/compile-fail/static-mut-foreign-requires-unsafe.rs b/src/test/compile-fail/static-mut-foreign-requires-unsafe.rs index 7b371cf708d..0e44af19a7f 100644 --- a/src/test/compile-fail/static-mut-foreign-requires-unsafe.rs +++ b/src/test/compile-fail/static-mut-foreign-requires-unsafe.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; extern { static mut a: libc::c_int; diff --git a/src/test/compile-fail/unsupported-cast.rs b/src/test/compile-fail/unsupported-cast.rs index be3f5ba7da8..fbcad79ac46 100644 --- a/src/test/compile-fail/unsupported-cast.rs +++ b/src/test/compile-fail/unsupported-cast.rs @@ -10,7 +10,7 @@ // error-pattern:unsupported cast -use std::libc; +extern crate libc; fn main() { println!("{:?}", 1.0 as *libc::FILE); // Can't cast float to foreign. diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 93f55261574..c11d269a897 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -13,11 +13,11 @@ // Testing that runtime failure doesn't cause callbacks to abort abnormally. // Instead the failure will be delivered after the callbacks return. -use std::libc; +extern crate libc; use std::task; mod rustrt { - use std::libc; + extern crate libc; extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index 2430c5bb666..67153042590 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -16,11 +16,11 @@ // See the hack in upcall_call_shim_on_c_stack where it messes // with the stack limit. -use std::libc; +extern crate libc; use std::task; mod rustrt { - use std::libc; + extern crate libc; extern { pub fn rust_get_argc() -> libc::c_int; diff --git a/src/test/run-make/lto-smoke-c/Makefile b/src/test/run-make/lto-smoke-c/Makefile index 6a703927736..8658950f174 100644 --- a/src/test/run-make/lto-smoke-c/Makefile +++ b/src/test/run-make/lto-smoke-c/Makefile @@ -4,6 +4,9 @@ ifneq ($(shell uname),Darwin) EXTRAFLAGS := -lm -lrt -ldl -lpthread endif +# Apparently older versions of GCC segfault if -g is passed... +CC := $(CC:-g=) + all: $(RUSTC) foo.rs -Z lto ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo) diff --git a/src/test/run-make/lto-smoke-c/foo.rs b/src/test/run-make/lto-smoke-c/foo.rs index 4cb7a749385..1bb19016700 100644 --- a/src/test/run-make/lto-smoke-c/foo.rs +++ b/src/test/run-make/lto-smoke-c/foo.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[crate_type = "staticlib"]; +#![crate_type = "staticlib"] #[no_mangle] pub extern "C" fn foo() {} diff --git a/src/test/run-pass/anon-extern-mod.rs b/src/test/run-pass/anon-extern-mod.rs index 7e05bcc1fd2..9ee1b85d856 100644 --- a/src/test/run-pass/anon-extern-mod.rs +++ b/src/test/run-pass/anon-extern-mod.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/c-stack-as-value.rs b/src/test/run-pass/c-stack-as-value.rs index d590c35d9e2..89cbbc24475 100644 --- a/src/test/run-pass/c-stack-as-value.rs +++ b/src/test/run-pass/c-stack-as-value.rs @@ -9,7 +9,7 @@ // except according to those terms. mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 9a02768faeb..c02a24c3f08 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -8,8 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -mod libc { - use std::libc::{c_char, c_long, c_longlong}; +// ignore-fast doesn't like extern crate + +extern crate libc; + +mod mlibc { + use libc::{c_char, c_long, c_longlong}; extern { pub fn atol(x: *c_char) -> c_long; @@ -18,11 +22,11 @@ mod libc { } fn atol(s: ~str) -> int { - s.with_c_str(|x| unsafe { libc::atol(x) as int }) + s.with_c_str(|x| unsafe { mlibc::atol(x) as int }) } fn atoll(s: ~str) -> i64 { - s.with_c_str(|x| unsafe { libc::atoll(x) as i64 }) + s.with_c_str(|x| unsafe { mlibc::atoll(x) as i64 }) } pub fn main() { diff --git a/src/test/run-pass/const-cast.rs b/src/test/run-pass/const-cast.rs index d511930c70f..7b17b578b82 100644 --- a/src/test/run-pass/const-cast.rs +++ b/src/test/run-pass/const-cast.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; extern fn foo() {} diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index 83232b40873..10c1d474f1a 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -17,6 +17,7 @@ // instead of in std. #[feature(macro_rules)]; +extern crate libc; extern crate native; extern crate green; @@ -34,7 +35,7 @@ macro_rules! iotest ( #[allow(unused_imports)]; use std::io::timer; - use std::libc; + use libc; use std::str; use std::io::process::{Process, ProcessOutput}; use native; @@ -87,7 +88,7 @@ iotest!(fn test_destroy_twice() { pub fn test_destroy_actually_kills(force: bool) { use std::io::process::{Process, ProcessOutput, ExitStatus, ExitSignal}; use std::io::timer; - use std::libc; + use libc; use std::str; #[cfg(unix,not(target_os="android"))] diff --git a/src/test/run-pass/extern-call-deep.rs b/src/test/run-pass/extern-call-deep.rs index 67f2d750cc0..84574fb6787 100644 --- a/src/test/run-pass/extern-call-deep.rs +++ b/src/test/run-pass/extern-call-deep.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/extern-call-deep2.rs b/src/test/run-pass/extern-call-deep2.rs index 701ae33132d..60b80356d9f 100644 --- a/src/test/run-pass/extern-call-deep2.rs +++ b/src/test/run-pass/extern-call-deep2.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; use std::task; mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/extern-call-indirect.rs b/src/test/run-pass/extern-call-indirect.rs index 16142b2f896..391fdc616dc 100644 --- a/src/test/run-pass/extern-call-indirect.rs +++ b/src/test/run-pass/extern-call-indirect.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/extern-call-scrub.rs b/src/test/run-pass/extern-call-scrub.rs index c67810bb17a..a1aa2adc431 100644 --- a/src/test/run-pass/extern-call-scrub.rs +++ b/src/test/run-pass/extern-call-scrub.rs @@ -12,11 +12,11 @@ // make sure the stack pointers are maintained properly in both // directions -use std::libc; +extern crate libc; use std::task; mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/extern-stress.rs b/src/test/run-pass/extern-stress.rs index ef1b26fc1af..26fc334026f 100644 --- a/src/test/run-pass/extern-stress.rs +++ b/src/test/run-pass/extern-stress.rs @@ -11,11 +11,11 @@ // This creates a bunch of descheduling tasks that run concurrently // while holding onto C stacks -use std::libc; +extern crate libc; use std::task; mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/extern-yield.rs b/src/test/run-pass/extern-yield.rs index ba4f0ccfe64..aec7ee43412 100644 --- a/src/test/run-pass/extern-yield.rs +++ b/src/test/run-pass/extern-yield.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; use std::task; mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index 130f04b3fb2..147cfb16fa2 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -8,8 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +extern crate libc; + use std::cast; -use std::libc; use std::unstable::run_in_bare_thread; #[link(name = "rustrt")] diff --git a/src/test/run-pass/foreign-dupe.rs b/src/test/run-pass/foreign-dupe.rs index 8a6c0e4abce..a36083e8293 100644 --- a/src/test/run-pass/foreign-dupe.rs +++ b/src/test/run-pass/foreign-dupe.rs @@ -12,7 +12,7 @@ // calling pin_task and that's having wierd side-effects. mod rustrt1 { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { @@ -21,7 +21,7 @@ mod rustrt1 { } mod rustrt2 { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index 7e6a362cabe..e35aaaf7f76 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -8,8 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -mod libc { - use std::libc::{c_char, size_t}; +// ignore-fast doesn't like extern crate + +extern crate libc; + +mod mlibc { + extern crate libc; + use self::libc::{c_char, size_t}; extern { #[link_name = "strlen"] @@ -21,7 +26,7 @@ fn strlen(str: ~str) -> uint { // C string is terminated with a zero str.with_c_str(|buf| { unsafe { - libc::my_strlen(buf) as uint + mlibc::my_strlen(buf) as uint } }) } diff --git a/src/test/run-pass/foreign-mod-unused-const.rs b/src/test/run-pass/foreign-mod-unused-const.rs index 2f587653941..e1ed0b8ea3b 100644 --- a/src/test/run-pass/foreign-mod-unused-const.rs +++ b/src/test/run-pass/foreign-mod-unused-const.rs @@ -8,8 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-fast doesn't like extern crate + +extern crate libc; + mod foo { - use std::libc::c_int; + use libc::c_int; extern { pub static errno: c_int; diff --git a/src/test/run-pass/foreign-no-abi.rs b/src/test/run-pass/foreign-no-abi.rs index eef45532265..0bf97a7d9b4 100644 --- a/src/test/run-pass/foreign-no-abi.rs +++ b/src/test/run-pass/foreign-no-abi.rs @@ -11,7 +11,7 @@ // ABI is cdecl by default mod rustrt { - use std::libc; + extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/foreign2.rs b/src/test/run-pass/foreign2.rs index 7c9d2dfa87c..3c7e878c318 100644 --- a/src/test/run-pass/foreign2.rs +++ b/src/test/run-pass/foreign2.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-fast doesn't like extern crate + +extern crate libc; + mod bar { extern {} } @@ -16,8 +20,8 @@ mod zed { extern {} } -mod libc { - use std::libc::{c_int, c_void, size_t, ssize_t}; +mod mlibc { + use libc::{c_int, c_void, size_t, ssize_t}; extern { pub fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t; diff --git a/src/test/run-pass/issue-1251.rs b/src/test/run-pass/issue-1251.rs index 70d2c58a631..3befa4e7fb4 100644 --- a/src/test/run-pass/issue-1251.rs +++ b/src/test/run-pass/issue-1251.rs @@ -11,7 +11,7 @@ #[crate_id="rust_get_test_int"]; mod rustrt { - use std::libc; + extern crate libc; extern { pub fn rust_get_test_int() -> libc::intptr_t; diff --git a/src/test/run-pass/issue-2214.rs b/src/test/run-pass/issue-2214.rs index f482790ef4c..b6ff31269c7 100644 --- a/src/test/run-pass/issue-2214.rs +++ b/src/test/run-pass/issue-2214.rs @@ -10,8 +10,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +extern crate libc; + use std::cast; -use std::libc::{c_double, c_int}; +use libc::{c_double, c_int}; fn to_c_int(v: &mut int) -> &mut c_int { unsafe { @@ -26,7 +28,7 @@ fn lgamma(n: c_double, value: &mut int) -> c_double { } mod m { - use std::libc::{c_double, c_int}; + use libc::{c_double, c_int}; #[link_name = "m"] extern { diff --git a/src/test/run-pass/issue-3012-2.rs b/src/test/run-pass/issue-3012-2.rs index 0ffbdc3c5b8..a301aa6baa4 100644 --- a/src/test/run-pass/issue-3012-2.rs +++ b/src/test/run-pass/issue-3012-2.rs @@ -14,9 +14,9 @@ #[feature(managed_boxes)]; extern crate socketlib; +extern crate libc; use socketlib::socket; -use std::libc; pub fn main() { let fd: libc::c_int = 1 as libc::c_int; diff --git a/src/test/run-pass/issue-3656.rs b/src/test/run-pass/issue-3656.rs index 404d29fb93e..5823c473caa 100644 --- a/src/test/run-pass/issue-3656.rs +++ b/src/test/run-pass/issue-3656.rs @@ -13,7 +13,8 @@ // Incorrect struct size computation in the FFI, because of not taking // the alignment of elements into account. -use std::libc::{c_uint, uint32_t, c_void}; +extern crate libc; +use libc::{c_uint, uint32_t, c_void}; struct KEYGEN { hash_algorithm: [c_uint, ..2], diff --git a/src/test/run-pass/issue-4735.rs b/src/test/run-pass/issue-4735.rs index b8205d9635b..b23158522a3 100644 --- a/src/test/run-pass/issue-4735.rs +++ b/src/test/run-pass/issue-4735.rs @@ -8,9 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-fast doesn't like extern crate + +extern crate libc; use std::cast::transmute; -use std::libc::c_void; +use libc::c_void; struct NonCopyable(*c_void); diff --git a/src/test/run-pass/issue-5791.rs b/src/test/run-pass/issue-5791.rs index 251ae2f3194..1bda73a16c9 100644 --- a/src/test/run-pass/issue-5791.rs +++ b/src/test/run-pass/issue-5791.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; extern { #[link_name = "malloc"] diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index ae5a86c699e..e873221cf26 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -157,7 +157,7 @@ mod test_other_forms { mod test_foreign_items { pub mod rustrt { - use std::libc; + extern crate libc; extern { #![attr] diff --git a/src/test/run-pass/lint-cstack.rs b/src/test/run-pass/lint-cstack.rs index 5d89a2d5b3c..2194453aac2 100644 --- a/src/test/run-pass/lint-cstack.rs +++ b/src/test/run-pass/lint-cstack.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; extern { fn rust_get_test_int() -> libc::intptr_t; diff --git a/src/test/run-pass/morestack6.rs b/src/test/run-pass/morestack6.rs index 440acbcf4da..f1ba95b5efe 100644 --- a/src/test/run-pass/morestack6.rs +++ b/src/test/run-pass/morestack6.rs @@ -18,7 +18,7 @@ extern crate rand; use std::task; mod rustrt { - use std::libc; + extern crate libc; extern { pub fn debug_get_stk_seg() -> *u8; diff --git a/src/test/run-pass/newtype-struct-with-dtor.rs b/src/test/run-pass/newtype-struct-with-dtor.rs index ca79c304802..8631755f37f 100644 --- a/src/test/run-pass/newtype-struct-with-dtor.rs +++ b/src/test/run-pass/newtype-struct-with-dtor.rs @@ -8,8 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc::c_int; -use std::libc; +// ignore-fast doesn't like extern crate + +extern crate libc; +use libc::c_int; pub struct Fd(c_int); diff --git a/src/test/run-pass/osx-frameworks.rs b/src/test/run-pass/osx-frameworks.rs index 5e45386353b..aa4e91320f7 100644 --- a/src/test/run-pass/osx-frameworks.rs +++ b/src/test/run-pass/osx-frameworks.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; #[cfg(target_os = "macos")] #[link(name = "CoreFoundation", kind = "framework")] diff --git a/src/test/run-pass/process-detach.rs b/src/test/run-pass/process-detach.rs index 3b80d9ce491..45445ed84f9 100644 --- a/src/test/run-pass/process-detach.rs +++ b/src/test/run-pass/process-detach.rs @@ -22,8 +22,8 @@ extern crate green; extern crate rustuv; +extern crate libc; -use std::libc; use std::io::process; use std::io::signal::{Listener, Interrupt}; diff --git a/src/test/run-pass/regions-mock-tcx.rs b/src/test/run-pass/regions-mock-tcx.rs index c38df0f7a22..2c5245d5b38 100644 --- a/src/test/run-pass/regions-mock-tcx.rs +++ b/src/test/run-pass/regions-mock-tcx.rs @@ -18,11 +18,11 @@ extern crate arena; extern crate collections; +extern crate libc; use arena::Arena; use collections::HashMap; use std::cast; -use std::libc; use std::mem; type Type<'tcx> = &'tcx TypeStructure<'tcx>; diff --git a/src/test/run-pass/regions-mock-trans.rs b/src/test/run-pass/regions-mock-trans.rs index 8cac6e8558f..b0198d56e05 100644 --- a/src/test/run-pass/regions-mock-trans.rs +++ b/src/test/run-pass/regions-mock-trans.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +extern crate libc; use std::cast; -use std::libc; use std::mem; struct arena(()); diff --git a/src/test/run-pass/rename-directory.rs b/src/test/run-pass/rename-directory.rs index ef43dad2c68..2f059c3531d 100644 --- a/src/test/run-pass/rename-directory.rs +++ b/src/test/run-pass/rename-directory.rs @@ -13,9 +13,10 @@ // ignore-fast +extern crate libc; + use std::io::TempDir; use std::os; -use std::libc; use std::io; use std::io::fs; diff --git a/src/test/run-pass/static-mut-foreign.rs b/src/test/run-pass/static-mut-foreign.rs index 0afe01bf7ed..4c88caa1d2c 100644 --- a/src/test/run-pass/static-mut-foreign.rs +++ b/src/test/run-pass/static-mut-foreign.rs @@ -12,7 +12,7 @@ // statics cannot. This ensures that there's some form of error if this is // attempted. -use std::libc; +extern crate libc; #[link(name = "rustrt")] extern { diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index e3f2456c4c4..b87535713a7 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; +extern crate libc; pub fn main() { let f = 1 as *libc::FILE; diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs index d18e2ac7354..e3920613f6d 100644 --- a/src/test/run-pass/tcp-stress.rs +++ b/src/test/run-pass/tcp-stress.rs @@ -16,8 +16,8 @@ #![feature(phase)] #[phase(syntax, link)] extern crate log; +extern crate libc; -use std::libc; use std::io::net::ip::{Ipv4Addr, SocketAddr}; use std::io::net::tcp::{TcpListener, TcpStream}; use std::io::{Acceptor, Listener}; diff --git a/src/test/run-pass/variadic-ffi.rs b/src/test/run-pass/variadic-ffi.rs index 9cb2f22d38e..903b76a29ce 100644 --- a/src/test/run-pass/variadic-ffi.rs +++ b/src/test/run-pass/variadic-ffi.rs @@ -8,8 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +extern crate libc; use std::c_str::CString; -use std::libc::{c_char, c_int}; +use libc::{c_char, c_int}; + +// ignore-fast doesn't like extern crate extern { fn sprintf(s: *mut c_char, format: *c_char, ...) -> c_int; |
