Skip to content

Commit aa1a4b2

Browse files
ericktgraydon
authored andcommitted
---
yaml --- r: 4737 b: refs/heads/master c: 21f46a1 h: refs/heads/master i: 4735: e82535e v: v3
1 parent 039bdc5 commit aa1a4b2

File tree

133 files changed

+300
-299
lines changed

Some content is hidden

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

133 files changed

+300
-299
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e4a0f997fb01b9cbb650532fea1278159faff064
2+
refs/heads/master: 21f46a1655f2a026546792546b07dec9e039ec54

trunk/src/test/bench/shootout-fannkuchredux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ fn fannkuch(n: int) -> int {
5959
fn main(args: [str]) {
6060
let n = 7;
6161
log #fmt("Pfannkuchen(%d) = %d", n, fannkuch(n));
62-
}
62+
}

trunk/src/test/bench/shootout-nbody.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn main() {
2727
}
2828

2929
// Body::props is a record of floats, so
30-
// vec[Body::props] is a vector of records of floats
30+
// vec<Body::props> is a vector of records of floats
3131

3232
mod NBodySystem {
3333

trunk/src/test/bench/shootout-pfib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ import std::comm::_chan;
2727
import std::comm::send;
2828

2929
fn fib(n: int) -> int {
30-
fn pfib(c: _chan[int], n: int) {
30+
fn pfib(c: _chan<int>, n: int) {
3131
if n == 0 {
3232
send(c, 0);
3333
} else if (n <= 2) {
3434
send(c, 1);
3535
} else {
36-
let p = mk_port[int]();
36+
let p = mk_port<int>();
3737

3838
let t1 = task::_spawn(bind pfib(p.mk_chan(), n - 1));
3939
let t2 = task::_spawn(bind pfib(p.mk_chan(), n - 2));

trunk/src/test/bench/task-perf-word-count.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,39 @@ mod map_reduce {
6363

6464
type mapper = fn(str, putter) ;
6565

66-
type getter = fn() -> option[int] ;
66+
type getter = fn() -> option<int> ;
6767

6868
type reducer = fn(str, getter) ;
6969

7070
tag ctrl_proto {
71-
find_reducer([u8], _chan[_chan[reduce_proto]]);
71+
find_reducer([u8], _chan<_chan<reduce_proto>>);
7272
mapper_done;
7373
}
7474

7575
tag reduce_proto { emit_val(int); done; ref; release; }
7676

77-
fn start_mappers(ctrl: _chan[ctrl_proto], inputs: &[str]) -> [task_id] {
77+
fn start_mappers(ctrl: _chan<ctrl_proto>, inputs: &[str]) -> [task_id] {
7878
let tasks = ~[];
7979
for i: str in inputs {
8080
tasks += ~[task::_spawn(bind map_task(ctrl, i))];
8181
}
8282
ret tasks;
8383
}
8484

85-
fn map_task(ctrl: _chan[ctrl_proto], input: str) {
85+
fn map_task(ctrl: _chan<ctrl_proto>, input: str) {
8686
// log_err "map_task " + input;
8787
let intermediates = map::new_str_hash();
8888

89-
fn emit(im: &map::hashmap[str, _chan[reduce_proto]],
90-
ctrl: _chan[ctrl_proto], key: str, val: int) {
89+
fn emit(im: &map::hashmap<str, _chan<reduce_proto>>,
90+
ctrl: _chan<ctrl_proto>, key: str, val: int) {
9191
let c;
9292
alt im.find(key) {
9393
some(_c) {
9494

9595
c = _c
9696
}
9797
none. {
98-
let p = mk_port[_chan[reduce_proto]]();
98+
let p = mk_port<_chan<reduce_proto>>();
9999
let keyi = str::bytes(key);
100100
send(ctrl, find_reducer(keyi, p.mk_chan()));
101101
c = p.recv();
@@ -108,24 +108,24 @@ mod map_reduce {
108108

109109
map(input, bind emit(intermediates, ctrl, _, _));
110110

111-
for each kv: @{key: str, val: _chan[reduce_proto]} in
111+
for each kv: @{key: str, val: _chan<reduce_proto>} in
112112
intermediates.items() {
113113
send(kv.val, release);
114114
}
115115

116116
send(ctrl, mapper_done);
117117
}
118118

119-
fn reduce_task(key: str, out: _chan[_chan[reduce_proto]]) {
119+
fn reduce_task(key: str, out: _chan<_chan<reduce_proto>>) {
120120
let p = mk_port();
121121

122122
send(out, p.mk_chan());
123123

124124
let ref_count = 0;
125125
let is_done = false;
126126

127-
fn get(p: &_port[reduce_proto], ref_count: &mutable int,
128-
is_done: &mutable bool) -> option[int] {
127+
fn get(p: &_port<reduce_proto>, ref_count: &mutable int,
128+
is_done: &mutable bool) -> option<int> {
129129
while !is_done || ref_count > 0 {
130130
alt p.recv() {
131131
emit_val(v) {
@@ -147,12 +147,12 @@ mod map_reduce {
147147
}
148148

149149
fn map_reduce(inputs: &[str]) {
150-
let ctrl = mk_port[ctrl_proto]();
150+
let ctrl = mk_port<ctrl_proto>();
151151

152152
// This task becomes the master control task. It task::_spawns
153153
// to do the rest.
154154

155-
let reducers: map::hashmap[str, _chan[reduce_proto]];
155+
let reducers: map::hashmap<str, _chan<reduce_proto>>;
156156

157157
reducers = map::new_str_hash();
158158

@@ -189,7 +189,7 @@ mod map_reduce {
189189
}
190190
}
191191

192-
for each kv: @{key: str, val: _chan[reduce_proto]} in reducers.items()
192+
for each kv: @{key: str, val: _chan<reduce_proto>} in reducers.items()
193193
{
194194
send(kv.val, done);
195195
}
@@ -225,7 +225,7 @@ fn main(argv: [str]) {
225225
log_err "MapReduce completed in " + u64::str(elapsed) + "ms";
226226
}
227227

228-
fn read_word(r: io::reader) -> option[str] {
228+
fn read_word(r: io::reader) -> option<str> {
229229
let w = "";
230230

231231
while !r.eof() {

trunk/src/test/compile-fail/bad-expr-path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
mod m1 { }
44

5-
fn main(args: [str]) { log m1::a; }
5+
fn main(args: [str]) { log m1::a; }

trunk/src/test/compile-fail/bad-expr-path2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ mod m1 {
44
mod a { }
55
}
66

7-
fn main(args: [str]) { log m1::a; }
7+
fn main(args: [str]) { log m1::a; }

trunk/src/test/compile-fail/for-loop-decl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std;
33
import std::map::hashmap;
44
import std::bitv;
55

6-
type fn_info = {vars: hashmap[uint, var_info]};
6+
type fn_info = {vars: hashmap<uint, var_info>};
77
type var_info = {a: uint, b: uint};
88

99
fn bitv_to_str(enclosing: fn_info, v: bitv::t) -> str {

trunk/src/test/compile-fail/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import zed::baz;
44
mod zed {
55
fn bar() { log "bar"; }
66
}
7-
fn main(args: [str]) { bar(); }
7+
fn main(args: [str]) { bar(); }

trunk/src/test/compile-fail/import2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ mod baz { }
44
mod zed {
55
fn bar() { log "bar3"; }
66
}
7-
fn main(args: [str]) { bar(); }
7+
fn main(args: [str]) { bar(); }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// error-pattern: unresolved modulename
22
import main::bar;
33

4-
fn main(args: [str]) { log "foo"; }
4+
fn main(args: [str]) { log "foo"; }

trunk/src/test/compile-fail/import4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import zed::bar;
44
import bar::zed;
55

6-
fn main(args: [str]) { log "loop"; }
6+
fn main(args: [str]) { log "loop"; }

trunk/src/test/compile-fail/infinite-vec-type-recursion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
type x = [x];
55

6-
fn main() { let b: x = ~[]; }
6+
fn main() { let b: x = ~[]; }
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// error-pattern:Attempt to use a type argument out of scope
22
fn hd[U](v: &[U]) -> U {
33
fn hd1(w: &[U]) -> U { ret w.(0); }
4+
45
ret hd1(v);
5-
}
6+
}

trunk/src/test/compile-fail/pattern-tyvar-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import std::option::some;
66

77
// error-pattern: mismatched types
88

9-
tag bar { t1((), option::t[[int]]); t2; }
9+
tag bar { t1((), option::t<[int]>); t2; }
1010

1111
fn foo(t: bar) -> int { alt t { t1(_, some(x)) { ret x * 3; } _ { fail; } } }
1212

13-
fn main() { }
13+
fn main() { }

trunk/src/test/compile-fail/pattern-tyvar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import std::option::some;
55

66
// error-pattern: mismatched types
77

8-
tag bar { t1((), option::t[[int]]); t2; }
8+
tag bar { t1((), option::t<[int]>); t2; }
99

1010
fn foo(t: bar) { alt t { t1(_, some[int](x)) { log x; } _ { fail; } } }
1111

12-
fn main() { }
12+
fn main() { }

trunk/src/test/compile-fail/vec-field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ fn f() {
66
log v.some_field_name; //type error
77
}
88

9-
fn main() { }
9+
fn main() { }

trunk/src/test/compile-fail/writing-through-uninit-vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
fn test() { let w: [int]; w.(5) = 0; }
44

5-
fn main() { test(); }
5+
fn main() { test(); }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// error-pattern:assignment to immutable vec content
2-
fn main() { let v: [int] = ~[1, 2, 3]; v.(1) = 4; }
2+
fn main() { let v: [int] = ~[1, 2, 3]; v.(1) = 4; }

trunk/src/test/compiletest/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ type config = {
2525
// Run ignored tests
2626
run_ignored: bool,
2727
// Only run tests that match this filter
28-
filter: option::t[str],
28+
filter: option::t<str>,
2929
// A command line to prefix program execution with,
3030
// for running under valgrind
31-
runtool: option::t[str],
31+
runtool: option::t<str>,
3232
// Flags to pass to the compiler
33-
rustcflags: option::t[str],
33+
rustcflags: option::t<str>,
3434
// Explain what's going on
3535
verbose: bool
3636
};

trunk/src/test/compiletest/compiletest.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ fn log_config(config: &config) {
8181
logv(c, #fmt("\n"));
8282
}
8383

84-
fn opt_str(maybestr: option::t[str]) -> str {
84+
fn opt_str(maybestr: option::t<str>) -> str {
8585
alt maybestr { option::some(s) { s } option::none. { "(none)" } }
8686
}
8787

88-
fn str_opt(maybestr: str) -> option::t[str] {
88+
fn str_opt(maybestr: str) -> option::t<str> {
8989
if maybestr != "(none)" { option::some(maybestr) } else { option::none }
9090
}
9191

@@ -125,7 +125,7 @@ type tests_and_conv_fn =
125125

126126
fn make_tests(cx: &cx) -> tests_and_conv_fn {
127127
log #fmt("making tests from %s", cx.config.src_base);
128-
let configport = mk_port[[u8]]();
128+
let configport = mk_port<[u8]>();
129129
let tests = ~[];
130130
for file: str in fs::list_dir(cx.config.src_base) {
131131
log #fmt("inspecting file %s", file);
@@ -158,7 +158,7 @@ fn is_test(config: &config, testfile: &str) -> bool {
158158
ret valid;
159159
}
160160

161-
fn make_test(cx: &cx, testfile: &str, configport: &_port[[u8]]) ->
161+
fn make_test(cx: &cx, testfile: &str, configport: &_port<[u8]>) ->
162162
test::test_desc {
163163
{name: make_test_name(cx.config, testfile),
164164
fn: make_test_closure(testfile, configport.mk_chan()),
@@ -188,12 +188,12 @@ up. Then we'll spawn that data into another task and return the task.
188188
Really convoluted. Need to think up of a better definition for tests.
189189
*/
190190

191-
fn make_test_closure(testfile: &str, configchan: _chan[[u8]]) -> test::test_fn
191+
fn make_test_closure(testfile: &str, configchan: _chan<[u8]>) -> test::test_fn
192192
{
193193
bind send_config(testfile, configchan)
194194
}
195195

196-
fn send_config(testfile: str, configchan: _chan[[u8]]) {
196+
fn send_config(testfile: str, configchan: _chan<[u8]>) {
197197
send(configchan, str::bytes(testfile));
198198
}
199199

@@ -207,7 +207,7 @@ break up the config record and pass everything individually to the spawned
207207
function.
208208
*/
209209

210-
fn closure_to_task(cx: cx, configport: _port[[u8]], testfn: &fn() ) -> task_id
210+
fn closure_to_task(cx: cx, configport: _port<[u8]>, testfn: &fn() ) -> task_id
211211
{
212212
testfn();
213213
let testfile = configport.recv();

trunk/src/test/compiletest/header.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ type test_props = {
1313
// Lines that should be expected, in order, on standard out
1414
error_patterns: [str],
1515
// Extra flags to pass to the compiler
16-
compile_flags: option::t[str],
16+
compile_flags: option::t<str>,
1717
// If present, the name of a file that this test should match when
1818
// pretty-printed
19-
pp_exact: option::t[str],
19+
pp_exact: option::t<str>,
2020
// FIXME: no-valgrind is a temporary directive until all of run-fail
2121
// is valgrind-clean
2222
no_valgrind: bool
@@ -82,15 +82,15 @@ iter iter_header(testfile: &str) -> str {
8282
}
8383
}
8484

85-
fn parse_error_pattern(line: &str) -> option::t[str] {
85+
fn parse_error_pattern(line: &str) -> option::t<str> {
8686
parse_name_value_directive(line, "error-pattern")
8787
}
8888

89-
fn parse_compile_flags(line: &str) -> option::t[str] {
89+
fn parse_compile_flags(line: &str) -> option::t<str> {
9090
parse_name_value_directive(line, "compile-flags")
9191
}
9292

93-
fn parse_pp_exact(line: &str, testfile: &str) -> option::t[str] {
93+
fn parse_pp_exact(line: &str, testfile: &str) -> option::t<str> {
9494
alt parse_name_value_directive(line, "pp-exact") {
9595
option::some(s) { option::some(s) }
9696
option::none. {
@@ -108,7 +108,7 @@ fn parse_name_directive(line: &str, directive: &str) -> bool {
108108
}
109109

110110
fn parse_name_value_directive(line: &str,
111-
directive: &str) -> option::t[str] {
111+
directive: &str) -> option::t<str> {
112112
let keycolon = directive + ":";
113113
if str::find(line, keycolon) >= 0 {
114114
let colon = str::find(line, keycolon) as uint;

0 commit comments

Comments
 (0)