Skip to content

Commit 8b8e851

Browse files
committed
---
yaml --- r: 110190 b: refs/heads/auto c: 2d22243 h: refs/heads/master v: v3
1 parent 6dd6986 commit 8b8e851

File tree

145 files changed

+734
-1002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+734
-1002
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: f1f50565a1fda0dfd60d89fea65e2328f42cc5e0
16+
refs/heads/auto: 2d22243b0c582574394da7e3d8aaf8b2abf2c147
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/crates.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
52+
TARGET_CRATES := std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
5454
workcache url log
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

59-
DEPS_std := libc native:rustrt native:compiler-rt native:backtrace
59+
DEPS_std := native:rustrt native:compiler-rt native:backtrace
6060
DEPS_green := std rand native:context_switch
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std

branches/auto/src/doc/guide-ffi.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ The following is a minimal example of calling a foreign function which will
1212
compile if snappy is installed:
1313

1414
~~~~ {.ignore}
15-
extern crate libc;
16-
use libc::size_t;
15+
use std::libc::size_t;
1716
1817
#[link(name = "snappy")]
1918
extern {
@@ -45,8 +44,7 @@ keeping the binding correct at runtime.
4544
The `extern` block can be extended to cover the entire snappy API:
4645

4746
~~~~ {.ignore}
48-
extern crate libc;
49-
use libc::{c_int, size_t};
47+
use std::libc::{c_int, size_t};
5048
5149
#[link(name = "snappy")]
5250
extern {
@@ -404,7 +402,7 @@ global state. In order to access these variables, you declare them in `extern`
404402
blocks with the `static` keyword:
405403

406404
~~~{.ignore}
407-
extern crate libc;
405+
use std::libc;
408406
409407
#[link(name = "readline")]
410408
extern {
@@ -422,7 +420,7 @@ interface. To do this, statics can be declared with `mut` so rust can mutate
422420
them.
423421

424422
~~~{.ignore}
425-
extern crate libc;
423+
use std::libc;
426424
use std::ptr;
427425
428426
#[link(name = "readline")]
@@ -446,15 +444,11 @@ calling foreign functions. Some foreign functions, most notably the Windows API,
446444
conventions. Rust provides a way to tell the compiler which convention to use:
447445

448446
~~~~
449-
extern crate libc;
450-
451447
#[cfg(target_os = "win32", target_arch = "x86")]
452448
#[link(name = "kernel32")]
453449
extern "stdcall" {
454-
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> libc::c_int;
450+
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> std::libc::c_int;
455451
}
456-
457-
# fn main() { }
458452
~~~~
459453

460454
This applies to the entire `extern` block. The list of supported ABI constraints

branches/auto/src/doc/guide-unsafe.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ As an example, we give a reimplementation of owned boxes by wrapping
192192
reimplementation is as safe as the built-in `~` type.
193193

194194
```
195-
extern crate libc;
196-
use libc::{c_void, size_t, malloc, free};
195+
use std::libc::{c_void, size_t, malloc, free};
197196
use std::mem;
198197
use std::ptr;
199198

branches/auto/src/doc/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ li {list-style-type: none; }
3636
* [The `glob` file path matching library](glob/index.html)
3737
* [The `green` M:N runtime library](green/index.html)
3838
* [The `hexfloat` library for hexadecimal floating-point literals](hexfloat/index.html)
39-
* [The `libc` bindings](libc/index.html)
4039
* [The `native` 1:1 threading runtime](native/index.html)
4140
* [The `num` arbitrary precision numerics library](num/index.html)
4241
* [The `rand` library for random numbers and distributions](rand/index.html)

branches/auto/src/doc/rust.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,13 +1471,11 @@ with the exception that they may not have a body
14711471
and are instead terminated by a semicolon.
14721472

14731473
~~~~
1474-
extern crate libc;
1475-
use libc::{c_char, FILE};
1474+
# use std::libc::{c_char, FILE};
14761475
14771476
extern {
14781477
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
14791478
}
1480-
# fn main() {}
14811479
~~~~
14821480

14831481
Functions within external blocks may be called by Rust code,

branches/auto/src/etc/zsh/_rust

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _rustc_opts_switches=(
4040
)
4141
_rustc_opts_lint=(
4242
'attribute-usage[detects bad use of attributes]'
43-
'ctypes[proper use of libc types in foreign modules]'
43+
'ctypes[proper use of std::libc types in foreign modules]'
4444
'dead-assignment[detect assignments that will never be read]'
4545
'dead-code[detect piece of code that will never be used]'
4646
'default-type-param-usage[prevents explicitly setting a type parameter with a default]'

branches/auto/src/libcollections/hashmap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ use std::result::{Ok, Err};
3030
use std::slice::ImmutableVector;
3131

3232
mod table {
33-
extern crate libc;
34-
3533
use std::clone::Clone;
3634
use std::cmp::Eq;
3735
use std::hash::{Hash, Hasher};
3836
use std::kinds::marker;
37+
use std::libc;
3938
use std::num::CheckedMul;
4039
use std::option::{Option, Some, None};
4140
use std::prelude::Drop;

branches/auto/src/libflate/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ Simple compression
2626

2727
#[cfg(test)] #[phase(syntax, link)] extern crate log;
2828

29-
extern crate libc;
30-
29+
use std::libc::{c_void, size_t, c_int};
30+
use std::libc;
3131
use std::c_vec::CVec;
32-
use libc::{c_void, size_t, c_int};
33-
3432

3533
pub mod rustrt {
36-
use libc::{c_void, size_t, c_int};
34+
use std::libc::{c_int, c_void, size_t};
35+
3736
#[link(name = "miniz", kind = "static")]
3837
extern {
3938
pub fn tdefl_compress_mem_to_heap(psrc_buf: *c_void,

branches/auto/src/libgreen/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199
#[cfg(test)] #[phase(syntax, link)] extern crate log;
200200
#[cfg(test)] extern crate rustuv;
201201
extern crate rand;
202-
extern crate libc;
203202

204203
use std::mem::replace;
205204
use std::os;

branches/auto/src/libgreen/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ macro_rules! rtabort (
5252

5353
pub fn dumb_println(args: &fmt::Arguments) {
5454
use std::io;
55-
use libc;
55+
use std::libc;
5656

5757
struct Stderr;
5858
impl io::Writer for Stderr {

branches/auto/src/libgreen/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ fn new_sched_rng() -> XorShiftRng {
976976
}
977977
#[cfg(unix)]
978978
fn new_sched_rng() -> XorShiftRng {
979-
use libc;
979+
use std::libc;
980980
use std::mem;
981981
use rand::SeedableRng;
982982

branches/auto/src/libgreen/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::rt::env::max_cached_stacks;
1212
use std::os::{errno, page_size, MemoryMap, MapReadable, MapWritable,
1313
MapNonStandardFlags, MapVirtual};
14-
use libc;
14+
use std::libc;
1515

1616
/// A task's stack. The name "Stack" is a vestige of segmented stacks.
1717
pub struct Stack {

branches/auto/src/libnative/io/addrinfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use ai = std::io::net::addrinfo;
1212
use std::c_str::CString;
1313
use std::cast;
1414
use std::io::IoError;
15-
use libc;
16-
use libc::{c_char, c_int};
15+
use std::libc;
16+
use std::libc::{c_char, c_int};
1717
use std::ptr::{null, mut_null};
1818

1919
use super::net::sockaddr_to_addr;

branches/auto/src/libnative/io/file_unix.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use std::sync::arc::UnsafeArc;
1414
use std::c_str::CString;
1515
use std::io::IoError;
1616
use std::io;
17-
use libc::{c_int, c_void};
18-
use libc;
17+
use std::libc::{c_int, c_void};
18+
use std::libc;
1919
use std::mem;
2020
use std::rt::rtio;
2121
use std::slice;
@@ -341,8 +341,8 @@ pub fn mkdir(p: &CString, mode: io::FilePermission) -> IoResult<()> {
341341
}
342342

343343
pub fn readdir(p: &CString) -> IoResult<~[Path]> {
344-
use libc::{dirent_t};
345-
use libc::{opendir, readdir_r, closedir};
344+
use std::libc::{dirent_t};
345+
use std::libc::{opendir, readdir_r, closedir};
346346

347347
fn prune(root: &CString, dirs: ~[Path]) -> ~[Path] {
348348
let root = unsafe { CString::new(root.with_ref(|p| p), false) };
@@ -520,7 +520,7 @@ pub fn utime(p: &CString, atime: u64, mtime: u64) -> IoResult<()> {
520520
mod tests {
521521
use super::{CFile, FileDesc};
522522
use std::io;
523-
use libc;
523+
use std::libc;
524524
use std::os;
525525
use std::rt::rtio::RtioFileStream;
526526

branches/auto/src/libnative/io/file_win32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use std::c_str::CString;
1414
use std::cast;
1515
use std::io::IoError;
1616
use std::io;
17-
use libc::{c_int, c_void};
18-
use libc;
17+
use std::libc::{c_int, c_void};
18+
use std::libc;
1919
use std::mem;
2020
use std::os::win32::{as_utf16_p, fill_utf16_buf_and_decode};
2121
use std::ptr;

branches/auto/src/libnative/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use std::io::IoError;
2727
use std::io::net::ip::SocketAddr;
2828
use std::io::process::ProcessConfig;
2929
use std::io::signal::Signum;
30-
use libc::c_int;
31-
use libc;
30+
use std::libc::c_int;
31+
use std::libc;
3232
use std::os;
3333
use std::rt::rtio;
3434
use std::rt::rtio::{RtioTcpStream, RtioTcpListener, RtioUdpSocket,

branches/auto/src/libnative/io/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::cast;
1212
use std::io::net::ip;
1313
use std::io;
14-
use libc;
14+
use std::libc;
1515
use std::mem;
1616
use std::rt::rtio;
1717
use std::sync::arc::UnsafeArc;

branches/auto/src/libnative/io/pipe_unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::c_str::CString;
1212
use std::cast;
1313
use std::io;
14-
use libc;
14+
use std::libc;
1515
use std::mem;
1616
use std::rt::rtio;
1717
use std::sync::arc::UnsafeArc;

branches/auto/src/libnative/io/pipe_win32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
//! me!
8686
8787
use std::c_str::CString;
88-
use libc;
88+
use std::libc;
8989
use std::os::win32::as_utf16_p;
9090
use std::ptr;
9191
use std::rt::rtio;

branches/auto/src/libnative/io/process.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
use std::io;
12-
use libc::{pid_t, c_void, c_int};
13-
use libc;
12+
use std::libc::{pid_t, c_void, c_int};
13+
use std::libc;
1414
use std::os;
1515
use std::ptr;
1616
use std::rt::rtio;
@@ -223,20 +223,20 @@ fn spawn_process_os(config: p::ProcessConfig,
223223
dir: Option<&Path>,
224224
in_fd: c_int, out_fd: c_int,
225225
err_fd: c_int) -> IoResult<SpawnProcessResult> {
226-
use libc::types::os::arch::extra::{DWORD, HANDLE, STARTUPINFO};
227-
use libc::consts::os::extra::{
226+
use std::libc::types::os::arch::extra::{DWORD, HANDLE, STARTUPINFO};
227+
use std::libc::consts::os::extra::{
228228
TRUE, FALSE,
229229
STARTF_USESTDHANDLES,
230230
INVALID_HANDLE_VALUE,
231231
DUPLICATE_SAME_ACCESS
232232
};
233-
use libc::funcs::extra::kernel32::{
233+
use std::libc::funcs::extra::kernel32::{
234234
GetCurrentProcess,
235235
DuplicateHandle,
236236
CloseHandle,
237237
CreateProcessA
238238
};
239-
use libc::funcs::extra::msvcrt::get_osfhandle;
239+
use std::libc::funcs::extra::msvcrt::get_osfhandle;
240240

241241
use std::mem;
242242

@@ -422,9 +422,9 @@ fn spawn_process_os(config: p::ProcessConfig,
422422
dir: Option<&Path>,
423423
in_fd: c_int, out_fd: c_int,
424424
err_fd: c_int) -> IoResult<SpawnProcessResult> {
425-
use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
426-
use libc::funcs::bsd44::getdtablesize;
427-
use libc::c_ulong;
425+
use std::libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
426+
use std::libc::funcs::bsd44::getdtablesize;
427+
use std::libc::c_ulong;
428428

429429
mod rustrt {
430430
extern {
@@ -716,16 +716,16 @@ fn waitpid(pid: pid_t) -> p::ProcessExit {
716716

717717
#[cfg(windows)]
718718
fn waitpid_os(pid: pid_t) -> p::ProcessExit {
719-
use libc::types::os::arch::extra::DWORD;
720-
use libc::consts::os::extra::{
719+
use std::libc::types::os::arch::extra::DWORD;
720+
use std::libc::consts::os::extra::{
721721
SYNCHRONIZE,
722722
PROCESS_QUERY_INFORMATION,
723723
FALSE,
724724
STILL_ACTIVE,
725725
INFINITE,
726726
WAIT_FAILED
727727
};
728-
use libc::funcs::extra::kernel32::{
728+
use std::libc::funcs::extra::kernel32::{
729729
OpenProcess,
730730
GetExitCodeProcess,
731731
CloseHandle,
@@ -761,7 +761,7 @@ fn waitpid(pid: pid_t) -> p::ProcessExit {
761761

762762
#[cfg(unix)]
763763
fn waitpid_os(pid: pid_t) -> p::ProcessExit {
764-
use libc::funcs::posix01::wait;
764+
use std::libc::funcs::posix01::wait;
765765
let mut status = 0 as c_int;
766766
match retry(|| unsafe { wait::waitpid(pid, &mut status, 0) }) {
767767
-1 => fail!("unknown waitpid error: {}", super::last_error()),
@@ -779,7 +779,7 @@ fn waitpid_nowait(pid: pid_t) -> Option<p::ProcessExit> {
779779

780780
#[cfg(unix)]
781781
fn waitpid_os(pid: pid_t) -> Option<p::ProcessExit> {
782-
use libc::funcs::posix01::wait;
782+
use std::libc::funcs::posix01::wait;
783783
let mut status = 0 as c_int;
784784
match retry(|| unsafe {
785785
wait::waitpid(pid, &mut status, libc::WNOHANG)

branches/auto/src/libnative/io/timer_helper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn shutdown() {
9494

9595
#[cfg(unix)]
9696
mod imp {
97-
use libc;
97+
use std::libc;
9898
use std::os;
9999

100100
use io::file::FileDesc;
@@ -117,9 +117,9 @@ mod imp {
117117

118118
#[cfg(windows)]
119119
mod imp {
120-
use libc::{BOOL, LPCSTR, HANDLE, LPSECURITY_ATTRIBUTES, CloseHandle};
120+
use std::libc::{BOOL, LPCSTR, HANDLE, LPSECURITY_ATTRIBUTES, CloseHandle};
121121
use std::ptr;
122-
use libc;
122+
use std::libc;
123123

124124
pub type signal = HANDLE;
125125

0 commit comments

Comments
 (0)