Skip to content

Commit b26c28a

Browse files
author
Nick Desaulniers
committed
---
yaml --- r: 44454 b: refs/heads/master c: 4699ac6 h: refs/heads/master v: v3
1 parent a829d07 commit b26c28a

File tree

449 files changed

+5040
-3035
lines changed

Some content is hidden

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

449 files changed

+5040
-3035
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7103ca95ac8e92fd32ab65321cd443a7233a48e0
2+
refs/heads/master: 4699ac67c6b48331852f3960430a3c8cfcaf7b90
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/AUTHORS.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Benjamin Peterson <[email protected]>
2929
Bilal Husain <[email protected]>
3030
Bill Fallon <[email protected]>
3131
Brendan Eich <[email protected]>
32+
Brendan Zabarauskas <[email protected]>
3233
Brian Anderson <[email protected]>
3334
Brian J. Burg <[email protected]>
3435
Brian Leibig <[email protected]>
@@ -80,6 +81,7 @@ Jeff Muizelaar <[email protected]>
8081
Jeff Olson <[email protected]>
8182
Jeffrey Yasskin <[email protected]>
8283
Jens Nockert <[email protected]>
84+
Jesse Jones <[email protected]>
8385
Jesse Ruderman <[email protected]>
8486
Jim Blandy <[email protected]>
8587
@@ -105,6 +107,7 @@ Mahmut Bulut <[email protected]>
105107
Margaret Meyerhofer <[email protected]>
106108
Marijn Haverbeke <[email protected]>
107109
Mark Lacey <[email protected]>
110+
Mark Vian <[email protected]>
108111
Martin DeMello <[email protected]>
109112
Marvin Löbel <[email protected]>
110113
Matt Brubeck <[email protected]>
@@ -149,6 +152,7 @@ Tim Taubert <[email protected]>
149152
150153
Tomoki Aonuma <[email protected]>
151154
Tony Young <[email protected]>
155+
152156
Tycho Sci <[email protected]>
153157
Tyler Bindon <[email protected]>
154158
Viktor Dahl <[email protected]>

trunk/configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ probe CFG_PDFLATEX pdflatex
394394
probe CFG_XETEX xetex
395395
probe CFG_LUATEX luatex
396396
probe CFG_NODE nodejs node
397+
probe CFG_GDB gdb
397398
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
398399
then
399400
probe CFG_PAXCTL paxctl /sbin/paxctl
@@ -619,6 +620,7 @@ do
619620
make_dir $h/test/bench
620621
make_dir $h/test/perf
621622
make_dir $h/test/pretty
623+
make_dir $h/test/debug-info
622624
make_dir $h/test/doc-tutorial
623625
make_dir $h/test/doc-tutorial-ffi
624626
make_dir $h/test/doc-tutorial-macros

trunk/doc/rust.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,7 @@ grammar as double-quoted strings. Other tokens have exact rules given.
202202

203203
### Keywords
204204

205-
The keywords in [crate files](#crate-files) are the following strings:
206-
207-
~~~~~~~~ {.keyword}
208-
mod priv pub use
209-
~~~~~~~~
210-
211-
The keywords in [source files](#source-files) are the following strings:
205+
The keywords are the following strings:
212206

213207
~~~~~~~~ {.keyword}
214208
as assert
@@ -1215,7 +1209,7 @@ to pointers to the trait name, used as a type.
12151209

12161210
~~~~
12171211
# trait Shape { }
1218-
# impl int: Shape { }
1212+
# impl Shape for int { }
12191213
# let mycircle = 0;
12201214
12211215
let myshape: Shape = @mycircle as @Shape;
@@ -1239,7 +1233,7 @@ For example:
12391233
trait Num {
12401234
static pure fn from_int(n: int) -> Self;
12411235
}
1242-
impl float: Num {
1236+
impl Num for float {
12431237
static pure fn from_int(n: int) -> float { n as float }
12441238
}
12451239
let x: float = Num::from_int(42);
@@ -1275,8 +1269,8 @@ Likewise, supertrait methods may also be called on trait objects.
12751269
~~~ {.xfail-test}
12761270
# trait Shape { fn area() -> float; }
12771271
# trait Circle : Shape { fn radius() -> float; }
1278-
# impl int: Shape { fn area() -> float { 0.0 } }
1279-
# impl int: Circle { fn radius() -> float { 0.0 } }
1272+
# impl Shape for int { fn area() -> float { 0.0 } }
1273+
# impl Circle for int { fn radius() -> float { 0.0 } }
12801274
# let mycircle = 0;
12811275
12821276
let mycircle: Circle = @mycircle as @Circle;
@@ -1298,7 +1292,7 @@ Implementations are defined with the keyword `impl`.
12981292
12991293
type Circle = {radius: float, center: Point};
13001294
1301-
impl Circle: Shape {
1295+
impl Shape for Circle {
13021296
fn draw(s: Surface) { do_draw_circle(s, self); }
13031297
fn bounding_box() -> BoundingBox {
13041298
let r = self.radius;
@@ -1309,9 +1303,9 @@ impl Circle: Shape {
13091303
~~~~
13101304

13111305
It is possible to define an implementation without referring to a trait.
1312-
The methods in such an implementation can only be used statically
1313-
(as direct calls on the values of the type that the implementation targets).
1314-
In such an implementation, the type after the colon is omitted.
1306+
The methods in such an implementation can only be used
1307+
as direct calls on the values of the type that the implementation targets.
1308+
In such an implementation, the trait type and `for` after `impl` are omitted.
13151309
Such implementations are limited to nominal types (enums, structs),
13161310
and the implementation must appear in the same module or a sub-module as the `self` type.
13171311

@@ -1326,10 +1320,10 @@ Implementation parameters are written after after the `impl` keyword.
13261320
~~~~
13271321
# trait Seq<T> { }
13281322
1329-
impl<T> ~[T]: Seq<T> {
1323+
impl<T> Seq<T> for ~[T] {
13301324
...
13311325
}
1332-
impl u32: Seq<bool> {
1326+
impl Seq<bool> for u32 {
13331327
/* Treat the integer as a sequence of bits */
13341328
}
13351329
~~~~
@@ -2807,7 +2801,7 @@ trait Printable {
28072801
fn to_str() -> ~str;
28082802
}
28092803
2810-
impl int: Printable {
2804+
impl Printable for int {
28112805
fn to_str() -> ~str { int::to_str(self) }
28122806
}
28132807
@@ -2850,7 +2844,7 @@ trait Printable {
28502844
fn make_string() -> ~str;
28512845
}
28522846
2853-
impl ~str: Printable {
2847+
impl Printable for ~str {
28542848
fn make_string() -> ~str { copy self }
28552849
}
28562850
~~~~~~~~

trunk/doc/tutorial.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ struct TimeBomb {
19091909
explosivity: uint
19101910
}
19111911
1912-
impl TimeBomb : Drop {
1912+
impl Drop for TimeBomb {
19131913
fn finalize(&self) {
19141914
for iter::repeat(self.explosivity) {
19151915
io::println("blam!");
@@ -1943,11 +1943,11 @@ and `&str`.
19431943

19441944
~~~~
19451945
# trait Printable { fn print(&self); }
1946-
impl int: Printable {
1946+
impl Printable for int {
19471947
fn print(&self) { io::println(fmt!("%d", *self)) }
19481948
}
19491949
1950-
impl &str: Printable {
1950+
impl Printable for &str {
19511951
fn print(&self) { io::println(*self) }
19521952
}
19531953
@@ -1966,7 +1966,7 @@ trait Seq<T> {
19661966
fn iter(&self, b: fn(v: &T));
19671967
}
19681968
1969-
impl<T> ~[T]: Seq<T> {
1969+
impl<T> Seq<T> for ~[T] {
19701970
fn len(&self) -> uint { vec::len(*self) }
19711971
fn iter(&self, b: fn(v: &T)) {
19721972
for vec::each(*self) |elt| { b(elt); }
@@ -1978,7 +1978,7 @@ The implementation has to explicitly declare the type parameter that
19781978
it binds, `T`, before using it to specify its trait type. Rust
19791979
requires this declaration because the `impl` could also, for example,
19801980
specify an implementation of `Seq<int>`. The trait type (appearing
1981-
after the colon in the `impl`) *refers* to a type, rather than
1981+
between `impl` and `for`) *refers* to a type, rather than
19821982
defining one.
19831983

19841984
The type parameters bound by a trait are in scope in each of the
@@ -2000,7 +2000,7 @@ trait Eq {
20002000
}
20012001
20022002
// In an impl, `self` refers just to the value of the receiver
2003-
impl int: Eq {
2003+
impl Eq for int {
20042004
fn equals(&self, other: &int) -> bool { *other == *self }
20052005
}
20062006
~~~~
@@ -2021,10 +2021,10 @@ trait Shape { static fn new(area: float) -> Self; }
20212021
struct Circle { radius: float }
20222022
struct Square { length: float }
20232023
2024-
impl Circle: Shape {
2024+
impl Shape for Circle {
20252025
static fn new(area: float) -> Circle { Circle { radius: sqrt(area / pi) } }
20262026
}
2027-
impl Square: Shape {
2027+
impl Shape for Square {
20282028
static fn new(area: float) -> Square { Square { length: sqrt(area) } }
20292029
}
20302030
@@ -2084,7 +2084,7 @@ However, consider this function:
20842084

20852085
~~~~
20862086
# type Circle = int; type Rectangle = int;
2087-
# impl int: Drawable { fn draw(&self) {} }
2087+
# impl Drawable for int { fn draw(&self) {} }
20882088
# fn new_circle() -> int { 1 }
20892089
trait Drawable { fn draw(&self); }
20902090
@@ -2120,9 +2120,8 @@ value to an object:
21202120
# fn new_rectangle() -> Rectangle { true }
21212121
# fn draw_all(shapes: &[@Drawable]) {}
21222122
2123-
impl Circle: Drawable { fn draw(&self) { ... } }
2124-
2125-
impl Rectangle: Drawable { fn draw(&self) { ... } }
2123+
impl Drawable for Circle { fn draw(&self) { ... } }
2124+
impl Drawable for Rectangle { fn draw(&self) { ... } }
21262125
21272126
let c: @Circle = @new_circle();
21282127
let r: @Rectangle = @new_rectangle();
@@ -2140,7 +2139,7 @@ for example, an `@Circle` may not be cast to an `~Drawable`.
21402139
~~~
21412140
# type Circle = int; type Rectangle = int;
21422141
# trait Drawable { fn draw(&self); }
2143-
# impl int: Drawable { fn draw(&self) {} }
2142+
# impl Drawable for int { fn draw(&self) {} }
21442143
# fn new_circle() -> int { 1 }
21452144
# fn new_rectangle() -> int { 2 }
21462145
// A managed object
@@ -2180,10 +2179,10 @@ Now, we can implement `Circle` on a type only if we also implement `Shape`.
21802179
# use float::sqrt;
21812180
# fn square(x: float) -> float { x * x }
21822181
struct CircleStruct { center: Point, radius: float }
2183-
impl CircleStruct: Circle {
2182+
impl Circle for CircleStruct {
21842183
fn radius(&self) -> float { sqrt(self.area() / pi) }
21852184
}
2186-
impl CircleStruct: Shape {
2185+
impl Shape for CircleStruct {
21872186
fn area(&self) -> float { pi * square(self.radius) }
21882187
}
21892188
~~~~
@@ -2215,8 +2214,8 @@ Likewise, supertrait methods may also be called on trait objects.
22152214
# use float::sqrt;
22162215
# struct Point { x: float, y: float }
22172216
# struct CircleStruct { center: Point, radius: float }
2218-
# impl CircleStruct: Circle { fn radius(&self) -> float { sqrt(self.area() / pi) } }
2219-
# impl CircleStruct: Shape { fn area(&self) -> float { pi * square(self.radius) } }
2217+
# impl Circle for CircleStruct { fn radius(&self) -> float { sqrt(self.area() / pi) } }
2218+
# impl Shape for CircleStruct { fn area(&self) -> float { pi * square(self.radius) } }
22202219
22212220
let concrete = @CircleStruct{center:Point{x:3f,y:4f},radius:5f};
22222221
let mycircle: Circle = concrete as @Circle;

trunk/mk/tests.mk

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ cleantestlibs:
103103
-name '*.dSYM' -o \
104104
-name '*.libaux' -o \
105105
-name '*.out' -o \
106-
-name '*.err' \
106+
-name '*.err' -o \
107+
-name '*.debugger.script' \
107108
| xargs rm -rf
108109

109110

@@ -170,6 +171,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
170171
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
171172
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
172173
check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
174+
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-exec \
173175
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
174176
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
175177

@@ -284,6 +286,7 @@ CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
284286
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
285287
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
286288
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
289+
DEBUGINFO_RS := $(wildcard $(S)src/test/debug-info/*.rs)
287290

288291
# perf tests are the same as bench tests only they run under
289292
# a performance monitor.
@@ -296,6 +299,7 @@ CFAIL_TESTS := $(CFAIL_RC) $(CFAIL_RS)
296299
BENCH_TESTS := $(BENCH_RS)
297300
PERF_TESTS := $(PERF_RS)
298301
PRETTY_TESTS := $(PRETTY_RS)
302+
DEBUGINFO_TESTS := $(DEBUGINFO_RS)
299303

300304
CTEST_SRC_BASE_rpass = run-pass
301305
CTEST_BUILD_BASE_rpass = run-pass
@@ -327,6 +331,15 @@ CTEST_BUILD_BASE_perf = perf
327331
CTEST_MODE_perf = run-pass
328332
CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
329333

334+
CTEST_SRC_BASE_debuginfo = debug-info
335+
CTEST_BUILD_BASE_debuginfo = debug-info
336+
CTEST_MODE_debuginfo = debug-info
337+
CTEST_RUNTOOL_debuginfo = $(CTEST_RUNTOOL)
338+
339+
ifeq ($(CFG_GDB),)
340+
CTEST_DISABLE_debuginfo = "no gdb found"
341+
endif
342+
330343
define DEF_CTEST_VARS
331344

332345
# All the per-stage build rules you might want to call from the
@@ -349,7 +362,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
349362
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X) \
350363
--aux-base $$(S)src/test/auxiliary/ \
351364
--stage-id stage$(1)-$(2) \
352-
--rustcflags "$$(CFG_RUSTC_FLAGS) --target=$(2)" \
365+
--rustcflags "$$(CFG_RUSTC_FLAGS) --target=$(2)" \
353366
$$(CTEST_TESTARGS)
354367

355368
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
@@ -358,6 +371,7 @@ CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
358371
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
359372
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
360373
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
374+
CTEST_DEPS_debuginfo_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_TESTS)
361375

362376
endef
363377

@@ -377,6 +391,8 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
377391

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

394+
ifeq ($$(CTEST_DISABLE_$(4)),)
395+
380396
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
381397
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
382398
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -386,9 +402,20 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
386402
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
387403
&& touch $$@
388404

405+
else
406+
407+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
408+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
409+
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
410+
@$$(call E, run $(4): $$<)
411+
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
412+
touch $$@
413+
414+
endif
415+
389416
endef
390417

391-
CTEST_NAMES = rpass rpass-full rfail cfail bench perf
418+
CTEST_NAMES = rpass rpass-full rfail cfail bench perf debuginfo
392419

393420
$(foreach host,$(CFG_TARGET_TRIPLES), \
394421
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
@@ -496,6 +523,7 @@ TEST_GROUPS = \
496523
cfail \
497524
bench \
498525
perf \
526+
debuginfo \
499527
doc \
500528
$(foreach docname,$(DOC_TEST_NAMES),$(docname)) \
501529
pretty \

trunk/src/compiletest/common.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
1+
// Copyright 2012-2013 The Rust Project Developers. See the
2+
// COPYRIGHT file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
55
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -18,6 +18,7 @@ pub enum mode {
1818
mode_run_fail,
1919
mode_run_pass,
2020
mode_pretty,
21+
mode_debug_info,
2122
}
2223

2324
pub type config = {

0 commit comments

Comments
 (0)