Skip to content

Commit 6dd6986

Browse files
committed
---
yaml --- r: 110189 b: refs/heads/auto c: f1f5056 h: refs/heads/master i: 110187: d073398 v: v3
1 parent 055e2d5 commit 6dd6986

File tree

173 files changed

+1323
-825
lines changed

Some content is hidden

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

173 files changed

+1323
-825
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: 38f7a1b41b0ff9c1bcaec9a892c8ffb64ad6139f
16+
refs/heads/auto: f1f50565a1fda0dfd60d89fea65e2328f42cc5e0
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/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-unsafe.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ asm!(assembly template
295295
);
296296
```
297297

298-
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
299299
crate to allow) and of course requires an `unsafe` block.
300300

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

309309
```
310-
#[feature(asm)];
310+
#![feature(asm)]
311311
312312
#[cfg(target_arch = "x86")]
313313
#[cfg(target_arch = "x86_64")]
@@ -335,7 +335,7 @@ Output operands, input operands, clobbers and options are all optional
335335
but you must add the right number of `:` if you skip them:
336336

337337
```
338-
# #[feature(asm)];
338+
# #![feature(asm)]
339339
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
340340
# fn main() { unsafe {
341341
asm!("xor %eax, %eax"
@@ -349,7 +349,7 @@ asm!("xor %eax, %eax"
349349
Whitespace also doesn't matter:
350350

351351
```
352-
# #[feature(asm)];
352+
# #![feature(asm)]
353353
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
354354
# fn main() { unsafe {
355355
asm!("xor %eax, %eax" ::: "eax");
@@ -363,7 +363,7 @@ Input and output operands follow the same format: `:
363363
expressions must be mutable lvalues:
364364

365365
```
366-
# #[feature(asm)];
366+
# #![feature(asm)]
367367
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
368368
fn add(a: int, b: int) -> int {
369369
let mut c = 0;
@@ -391,7 +391,7 @@ compiler not to assume any values loaded into those registers will
391391
stay valid.
392392

393393
```
394-
# #[feature(asm)];
394+
# #![feature(asm)]
395395
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
396396
# fn main() { unsafe {
397397
// Put the value 0x200 in eax

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: 41 additions & 5 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
@@ -2560,12 +2559,12 @@ task in a _failing state_.
25602559

25612560
~~~~ {.ignore}
25622561
# use std::task;
2563-
# do task::spawn {
2562+
# task::spawn(proc() {
25642563
25652564
([1, 2, 3, 4])[0];
25662565
(["a", "b"])[10]; // fails
25672566
2568-
# }
2567+
# })
25692568
~~~~
25702569

25712570
### Unary operator expressions
@@ -3423,8 +3422,21 @@ x = bo(5,7);
34233422

34243423
### Closure types
34253424

3426-
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+
~~~~
34273435

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

34293441
An example of creating and calling a closure:
34303442

@@ -3447,6 +3459,30 @@ call_closure(closure_no_args, closure_args);
34473459

34483460
```
34493461

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+
34503486
### Object types
34513487

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

branches/auto/src/doc/rustdoc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ that one can still write things like `#[deriving(Eq)]`).
165165
# // what's actually being documented.
166166
# fn fib(n: int) { n + 2 }
167167

168-
do spawn { fib(200); }
168+
spawn(proc() { fib(200); })
169169
```
170170
*/
171171
# fn foo() {}
172172

173-
The documentation online would look like `do spawn { fib(200); }`, but when
173+
The documentation online would look like `spawn(proc() { fib(200); })`, but when
174174
testing this code, the `fib` function will be included (so it can compile).
175175

176176
## Running tests (advanced)

branches/auto/src/doc/tutorial.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,8 @@ Rust uses the unary star operator (`*`) to access the contents of a
14921492
box or pointer, similarly to C.
14931493
14941494
~~~
1495-
let owned = ~20;
1496-
let borrowed = &30;
1495+
let owned = ~10;
1496+
let borrowed = &20;
14971497

14981498
let sum = *owned + *borrowed;
14991499
~~~
@@ -1520,7 +1520,7 @@ can sometimes make code awkward and parenthesis-filled.
15201520
# struct Point { x: f64, y: f64 }
15211521
# enum Shape { Rectangle(Point, Point) }
15221522
# impl Shape { fn area(&self) -> int { 0 } }
1523-
let start = @Point { x: 10.0, y: 20.0 };
1523+
let start = ~Point { x: 10.0, y: 20.0 };
15241524
let end = ~Point { x: (*start).x + 100.0, y: (*start).y + 100.0 };
15251525
let rect = &Rectangle(*start, *end);
15261526
let area = (*rect).area();
@@ -1534,7 +1534,7 @@ dot), so in most cases, explicitly dereferencing the receiver is not necessary.
15341534
# struct Point { x: f64, y: f64 }
15351535
# enum Shape { Rectangle(Point, Point) }
15361536
# impl Shape { fn area(&self) -> int { 0 } }
1537-
let start = @Point { x: 10.0, y: 20.0 };
1537+
let start = ~Point { x: 10.0, y: 20.0 };
15381538
let end = ~Point { x: start.x + 100.0, y: start.y + 100.0 };
15391539
let rect = &Rectangle(*start, *end);
15401540
let area = rect.area();
@@ -1546,7 +1546,7 @@ something silly like
15461546
15471547
~~~
15481548
# struct Point { x: f64, y: f64 }
1549-
let point = &@~Point { x: 10.0, y: 20.0 };
1549+
let point = &~Point { x: 10.0, y: 20.0 };
15501550
println!("{:f}", point.x);
15511551
~~~
15521552
@@ -1907,7 +1907,6 @@ to a reference.
19071907
// As with typical function arguments, owned pointers
19081908
// are automatically converted to references
19091909

1910-
(@s).draw_reference();
19111910
(~s).draw_reference();
19121911

19131912
// Unlike typical function arguments, the self value will
@@ -1918,7 +1917,7 @@ s.draw_reference();
19181917
(& &s).draw_reference();
19191918

19201919
// ... and dereferenced and borrowed
1921-
(&@~s).draw_reference();
1920+
(&~s).draw_reference();
19221921
~~~
19231922
19241923
Implementations may also define standalone (sometimes called "static")
@@ -2403,7 +2402,7 @@ that, like strings and vectors, objects have dynamic size and may
24032402
only be referred to via one of the pointer types.
24042403
Other pointer types work as well.
24052404
Casts to traits may only be done with compatible pointers so,
2406-
for example, an `@Circle` may not be cast to an `~Drawable`.
2405+
for example, an `&Circle` may not be cast to an `~Drawable`.
24072406
24082407
~~~
24092408
# type Circle = int; type Rectangle = int;
@@ -2506,8 +2505,8 @@ use std::f64::consts::PI;
25062505
# impl Circle for CircleStruct { fn radius(&self) -> f64 { (self.area() / PI).sqrt() } }
25072506
# impl Shape for CircleStruct { fn area(&self) -> f64 { PI * square(self.radius) } }
25082507
2509-
let concrete = @CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2510-
let mycircle: @Circle = concrete as @Circle;
2508+
let concrete = ~CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2509+
let mycircle: ~Circle = concrete as ~Circle;
25112510
let nonsense = mycircle.radius() * mycircle.area();
25122511
~~~
25132512

branches/auto/src/etc/combine-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def scrub(b):
5454
#[crate_id=\"run_pass_stage2#0.1\"];
5555
#[crate_id=\"run_pass_stage2#0.1\"];
5656
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
57-
#[allow(warnings)];
57+
#![allow(warnings)]
5858
extern crate collections;
5959
"""
6060
)

branches/auto/src/libarena/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2424
html_root_url = "http://static.rust-lang.org/doc/master")]
2525
#![allow(missing_doc)]
26-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
2726

2827
extern crate collections;
2928

0 commit comments

Comments
 (0)