Skip to content

Commit b3eba15

Browse files
ericktgraydon
authored andcommitted
Port the tests to the expr foo::<T> syntax.
1 parent af21a27 commit b3eba15

File tree

88 files changed

+198
-190
lines changed

Some content is hidden

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

88 files changed

+198
-190
lines changed

src/test/bench/shootout-fasta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn select_random(r: u32, genelist: &[aminoacids]) -> char {
4040
} else { be bisect(v, mid, hi, target); }
4141
} else { ret v.(hi).ch; }
4242
}
43-
ret bisect(genelist, 0u, vec::len[aminoacids](genelist) - 1u, r);
43+
ret bisect(genelist, 0u, vec::len::<aminoacids>(genelist) - 1u, r);
4444
}
4545

4646
fn make_random_fasta(id: str, desc: str, genelist: &[aminoacids], n: int) {

src/test/bench/shootout-pfib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn fib(n: int) -> int {
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));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ mod map_reduce {
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();
@@ -147,7 +147,7 @@ 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.

src/test/compile-fail/bad-name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// error-pattern: expecting
22

33
fn main() {
4-
let x.y[int].z foo;
4+
let x.y::<int>.z foo;
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// error-pattern:mismatched types
22
// From Issue #778
33
tag clam<T> { a(T); }
4-
fn main() { let c; c = a(c); alt c { a[int](_) { } } }
4+
fn main() { let c; c = a(c); alt c { a::<int>(_) { } } }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import std::option::some;
77

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

10-
fn foo(t: bar) { alt t { t1(_, some[int](x)) { log x; } _ { fail; } } }
10+
fn foo(t: bar) { alt t { t1(_, some::<int>(x)) { log x; } _ { fail; } } }
1111

1212
fn main() { }

src/test/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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);

src/test/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn close(handle: &handle) {
6060
fn run(handle: &handle, lib_path: &str,
6161
prog: &str, args: &[str], input: &option::t<str>) ->
6262
{status: int, out: str, err: str} {
63-
let p = mk_port<response>();
63+
let p = mk_port::<response>();
6464
let ch = p.mk_chan();
6565
send(handle.chan, exec(str::bytes(lib_path),
6666
str::bytes(prog),

src/test/run-fail/alt-bot-fail.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import std::option::*;
77
fn foo(s: str) { }
88

99
fn main() {
10-
let i = alt some[int](3) { none[int]. { fail } some[int](_) { fail } };
10+
let i = alt some::<int>(3) {
11+
none::<int>. { fail }
12+
some::<int>(_) { fail }
13+
};
1114
foo(i);
12-
}
15+
}

src/test/run-fail/linked-failure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import std::comm::mk_port;
1010
fn child() { assert (1 == 2); }
1111

1212
fn main() {
13-
let p = mk_port[int]();
13+
let p = mk_port::<int>();
1414
task::_spawn(bind child());
1515
let x = p.recv();
1616
}

src/test/run-fail/port-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import std::comm::send;
77
fn echo<~T>(c: _chan<T>, oc: _chan<_chan<T>>) {
88
// Tests that the type argument in port gets
99
// visited
10-
let p = mk_port[T]();
10+
let p = mk_port::<T>();
1111
send(oc, p.mk_chan());
1212

1313
let x = p.recv();

src/test/run-pass/alias-uninit-value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ fn mk_raw_ty(st: sty, cname: &option::t<str>) -> raw_t {
1313
ret {struct: st, cname: cname, hash: 0u};
1414
}
1515

16-
fn main() { mk_raw_ty(ty_nil, none[str]); }
16+
fn main() { mk_raw_ty(ty_nil, none::<str>); }

src/test/run-pass/alt-bot.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ use std;
22
import std::option::*;
33

44
fn main() {
5-
let i: int = alt some[int](3) { none[int]. { fail } some[int](_) { 5 } };
5+
let i: int = alt some::<int>(3) {
6+
none::<int>. { fail }
7+
some::<int>(_) { 5 }
8+
};
69
log i;
7-
}
10+
}

src/test/run-pass/alt-join.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fn foo<T>(y: &option::t<T>) {
1212
entire if expression */
1313

1414
if true {
15-
} else { alt y { none[T]. { x = 17; } _ { x = 42; } } rs += ~[x]; }
15+
} else { alt y { none::<T>. { x = 17; } _ { x = 42; } } rs += ~[x]; }
1616
ret;
1717
}
1818

19-
fn main() { log "hello"; foo[int](some[int](5)); }
19+
fn main() { log "hello"; foo::<int>(some::<int>(5)); }

src/test/run-pass/binops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ fn test_box() {
6161
}
6262

6363
fn test_port() {
64-
let p1 = comm::mk_port[int]();
65-
let p2 = comm::mk_port[int]();
64+
let p1 = comm::mk_port::<int>();
65+
let p2 = comm::mk_port::<int>();
6666

6767
assert p1 == p1;
6868
assert p1 != p2;

src/test/run-pass/box-unbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ fn main() {
88
let foo: int = 17;
99
let bfoo: box<int> = {c: @foo};
1010
log "see what's in our box";
11-
assert (unbox[int](bfoo) == foo);
11+
assert (unbox::<int>(bfoo) == foo);
1212
}

src/test/run-pass/chan-leak.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn new() -> ctx {
3434
fn main() {
3535
let cx = new();
3636

37-
let p = mk_port<bool>();
37+
let p = mk_port::<bool>();
3838
send(cx, close(p.mk_chan()));
3939
send(cx, quit);
4040
}

src/test/run-pass/drop-parametric-closure-with-bound-box.rs

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

33
fn f<T>(i: @int, t: &T) { }
44

5-
fn main() { let x = bind f[char](@0xdeafbeef, _); }
5+
fn main() { let x = bind f::<char>(@0xdeafbeef, _); }

src/test/run-pass/expr-alt-generic-box1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_generic<T>(expected: @T, eq: &compare<T>) {
1212
fn test_box() {
1313
fn compare_box(b1: @bool, b2: @bool) -> bool { ret *b1 == *b2; }
1414
let eq = bind compare_box(_, _);
15-
test_generic[bool](@true, eq);
15+
test_generic::<bool>(@true, eq);
1616
}
1717

1818
fn main() { test_box(); }

src/test/run-pass/expr-alt-generic-box2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_generic<T>(expected: &T, eq: &compare<T>) {
1212
fn test_vec() {
1313
fn compare_box(v1: &@int, v2: &@int) -> bool { ret v1 == v2; }
1414
let eq = bind compare_box(_, _);
15-
test_generic[@int](@1, eq);
15+
test_generic::<@int>(@1, eq);
1616
}
1717

1818
fn main() { test_vec(); }

src/test/run-pass/expr-alt-generic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ fn test_generic<T>(expected: &T, eq: &compare<T>) {
1212
fn test_bool() {
1313
fn compare_bool(b1: &bool, b2: &bool) -> bool { ret b1 == b2; }
1414
let eq = bind compare_bool(_, _);
15-
test_generic[bool](true, eq);
15+
test_generic::<bool>(true, eq);
1616
}
1717

1818
fn test_rec() {
1919
type t = {a: int, b: int};
2020

2121
fn compare_rec(t1: &t, t2: &t) -> bool { ret t1 == t2; }
2222
let eq = bind compare_rec(_, _);
23-
test_generic[t]({a: 1, b: 2}, eq);
23+
test_generic::<t>({a: 1, b: 2}, eq);
2424
}
2525

2626
fn main() { test_bool(); test_rec(); }

src/test/run-pass/expr-block-generic-box1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn test_box() {
1616
ret *b1 == *b2;
1717
}
1818
let eq = bind compare_box(_, _);
19-
test_generic[bool](@true, eq);
19+
test_generic::<bool>(@true, eq);
2020
}
2121

2222
fn main() { test_box(); }

src/test/run-pass/expr-block-generic-box2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_generic<T>(expected: &T, eq: &compare<T>) {
1212
fn test_vec() {
1313
fn compare_vec(v1: &@int, v2: &@int) -> bool { ret v1 == v2; }
1414
let eq = bind compare_vec(_, _);
15-
test_generic[@int](@1, eq);
15+
test_generic::<@int>(@1, eq);
1616
}
1717

1818
fn main() { test_vec(); }

src/test/run-pass/expr-block-generic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ fn test_generic<T>(expected: &T, eq: &compare<T>) {
1414
fn test_bool() {
1515
fn compare_bool(b1: &bool, b2: &bool) -> bool { ret b1 == b2; }
1616
let eq = bind compare_bool(_, _);
17-
test_generic[bool](true, eq);
17+
test_generic::<bool>(true, eq);
1818
}
1919

2020
fn test_rec() {
2121
type t = {a: int, b: int};
2222

2323
fn compare_rec(t1: &t, t2: &t) -> bool { ret t1 == t2; }
2424
let eq = bind compare_rec(_, _);
25-
test_generic[t]({a: 1, b: 2}, eq);
25+
test_generic::<t>({a: 1, b: 2}, eq);
2626
}
2727

2828
fn main() { test_bool(); test_rec(); }

src/test/run-pass/expr-if-generic-box1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_generic<T>(expected: @T, not_expected: @T, eq: &compare<T>) {
1212
fn test_box() {
1313
fn compare_box(b1: @bool, b2: @bool) -> bool { ret *b1 == *b2; }
1414
let eq = bind compare_box(_, _);
15-
test_generic[bool](@true, @false, eq);
15+
test_generic::<bool>(@true, @false, eq);
1616
}
1717

1818
fn main() { test_box(); }

src/test/run-pass/expr-if-generic-box2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_generic<T>(expected: &T, not_expected: &T, eq: &compare<T>) {
1212
fn test_vec() {
1313
fn compare_box(v1: &@int, v2: &@int) -> bool { ret v1 == v2; }
1414
let eq = bind compare_box(_, _);
15-
test_generic[@int](@1, @2, eq);
15+
test_generic::<@int>(@1, @2, eq);
1616
}
1717

1818
fn main() { test_vec(); }

src/test/run-pass/expr-if-generic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ fn test_generic<T>(expected: &T, not_expected: &T, eq: &compare<T>) {
1414
fn test_bool() {
1515
fn compare_bool(b1: &bool, b2: &bool) -> bool { ret b1 == b2; }
1616
let eq = bind compare_bool(_, _);
17-
test_generic[bool](true, false, eq);
17+
test_generic::<bool>(true, false, eq);
1818
}
1919

2020
fn test_rec() {
2121
type t = {a: int, b: int};
2222

2323
fn compare_rec(t1: &t, t2: &t) -> bool { ret t1 == t2; }
2424
let eq = bind compare_rec(_, _);
25-
test_generic[t]({a: 1, b: 2}, {a: 2, b: 3}, eq);
25+
test_generic::<t>({a: 1, b: 2}, {a: 2, b: 3}, eq);
2626
}
2727

2828
fn main() { test_bool(); test_rec(); }

src/test/run-pass/foreach-box-drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ obj ob<K>(k: K) {
66

77
fn x(o: &ob<str>) { for each i: @{a: str} in o.foo() { } }
88

9-
fn main() { let o = ob[str]("hi" + "there"); x(o); }
9+
fn main() { let o = ob::<str>("hi" + "there"); x(o); }

src/test/run-pass/generic-alias-box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn id<T>(t: &T) -> T { ret t; }
44

55
fn main() {
66
let expected = @100;
7-
let actual = id[@int](expected);
7+
let actual = id::<@int>(expected);
88
log *actual;
99
assert (*expected == *actual);
1010
}

src/test/run-pass/generic-bind.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ fn main() {
66
let t = {_0: 1, _1: 2, _2: 3, _3: 4, _4: 5, _5: 6, _6: 7};
77
assert (t._5 == 6);
88
let f1 =
9-
bind id[{_0: int,
10-
_1: int,
11-
_2: int,
12-
_3: int,
13-
_4: int,
14-
_5: int,
15-
_6: int}](_);
9+
bind id::<{_0: int,
10+
_1: int,
11+
_2: int,
12+
_3: int,
13+
_4: int,
14+
_5: int,
15+
_6: int}>(_);
1616
assert (f1(t)._5 == 6);
1717
}

src/test/run-pass/generic-box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
fn box<T>(x: &{x: T, y: T, z: T}) -> @{x: T, y: T, z: T} { ret @x; }
44

55
fn main() {
6-
let x: @{x: int, y: int, z: int} = box[int]({x: 1, y: 2, z: 3});
6+
let x: @{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});
77
assert (x.y == 2);
88
}

src/test/run-pass/generic-derived-type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ fn f<T>(t: &T) -> {a: T, b: T} {
66
type pair = {a: T, b: T};
77

88
let x: pair = {a: t, b: t};
9-
ret g[pair](x);
9+
ret g::<pair>(x);
1010
}
1111

1212
fn main() {
13-
let b = f[int](10);
13+
let b = f::<int>(10);
1414
log b.a;
1515
log b.b;
1616
assert (b.a == 10);

src/test/run-pass/generic-exterior-box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ fn reclift<T>(t: &T) -> recbox<T> { ret {x: @t}; }
66

77
fn main() {
88
let foo: int = 17;
9-
let rbfoo: recbox<int> = reclift[int](foo);
9+
let rbfoo: recbox<int> = reclift::<int>(foo);
1010
assert (*rbfoo.x == foo);
1111
}

src/test/run-pass/generic-fn-twice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ mod foomod {
66
fn foo<T>() { }
77
}
88

9-
fn main() { foomod::foo[int](); foomod::foo[int](); }
9+
fn main() { foomod::foo::<int>(); foomod::foo::<int>(); }

src/test/run-pass/generic-fn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ fn main() {
1313
let b = 'b';
1414
let p: triple = {x: 65, y: 66, z: 67};
1515
let q: triple = {x: 68, y: 69, z: 70};
16-
y = id[int](x);
16+
y = id::<int>(x);
1717
log y;
1818
assert (x == y);
19-
b = id[char](a);
19+
b = id::<char>(a);
2020
log b;
2121
assert (a == b);
22-
q = id[triple](p);
22+
q = id::<triple>(p);
2323
x = p.z;
2424
y = q.z;
2525
log y;

src/test/run-pass/generic-obj-with-derived-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ obj handle<T>(data: T) {
77
fn main() {
88
type rgb = {x: u8, y: u8, z: u8};
99

10-
let h: handle<rgb> = handle[rgb]({x: 1 as u8, y: 2 as u8, z: 3 as u8});
10+
let h: handle<rgb> = handle::<rgb>({x: 1 as u8, y: 2 as u8, z: 3 as u8});
1111
log "constructed object";
1212
log h.get().x;
1313
log h.get().y;

src/test/run-pass/generic-obj.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ obj buf<T>(data: {_0: T, _1: T, _2: T}) {
1111
}
1212

1313
fn main() {
14-
let b: buf<int> = buf[int]({_0: 1, _1: 2, _2: 3});
14+
let b: buf<int> = buf::<int>({_0: 1, _1: 2, _2: 3});
1515
log "constructed object";
1616
log b.get(0);
1717
log b.get(1);

src/test/run-pass/generic-recursive-tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ tag list<T> { cons(@T, @list<T>); nil; }
44

55
fn main() {
66
let a: list<int> =
7-
cons[int](@10, @cons[int](@12, @cons[int](@13, @nil[int])));
7+
cons::<int>(@10, @cons::<int>(@12, @cons::<int>(@13, @nil::<int>)));
88
}

0 commit comments

Comments
 (0)