diff options
| author | Graydon Hoare <[email protected]> | 2010-09-09 15:59:29 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-09-09 15:59:29 -0700 |
| commit | a9e2327a18e782df524c14dc42910d61a4785324 (patch) | |
| tree | 8763224ac3a4c11275dd64257aac47036c97c48d /src/test | |
| parent | Fixed lost signal notifications. (diff) | |
| download | rust-a9e2327a18e782df524c14dc42910d61a4785324.tar.xz rust-a9e2327a18e782df524c14dc42910d61a4785324.zip | |
Switch tags to purely nominal, removing TY_iso and TY_idx. Seems to mostly work, possibly a little bumpy. Changes a lot.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/alt-pattern-drop.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/alt-tag.rs | 10 | ||||
| -rw-r--r-- | src/test/run-pass/constrained-type.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/export-non-interference.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/generic-recursive-tag.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/generic-tag-alt.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/generic-tag-values.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/generic-tag.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/lib-deque.rs | 14 | ||||
| -rw-r--r-- | src/test/run-pass/list.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/mlist-cycle.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/mlist.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/mutual-recursion-group.rs | 23 | ||||
| -rw-r--r-- | src/test/run-pass/obj-return-polytypes.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/size-and-align.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/tag.rs | 5 |
16 files changed, 84 insertions, 26 deletions
diff --git a/src/test/run-pass/alt-pattern-drop.rs b/src/test/run-pass/alt-pattern-drop.rs index 68e4f13e..66b9ac8e 100644 --- a/src/test/run-pass/alt-pattern-drop.rs +++ b/src/test/run-pass/alt-pattern-drop.rs @@ -3,7 +3,10 @@ use std; import std._str; -type t = tag(make_t(str), clam()); +tag t { + make_t(str); + clam(); +} fn foo(str s) { let t x = make_t(s); // ref up diff --git a/src/test/run-pass/alt-tag.rs b/src/test/run-pass/alt-tag.rs index d40c4eec..be331265 100644 --- a/src/test/run-pass/alt-tag.rs +++ b/src/test/run-pass/alt-tag.rs @@ -1,10 +1,10 @@ // -*- rust -*- -type color = tag( - rgb(int, int, int), - rgba(int, int, int, int), - hsl(int, int, int) -); +tag color { + rgb(int, int, int); + rgba(int, int, int, int); + hsl(int, int, int); +} fn process(color c) -> int { let int x; diff --git a/src/test/run-pass/constrained-type.rs b/src/test/run-pass/constrained-type.rs index 88a39ec8..1fc6f49a 100644 --- a/src/test/run-pass/constrained-type.rs +++ b/src/test/run-pass/constrained-type.rs @@ -2,7 +2,11 @@ // Reported as issue #141, as a parse error. Ought to work in full though. -type list = tag(cons(int,@list), nil()); +tag list { + cons(int,@list); + nil(); +} + type bubu = rec(int x, int y); diff --git a/src/test/run-pass/export-non-interference.rs b/src/test/run-pass/export-non-interference.rs index c0f1843f..8529fa4b 100644 --- a/src/test/run-pass/export-non-interference.rs +++ b/src/test/run-pass/export-non-interference.rs @@ -1,6 +1,8 @@ export foo; -type list_cell[T] = tag(cons(@list_cell[T])); +tag list_cell[T] { + cons(@list_cell[T]); +} fn main() { } diff --git a/src/test/run-pass/generic-recursive-tag.rs b/src/test/run-pass/generic-recursive-tag.rs index 7cae581b..ad06345b 100644 --- a/src/test/run-pass/generic-recursive-tag.rs +++ b/src/test/run-pass/generic-recursive-tag.rs @@ -1,4 +1,7 @@ -type list[T] = tag(cons(@T, @list[T]), nil()); +tag list[T] { + cons(@T, @list[T]); + nil(); +} fn main() { let list[int] a = cons[int](10, cons[int](12, cons[int](13, nil[int]()))); diff --git a/src/test/run-pass/generic-tag-alt.rs b/src/test/run-pass/generic-tag-alt.rs index 1f4c5465..0442d490 100644 --- a/src/test/run-pass/generic-tag-alt.rs +++ b/src/test/run-pass/generic-tag-alt.rs @@ -1,4 +1,6 @@ -type foo[T] = tag(arm(T)); +tag foo[T] { + arm(T); +} fn altfoo[T](foo[T] f) { auto hit = false; diff --git a/src/test/run-pass/generic-tag-values.rs b/src/test/run-pass/generic-tag-values.rs index 19916f07..9691c964 100644 --- a/src/test/run-pass/generic-tag-values.rs +++ b/src/test/run-pass/generic-tag-values.rs @@ -1,6 +1,8 @@ // -*- rust -*- -type noption[T] = tag(some(T)); +tag noption[T] { + some(T); +} fn main() { let noption[int] nop = some[int](5); diff --git a/src/test/run-pass/generic-tag.rs b/src/test/run-pass/generic-tag.rs index 0e1c6a65..770e13e7 100644 --- a/src/test/run-pass/generic-tag.rs +++ b/src/test/run-pass/generic-tag.rs @@ -1,4 +1,7 @@ -type option[T] = tag(some(@T), none()); +tag option[T] { + some(@T); + none(); +} fn main() { let option[int] a = some[int](@10); diff --git a/src/test/run-pass/lib-deque.rs b/src/test/run-pass/lib-deque.rs index ecd8bc44..341811f3 100644 --- a/src/test/run-pass/lib-deque.rs +++ b/src/test/run-pass/lib-deque.rs @@ -126,11 +126,17 @@ fn test_parameterized[T](eqfn[T] e, T a, T b, T c, T d) { check (e(deq.get(3), d)); } -type taggy = tag(one(int), two(int, int), three(int, int, int)); +tag taggy { + one(int); + two(int, int); + three(int, int, int); +} -type taggypar[T] = tag(onepar(int), - twopar(int, int), - threepar(int, int, int)); +tag taggypar[T] { + onepar(int); + twopar(int, int); + threepar(int, int, int); +} type reccy = rec(int x, int y, taggy t); diff --git a/src/test/run-pass/list.rs b/src/test/run-pass/list.rs index c615b67c..5ea2bc2e 100644 --- a/src/test/run-pass/list.rs +++ b/src/test/run-pass/list.rs @@ -1,6 +1,9 @@ // -*- rust -*- -type list = tag(cons(int,@list), nil()); +tag list { + cons(int,@list); + nil(); +} fn main() { cons(10, @cons(11, @cons(12, @nil()))); diff --git a/src/test/run-pass/mlist-cycle.rs b/src/test/run-pass/mlist-cycle.rs index 09221ea3..5dedd3d0 100644 --- a/src/test/run-pass/mlist-cycle.rs +++ b/src/test/run-pass/mlist-cycle.rs @@ -3,7 +3,10 @@ use std; type cell = tup(mutable @list); -type list = tag(link(@cell), nil()); +tag list { + link(@cell); + nil(); +} fn main() { let @cell first = @tup(mutable @nil()); diff --git a/src/test/run-pass/mlist.rs b/src/test/run-pass/mlist.rs index c9bdb283..35b1c2db 100644 --- a/src/test/run-pass/mlist.rs +++ b/src/test/run-pass/mlist.rs @@ -1,6 +1,9 @@ // -*- rust -*- -type mlist = tag(cons(int,mutable @mlist), nil()); +tag mlist { + cons(int,mutable @mlist); + nil(); +} fn main() { cons(10, @cons(11, @cons(12, @nil()))); diff --git a/src/test/run-pass/mutual-recursion-group.rs b/src/test/run-pass/mutual-recursion-group.rs index 850858a3..2e36df70 100644 --- a/src/test/run-pass/mutual-recursion-group.rs +++ b/src/test/run-pass/mutual-recursion-group.rs @@ -1,10 +1,25 @@ // -*- rust -*- -type colour = tag(red(), green(), blue()); -type tree = tag(children(@list), leaf(colour)); -type list = tag(cons(@tree, @list), nil()); +tag colour { + red(); + green(); + blue(); +} + +tag tree { + children(@list); + leaf(colour); +} -type small_list = tag(kons(int,@small_list), neel()); +tag list { + cons(@tree, @list); + nil(); +} + +tag small_list { + kons(int,@small_list); + neel(); +} fn main() { } diff --git a/src/test/run-pass/obj-return-polytypes.rs b/src/test/run-pass/obj-return-polytypes.rs index 78897d7e..bb23a4b6 100644 --- a/src/test/run-pass/obj-return-polytypes.rs +++ b/src/test/run-pass/obj-return-polytypes.rs @@ -1,6 +1,9 @@ // -*- rust -*- -type clam[T] = tag(signed(int), unsigned(uint)); +tag clam[T] { + signed(int); + unsigned(uint); +} fn getclam[T]() -> clam[T] { ret signed[T](42); diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index 4da22558..19af75ed 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -1,6 +1,9 @@ // -*- rust -*- -type clam[T] = tag(a(T, int), b()); +tag clam[T] { + a(T, int); + b(); +} fn uhoh[T](vec[clam[T]] v) { alt (v.(1)) { diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index 0d345b2d..80012fd7 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -1,6 +1,9 @@ // -*- rust -*- -type colour = tag(red(int,int), green()); +tag colour { + red(int,int); + green(); +} fn f() { auto x = red(1,2); |