Skip to content

Commit a940ac3

Browse files
committed
---
yaml --- r: 110198 b: refs/heads/auto c: d0e60b7 h: refs/heads/master v: v3
1 parent deceb28 commit a940ac3

File tree

221 files changed

+1272
-1622
lines changed

Some content is hidden

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

221 files changed

+1272
-1622
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: 31e8f2448c8cdd913566d5cb9a5cb9f0c014dcbc
16+
refs/heads/auto: d0e60b72ee3f5fb07b01143d82362cb42307f32d
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/mk/tests.mk

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ $(foreach host,$(CFG_HOST), \
370370
define DEF_TEST_CRATE_RULES
371371
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
372372

373+
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
374+
373375
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
374376
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
375377
@$$(call E, run: $$<)
@@ -501,10 +503,6 @@ CTEST_BUILD_BASE_codegen = codegen
501503
CTEST_MODE_codegen = codegen
502504
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
503505

504-
# CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
505-
# disabled and the associated message to be printed as a warning
506-
# during attempts to run those tests.
507-
508506
ifeq ($(CFG_GDB),)
509507
CTEST_DISABLE_debuginfo = "no gdb found"
510508
endif
@@ -517,14 +515,6 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
517515
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
518516
endif
519517

520-
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
521-
# test group to be disabled *unless* the target is able to build a
522-
# compiler (i.e. when the target triple is in the set of of host
523-
# triples). The associated message will be printed as a warning
524-
# during attempts to run those tests.
525-
526-
CTEST_DISABLE_NONSELFHOST_rpass-full = "run-pass-full suite is unavailable when cross-compiling."
527-
528518
define DEF_CTEST_VARS
529519

530520
# All the per-stage build rules you might want to call from the
@@ -570,7 +560,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
570560
$$(CTEST_TESTARGS)
571561

572562
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
573-
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(2)_H_$(3))
563+
CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
574564
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
575565
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
576566
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
@@ -597,28 +587,8 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
597587

598588
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
599589

600-
# CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
601-
# Goal: leave this variable as empty string if we should run the test.
602-
# Otherwise, set it to the reason we are not running the test.
603-
# (Encoded as a separate variable because GNU make does not have a
604-
# good way to express OR on ifeq commands)
590+
ifeq ($$(CTEST_DISABLE_$(4)),)
605591

606-
ifneq ($$(CTEST_DISABLE_$(4)),)
607-
# Test suite is disabled for all configured targets.
608-
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
609-
else
610-
# else, check if non-self-hosted target (i.e. target not-in hosts) ...
611-
ifeq ($$(findstring $(2),$$(CFG_HOST)),)
612-
# ... if so, then check if this test suite is disabled for non-selfhosts.
613-
ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
614-
# Test suite is disabled for this target.
615-
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
616-
endif
617-
endif
618-
# Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
619-
endif
620-
621-
ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
622592
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
623593
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
624594
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -630,9 +600,11 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
630600

631601
else
632602

633-
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
603+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
604+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
605+
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
634606
@$$(call E, run $(4) [$(2)]: $$<)
635-
@$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
607+
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
636608
touch $$@
637609

638610
endif

branches/auto/src/compiletest/compiletest.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#![crate_type = "bin"]
1212
#![feature(phase)]
1313

14-
// we use our own (green) start below; do not link in libnative; issue #13247.
15-
#![no_start]
16-
1714
#![allow(non_camel_case_types)]
1815
#![deny(warnings)]
1916

branches/auto/src/compiletest/procsrv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ pub fn run(lib_path: &str,
8484

8585
Some(Result {
8686
status: status,
87-
out: str::from_utf8_owned(output).unwrap(),
88-
err: str::from_utf8_owned(error).unwrap()
87+
out: str::from_utf8(output.as_slice()).unwrap().to_owned(),
88+
err: str::from_utf8(error.as_slice()).unwrap().to_owned()
8989
})
9090
},
9191
Err(..) => None

branches/auto/src/compiletest/runtest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
153153
match props.pp_exact { Some(_) => 1, None => 2 };
154154

155155
let src = File::open(testfile).read_to_end().unwrap();
156-
let src = str::from_utf8_owned(src).unwrap();
156+
let src = str::from_utf8(src.as_slice()).unwrap().to_owned();
157157
let mut srcs = vec!(src);
158158

159159
let mut round = 0;
@@ -177,7 +177,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
177177
Some(ref file) => {
178178
let filepath = testfile.dir_path().join(file);
179179
let s = File::open(&filepath).read_to_end().unwrap();
180-
str::from_utf8_owned(s).unwrap()
180+
str::from_utf8(s.as_slice()).unwrap().to_owned()
181181
}
182182
None => { (*srcs.get(srcs.len() - 2u)).clone() }
183183
};
@@ -1163,7 +1163,7 @@ fn disassemble_extract(config: &config, _props: &TestProps,
11631163
11641164
fn count_extracted_lines(p: &Path) -> uint {
11651165
let x = File::open(&p.with_extension("ll")).read_to_end().unwrap();
1166-
let x = str::from_utf8_owned(x).unwrap();
1166+
let x = str::from_utf8(x.as_slice()).unwrap();
11671167
x.lines().len()
11681168
}
11691169

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: 1 addition & 6 deletions
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)
@@ -67,10 +66,6 @@ li {list-style-type: none; }
6766

6867
# External resources
6968

70-
* The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/)
71-
* [`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) - general discussion
72-
* [`#rust-gamedev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev) - game development
73-
* [`#rust-internals`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals) - compiler and libraries
74-
* [`#rust-osdev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-osdev) - operating system development
69+
* The Rust [IRC channel](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) - `#rust` on irc.mozilla.org
7570
* The Rust community on [Reddit](http://reddit.com/r/rust)
7671
* The Rust [wiki](http://github.com/mozilla/rust/wiki)

branches/auto/src/doc/rust.md

Lines changed: 2 additions & 41 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,
@@ -3422,21 +3420,8 @@ x = bo(5,7);
34223420

34233421
### Closure types
34243422

3425-
~~~~ {.notrust .ebnf .notation}
3426-
closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
3427-
[ ':' bound-list ] [ '->' type ]
3428-
procedure_type := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
3429-
[ ':' bound-list ] [ '->' type ]
3430-
lifetime-list := lifetime | lifetime ',' lifetime-list
3431-
arg-list := ident ':' type | ident ':' type ',' arg-list
3432-
bound-list := bound | bound '+' bound-list
3433-
bound := path | lifetime
3434-
~~~~
3423+
The type of a closure mapping an input of type `A` to an output of type `B` is `|A| -> B`. A closure with no arguments or return values has type `||`.
34353424

3436-
The type of a closure mapping an input of type `A` to an output of type `B` is
3437-
`|A| -> B`. A closure with no arguments or return values has type `||`.
3438-
Similarly, a procedure mapping `A` to `B` is `proc(A) -> B` and a no-argument
3439-
and no-return value closure has type `proc()`.
34403425

34413426
An example of creating and calling a closure:
34423427

@@ -3459,30 +3444,6 @@ call_closure(closure_no_args, closure_args);
34593444

34603445
```
34613446

3462-
Unlike closures, procedures may only be invoked once, but own their
3463-
environment, and are allowed to move out of their environment. Procedures are
3464-
allocated on the heap (unlike closures). An example of creating and calling a
3465-
procedure:
3466-
3467-
```rust
3468-
let string = ~"Hello";
3469-
3470-
// Creates a new procedure, passing it to the `spawn` function.
3471-
spawn(proc() {
3472-
println!("{} world!", string);
3473-
});
3474-
3475-
// the variable `string` has been moved into the previous procedure, so it is
3476-
// no longer usable.
3477-
3478-
3479-
// Create an invoke a procedure. Note that the procedure is *moved* when
3480-
// invoked, so it cannot be invoked again.
3481-
let f = proc(n: int) { n + 22 };
3482-
println!("answer: {}", f(20));
3483-
3484-
```
3485-
34863447
### Object types
34873448

34883449
Every trait item (see [traits](#traits)) defines a type with the same name as the trait.

branches/auto/src/etc/zsh/_rust

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ _rustc_opts_switches=(
3636
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
3737
--target-cpu'[Select target processor (llc -mcpu=help for details)]'
3838
--target-feature'[Target specific attributes (llc -mattr=help for details)]'
39-
--relocation-model'[Relocation model (llc --help for details)]'
4039
{-v,--version}'[Print version info and exit]'
4140
)
4241
_rustc_opts_lint=(
4342
'attribute-usage[detects bad use of attributes]'
44-
'ctypes[proper use of libc types in foreign modules]'
43+
'ctypes[proper use of std::libc types in foreign modules]'
4544
'dead-assignment[detect assignments that will never be read]'
4645
'dead-code[detect piece of code that will never be used]'
4746
'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 {

0 commit comments

Comments
 (0)