Skip to content

Commit fcb53e8

Browse files
committed
---
yaml --- r: 109776 b: refs/heads/snap-stage3 c: 4e9e259 h: refs/heads/master v: v3
1 parent c96bf02 commit fcb53e8

File tree

143 files changed

+1029
-649
lines changed

Some content is hidden

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

143 files changed

+1029
-649
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2344c6c12d5062aee1fab83493e40f4045892dc6
4+
refs/heads/snap-stage3: 4e9e25907b6c63e3bde3dd122160ec07ef1ba6b9
55
refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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/snap-stage3/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/snap-stage3/src/doc/guide-unsafe.md

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

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

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

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

336336
```
337-
# #[feature(asm)];
337+
# #![feature(asm)]
338338
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
339339
# fn main() { unsafe {
340340
asm!("xor %eax, %eax"
@@ -348,7 +348,7 @@ asm!("xor %eax, %eax"
348348
Whitespace also doesn't matter:
349349

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

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

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

branches/snap-stage3/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/snap-stage3/src/doc/rust.md

Lines changed: 3 additions & 4 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
@@ -2558,12 +2557,12 @@ task in a _failing state_.
25582557

25592558
~~~~ {.ignore}
25602559
# use std::task;
2561-
# do task::spawn {
2560+
# task::spawn(proc() {
25622561
25632562
([1, 2, 3, 4])[0];
25642563
(["a", "b"])[10]; // fails
25652564
2566-
# }
2565+
# })
25672566
~~~~
25682567

25692568
### Unary operator expressions

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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/snap-stage3/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

branches/snap-stage3/src/libcollections/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
#![feature(macro_rules, managed_boxes, default_type_params, phase)]
2424

25-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
26-
2725
extern crate rand;
2826

2927
#[cfg(test)] extern crate test;

branches/snap-stage3/src/libcollections/priority_queue.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ impl<T:Ord> PriorityQueue<T> {
117117
/// Create an empty PriorityQueue
118118
pub fn new() -> PriorityQueue<T> { PriorityQueue{data: ~[],} }
119119

120+
/// Create an empty PriorityQueue with capacity `capacity`
121+
pub fn with_capacity(capacity: uint) -> PriorityQueue<T> {
122+
PriorityQueue { data: slice::with_capacity(capacity) }
123+
}
124+
120125
/// Create a PriorityQueue from a vector (heapify)
121126
pub fn from_vec(xs: ~[T]) -> PriorityQueue<T> {
122127
let mut q = PriorityQueue{data: xs,};

branches/snap-stage3/src/libcollections/smallintmap.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ impl<V> SmallIntMap<V> {
112112
/// Create an empty SmallIntMap
113113
pub fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }
114114

115+
/// Create an empty SmallIntMap with capacity `capacity`
116+
pub fn with_capacity(capacity: uint) -> SmallIntMap<V> {
117+
SmallIntMap { v: slice::with_capacity(capacity) }
118+
}
119+
115120
pub fn get<'a>(&'a self, key: &uint) -> &'a V {
116121
self.find(key).expect("key not present")
117122
}

0 commit comments

Comments
 (0)