Skip to content

Commit 81ea8e5

Browse files
committed
---
yaml --- r: 110193 b: refs/heads/auto c: 02c81fe h: refs/heads/master i: 110191: f511be4 v: v3
1 parent f5123e9 commit 81ea8e5

File tree

286 files changed

+1951
-1581
lines changed

Some content is hidden

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

286 files changed

+1951
-1581
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: b78ac5b74a62e7b2772d322004a6bb04967f8437
16+
refs/heads/auto: 02c81fe2b5308bccbc90baae9e7ccdb8b915fe7d
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ documentation.
55

66
## Quick Start
77

8-
1. Download a [binary insaller][installer] for your platform.
8+
1. Download a [binary installer][installer] for your platform.
99
2. Read the [tutorial].
1010
3. Enjoy!
1111

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 := std green rustuv native flate arena glob term semver \
52+
TARGET_CRATES := libc 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 := native:rustrt native:compiler-rt native:backtrace
59+
DEPS_std := libc 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/dist.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
215215
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
216216
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
217217
dist-install-dir-$(1): PREPARE_CLEAN=true
218-
dist-install-dir-$(1): prepare-base-dir-$(1)
218+
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
219219
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
220220
> tmp/dist/manifest-$(1).in
221221
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
@@ -224,6 +224,7 @@ dist-install-dir-$(1): prepare-base-dir-$(1)
224224
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
225225
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
226226
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
227+
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
227228
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
228229

229230
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)

branches/auto/mk/tests.mk

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ $(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-
375373
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
376374
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
377375
@$$(call E, run: $$<)
@@ -503,6 +501,10 @@ CTEST_BUILD_BASE_codegen = codegen
503501
CTEST_MODE_codegen = codegen
504502
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
505503

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+
506508
ifeq ($(CFG_GDB),)
507509
CTEST_DISABLE_debuginfo = "no gdb found"
508510
endif
@@ -515,6 +517,14 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
515517
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
516518
endif
517519

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+
518528
define DEF_CTEST_VARS
519529

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

562572
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
563-
CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
573+
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(2)_H_$(3))
564574
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
565575
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
566576
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
@@ -587,8 +597,28 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
587597

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

590-
ifeq ($$(CTEST_DISABLE_$(4)),)
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)
591605

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)),)
592622
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
593623
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
594624
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -600,11 +630,9 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
600630

601631
else
602632

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))
633+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
606634
@$$(call E, run $(4) [$(2)]: $$<)
607-
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
635+
@$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
608636
touch $$@
609637

610638
endif

branches/auto/src/compiletest/compiletest.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
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+
1417
#![allow(non_camel_case_types)]
1518
#![deny(warnings)]
1619

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

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

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

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

404406
~~~{.ignore}
405-
use std::libc;
407+
extern crate libc;
406408
407409
#[link(name = "readline")]
408410
extern {
@@ -420,7 +422,7 @@ interface. To do this, statics can be declared with `mut` so rust can mutate
420422
them.
421423

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

446448
~~~~
449+
extern crate libc;
450+
447451
#[cfg(target_os = "win32", target_arch = "x86")]
448452
#[link(name = "kernel32")]
449453
extern "stdcall" {
450-
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> std::libc::c_int;
454+
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> libc::c_int;
451455
}
456+
457+
# fn main() { }
452458
~~~~
453459

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

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ 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-
use std::libc::{c_void, size_t, malloc, free};
195+
extern crate libc;
196+
use libc::{c_void, size_t, malloc, free};
196197
use std::mem;
197198
use std::ptr;
198199
@@ -294,7 +295,7 @@ asm!(assembly template
294295
);
295296
```
296297

297-
Any use of `asm` is feature gated (requires `#[feature(asm)];` on the
298+
Any use of `asm` is feature gated (requires `#![feature(asm)]` on the
298299
crate to allow) and of course requires an `unsafe` block.
299300

300301
> **Note**: the examples here are given in x86/x86-64 assembly, but all
@@ -306,7 +307,7 @@ The `assembly template` is the only required parameter and must be a
306307
literal string (i.e `""`)
307308

308309
```
309-
#[feature(asm)];
310+
#![feature(asm)]
310311
311312
#[cfg(target_arch = "x86")]
312313
#[cfg(target_arch = "x86_64")]
@@ -334,7 +335,7 @@ Output operands, input operands, clobbers and options are all optional
334335
but you must add the right number of `:` if you skip them:
335336

336337
```
337-
# #[feature(asm)];
338+
# #![feature(asm)]
338339
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
339340
# fn main() { unsafe {
340341
asm!("xor %eax, %eax"
@@ -348,7 +349,7 @@ asm!("xor %eax, %eax"
348349
Whitespace also doesn't matter:
349350

350351
```
351-
# #[feature(asm)];
352+
# #![feature(asm)]
352353
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
353354
# fn main() { unsafe {
354355
asm!("xor %eax, %eax" ::: "eax");
@@ -362,7 +363,7 @@ Input and output operands follow the same format: `:
362363
expressions must be mutable lvalues:
363364

364365
```
365-
# #[feature(asm)];
366+
# #![feature(asm)]
366367
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
367368
fn add(a: int, b: int) -> int {
368369
let mut c = 0;
@@ -390,7 +391,7 @@ compiler not to assume any values loaded into those registers will
390391
stay valid.
391392

392393
```
393-
# #[feature(asm)];
394+
# #![feature(asm)]
394395
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
395396
# fn main() { unsafe {
396397
// Put the value 0x200 in eax

branches/auto/src/doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ 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)
3940
* [The `native` 1:1 threading runtime](native/index.html)
4041
* [The `num` arbitrary precision numerics library](num/index.html)
4142
* [The `rand` library for random numbers and distributions](rand/index.html)

branches/auto/src/doc/po/ja/rust.md.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Japanese translations for Rust package
2-
# Copyright (C) 2013 The Rust Project Developers
2+
# Copyright (C) 2013-2014 The Rust Project Developers
33
# This file is distributed under the same license as the Rust package.
44
# Automatically generated, 2013.
55
#
@@ -886,7 +886,7 @@ msgstr ""
886886
#: src/doc/rust.md:2008
887887
#, fuzzy
888888
#| msgid "~~~~ use std::task::spawn;"
889-
msgid "~~~~ {.ignore} #[warn(unstable)];"
889+
msgid "~~~~ {.ignore} #![warn(unstable)]"
890890
msgstr ""
891891
"~~~~\n"
892892
"use std::task::spawn;"

branches/auto/src/doc/rust.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,12 @@ The keywords are the following strings:
206206
as
207207
break
208208
crate
209-
do
210209
else enum extern
211210
false fn for
212211
if impl in
213212
let loop
214213
match mod mut
215-
priv pub
214+
priv proc pub
216215
ref return
217216
self static struct super
218217
true trait type
@@ -1472,11 +1471,13 @@ with the exception that they may not have a body
14721471
and are instead terminated by a semicolon.
14731472

14741473
~~~~
1475-
# use std::libc::{c_char, FILE};
1474+
extern crate libc;
1475+
use libc::{c_char, FILE};
14761476
14771477
extern {
14781478
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
14791479
}
1480+
# fn main() {}
14801481
~~~~
14811482

14821483
Functions within external blocks may be called by Rust code,
@@ -2558,12 +2559,12 @@ task in a _failing state_.
25582559

25592560
~~~~ {.ignore}
25602561
# use std::task;
2561-
# do task::spawn {
2562+
# task::spawn(proc() {
25622563
25632564
([1, 2, 3, 4])[0];
25642565
(["a", "b"])[10]; // fails
25652566
2566-
# }
2567+
# })
25672568
~~~~
25682569

25692570
### Unary operator expressions
@@ -3421,8 +3422,21 @@ x = bo(5,7);
34213422

34223423
### Closure types
34233424

3424-
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 `||`.
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+
~~~~
34253435

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()`.
34263440

34273441
An example of creating and calling a closure:
34283442

@@ -3445,6 +3459,30 @@ call_closure(closure_no_args, closure_args);
34453459

34463460
```
34473461

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+
34483486
### Object types
34493487

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

0 commit comments

Comments
 (0)