Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
3333fef1
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3333fef1
编写于
1月 19, 2012
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: "tag" -> "enum" in run-pass and run-fail
上级
1461cfe4
变更
76
隐藏空白更改
内联
并排
Showing
76 changed file
with
84 addition
and
84 deletion
+84
-84
src/test/run-fail/non-exhaustive-match.rs
src/test/run-fail/non-exhaustive-match.rs
+1
-1
src/test/run-pass/alias-uninit-value.rs
src/test/run-pass/alias-uninit-value.rs
+1
-1
src/test/run-pass/alloca-from-derived-tydesc.rs
src/test/run-pass/alloca-from-derived-tydesc.rs
+1
-1
src/test/run-pass/alt-path.rs
src/test/run-pass/alt-path.rs
+1
-1
src/test/run-pass/alt-pattern-drop.rs
src/test/run-pass/alt-pattern-drop.rs
+1
-1
src/test/run-pass/alt-pattern-no-type-params.rs
src/test/run-pass/alt-pattern-no-type-params.rs
+1
-1
src/test/run-pass/alt-phi.rs
src/test/run-pass/alt-phi.rs
+1
-1
src/test/run-pass/alt-str.rs
src/test/run-pass/alt-str.rs
+1
-1
src/test/run-pass/alt-tag.rs
src/test/run-pass/alt-tag.rs
+1
-1
src/test/run-pass/box-pattern.rs
src/test/run-pass/box-pattern.rs
+1
-1
src/test/run-pass/chan-leak.rs
src/test/run-pass/chan-leak.rs
+1
-1
src/test/run-pass/conditional-compile.rs
src/test/run-pass/conditional-compile.rs
+2
-2
src/test/run-pass/constrained-type.rs
src/test/run-pass/constrained-type.rs
+1
-1
src/test/run-pass/cycle-collection.rs
src/test/run-pass/cycle-collection.rs
+1
-1
src/test/run-pass/drop-on-empty-block-exit.rs
src/test/run-pass/drop-on-empty-block-exit.rs
+1
-1
src/test/run-pass/empty-tag.rs
src/test/run-pass/empty-tag.rs
+1
-1
src/test/run-pass/export-abstract-tag.rs
src/test/run-pass/export-abstract-tag.rs
+1
-1
src/test/run-pass/export-non-interference.rs
src/test/run-pass/export-non-interference.rs
+1
-1
src/test/run-pass/export-tag-variant.rs
src/test/run-pass/export-tag-variant.rs
+2
-2
src/test/run-pass/export-unexported-dep.rs
src/test/run-pass/export-unexported-dep.rs
+1
-1
src/test/run-pass/expr-alt-struct.rs
src/test/run-pass/expr-alt-struct.rs
+1
-1
src/test/run-pass/expr-if-struct.rs
src/test/run-pass/expr-if-struct.rs
+1
-1
src/test/run-pass/generic-ivec-leak.rs
src/test/run-pass/generic-ivec-leak.rs
+1
-1
src/test/run-pass/generic-recursive-tag.rs
src/test/run-pass/generic-recursive-tag.rs
+1
-1
src/test/run-pass/generic-tag-alt.rs
src/test/run-pass/generic-tag-alt.rs
+1
-1
src/test/run-pass/generic-tag-corruption.rs
src/test/run-pass/generic-tag-corruption.rs
+1
-1
src/test/run-pass/generic-tag-local.rs
src/test/run-pass/generic-tag-local.rs
+1
-1
src/test/run-pass/generic-tag-values.rs
src/test/run-pass/generic-tag-values.rs
+1
-1
src/test/run-pass/generic-tag.rs
src/test/run-pass/generic-tag.rs
+1
-1
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/hashmap-memory.rs
+1
-1
src/test/run-pass/iface-cast.rs
src/test/run-pass/iface-cast.rs
+1
-1
src/test/run-pass/init-res-into-things.rs
src/test/run-pass/init-res-into-things.rs
+2
-2
src/test/run-pass/issue-687.rs
src/test/run-pass/issue-687.rs
+1
-1
src/test/run-pass/issue-970.rs
src/test/run-pass/issue-970.rs
+1
-1
src/test/run-pass/issue-980.rs
src/test/run-pass/issue-980.rs
+1
-1
src/test/run-pass/leak-tag-copy.rs
src/test/run-pass/leak-tag-copy.rs
+1
-1
src/test/run-pass/let-destruct.rs
src/test/run-pass/let-destruct.rs
+1
-1
src/test/run-pass/list.rs
src/test/run-pass/list.rs
+1
-1
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
+1
-1
src/test/run-pass/log-knows-the-names-of-variants.rs
src/test/run-pass/log-knows-the-names-of-variants.rs
+1
-1
src/test/run-pass/log-linearized.rs
src/test/run-pass/log-linearized.rs
+1
-1
src/test/run-pass/mlist-cycle.rs
src/test/run-pass/mlist-cycle.rs
+1
-1
src/test/run-pass/mlist.rs
src/test/run-pass/mlist.rs
+1
-1
src/test/run-pass/mutual-recursion-group.rs
src/test/run-pass/mutual-recursion-group.rs
+4
-4
src/test/run-pass/nested-pattern.rs
src/test/run-pass/nested-pattern.rs
+1
-1
src/test/run-pass/newtype-polymorphic.rs
src/test/run-pass/newtype-polymorphic.rs
+1
-1
src/test/run-pass/newtype.rs
src/test/run-pass/newtype.rs
+1
-1
src/test/run-pass/non-boolean-pure-fns.rs
src/test/run-pass/non-boolean-pure-fns.rs
+1
-1
src/test/run-pass/nullary-or-pattern.rs
src/test/run-pass/nullary-or-pattern.rs
+1
-1
src/test/run-pass/or-pattern.rs
src/test/run-pass/or-pattern.rs
+1
-1
src/test/run-pass/record-pat.rs
src/test/run-pass/record-pat.rs
+2
-2
src/test/run-pass/resource-in-struct.rs
src/test/run-pass/resource-in-struct.rs
+1
-1
src/test/run-pass/ret-none.rs
src/test/run-pass/ret-none.rs
+1
-1
src/test/run-pass/shadow.rs
src/test/run-pass/shadow.rs
+1
-1
src/test/run-pass/shape_intrinsic_tag_then_rec.rs
src/test/run-pass/shape_intrinsic_tag_then_rec.rs
+2
-2
src/test/run-pass/simple-alt-generic-tag.rs
src/test/run-pass/simple-alt-generic-tag.rs
+1
-1
src/test/run-pass/simple-generic-alt.rs
src/test/run-pass/simple-generic-alt.rs
+1
-1
src/test/run-pass/simple-generic-tag.rs
src/test/run-pass/simple-generic-tag.rs
+1
-1
src/test/run-pass/size-and-align.rs
src/test/run-pass/size-and-align.rs
+1
-1
src/test/run-pass/structured-compare-recursive.rs
src/test/run-pass/structured-compare-recursive.rs
+1
-1
src/test/run-pass/structured-compare.rs
src/test/run-pass/structured-compare.rs
+1
-1
src/test/run-pass/tag-disr-val-shape.rs
src/test/run-pass/tag-disr-val-shape.rs
+1
-1
src/test/run-pass/tag-in-block.rs
src/test/run-pass/tag-in-block.rs
+1
-1
src/test/run-pass/tag-variant-disr-val.rs
src/test/run-pass/tag-variant-disr-val.rs
+1
-1
src/test/run-pass/tag.rs
src/test/run-pass/tag.rs
+1
-1
src/test/run-pass/task-comm-16.rs
src/test/run-pass/task-comm-16.rs
+1
-1
src/test/run-pass/unchecked-predicates.rs
src/test/run-pass/unchecked-predicates.rs
+1
-1
src/test/run-pass/uniq-cc-generic.rs
src/test/run-pass/uniq-cc-generic.rs
+1
-1
src/test/run-pass/uniq-cc.rs
src/test/run-pass/uniq-cc.rs
+1
-1
src/test/run-pass/unique-containing-tag.rs
src/test/run-pass/unique-containing-tag.rs
+1
-1
src/test/run-pass/unique-in-tag.rs
src/test/run-pass/unique-in-tag.rs
+1
-1
src/test/run-pass/unique-pat-2.rs
src/test/run-pass/unique-pat-2.rs
+1
-1
src/test/run-pass/unique-pat-3.rs
src/test/run-pass/unique-pat-3.rs
+1
-1
src/test/run-pass/use-uninit-alt.rs
src/test/run-pass/use-uninit-alt.rs
+1
-1
src/test/run-pass/use-uninit-alt2.rs
src/test/run-pass/use-uninit-alt2.rs
+1
-1
src/test/run-pass/while-prelude-drop.rs
src/test/run-pass/while-prelude-drop.rs
+1
-1
未找到文件。
src/test/run-fail/non-exhaustive-match.rs
浏览文件 @
3333fef1
...
...
@@ -4,6 +4,6 @@
// -*- rust -*-
// error-pattern:non-exhaustive match failure
tag
t
{
a
;
b
;
}
enum
t
{
a
;
b
;
}
fn
main
()
{
let
x
=
a
;
alt
x
{
b
{
}
}
}
src/test/run-pass/alias-uninit-value.rs
浏览文件 @
3333fef1
...
...
@@ -5,7 +5,7 @@
import
option
;
import
option
::
none
;
tag
sty
{
ty_nil
;
}
enum
sty
{
ty_nil
;
}
type
raw_t
=
{
struct
:
sty
,
cname
:
option
::
t
<
str
>
,
hash
:
uint
};
...
...
src/test/run-pass/alloca-from-derived-tydesc.rs
浏览文件 @
3333fef1
tag
option
<
T
>
{
some
(
T
);
none
;
}
enum
option
<
T
>
{
some
(
T
);
none
;
}
type
r
<
T
>
=
{
mutable
v
:
[
option
<
T
>
]};
...
...
src/test/run-pass/alt-path.rs
浏览文件 @
3333fef1
mod
m1
{
tag
foo
{
foo1
;
foo2
;
}
enum
foo
{
foo1
;
foo2
;
}
}
fn
bar
(
x
:
m1
::
foo
)
{
alt
x
{
m1
::
foo1
{
}
}
}
...
...
src/test/run-pass/alt-pattern-drop.rs
浏览文件 @
3333fef1
...
...
@@ -5,7 +5,7 @@
import
std
::
dbg
;
tag
t
{
make_t
(
@
int
);
clam
;
}
enum
t
{
make_t
(
@
int
);
clam
;
}
fn
foo
(
s
:
@
int
)
{
let
count
=
dbg
::
refcount
(
s
);
...
...
src/test/run-pass/alt-pattern-no-type-params.rs
浏览文件 @
3333fef1
tag
maybe
<
T
>
{
nothing
;
just
(
T
);
}
enum
maybe
<
T
>
{
nothing
;
just
(
T
);
}
fn
foo
(
x
:
maybe
<
int
>
)
{
alt
x
{
nothing
{
#
error
(
"A"
);
}
just
(
a
)
{
#
error
(
"B"
);
}
}
...
...
src/test/run-pass/alt-phi.rs
浏览文件 @
3333fef1
tag
thing
{
a
;
b
;
c
;
}
enum
thing
{
a
;
b
;
c
;
}
fn
foo
(
it
:
block
(
int
))
{
it
(
10
);
}
...
...
src/test/run-pass/alt-str.rs
浏览文件 @
3333fef1
...
...
@@ -3,7 +3,7 @@
fn
main
()
{
alt
"test"
{
"not-test"
{
fail
;
}
"test"
{
}
_
{
fail
;
}
}
tag
t
{
tag1
(
str
);
tag2
;
}
enum
t
{
tag1
(
str
);
tag2
;
}
alt
tag1
(
"test"
)
{
...
...
src/test/run-pass/alt-tag.rs
浏览文件 @
3333fef1
...
...
@@ -2,7 +2,7 @@
// -*- rust -*-
tag
color
{
enum
color
{
rgb
(
int
,
int
,
int
);
rgba
(
int
,
int
,
int
,
int
);
hsl
(
int
,
int
,
int
);
...
...
src/test/run-pass/box-pattern.rs
浏览文件 @
3333fef1
type
foo
=
{
a
:
int
,
b
:
uint
};
tag
bar
{
u
(
@
foo
);
w
(
int
);
}
enum
bar
{
u
(
@
foo
);
w
(
int
);
}
fn
main
()
{
assert
(
alt
u
(
@
{
a
:
10
,
b
:
40u
})
{
...
...
src/test/run-pass/chan-leak.rs
浏览文件 @
3333fef1
...
...
@@ -8,7 +8,7 @@
import
comm
::
port
;
import
comm
::
recv
;
tag
request
{
quit
;
close
(
chan
<
bool
>
);
}
enum
request
{
quit
;
close
(
chan
<
bool
>
);
}
type
ctx
=
chan
<
request
>
;
...
...
src/test/run-pass/conditional-compile.rs
浏览文件 @
3333fef1
...
...
@@ -20,9 +20,9 @@
type
t
=
bool
;
#[cfg(bogus)]
tag
tg
{
foo
;
}
enum
tg
{
foo
;
}
tag
tg
{
bar
;
}
enum
tg
{
bar
;
}
#[cfg(bogus)]
resource
r
(
i
:
int
)
{
}
...
...
src/test/run-pass/constrained-type.rs
浏览文件 @
3333fef1
// -*- rust -*-
tag
list
{
cons
(
int
,
@
list
);
nil
;
}
enum
list
{
cons
(
int
,
@
list
);
nil
;
}
type
bubu
=
{
x
:
int
,
y
:
int
};
...
...
src/test/run-pass/cycle-collection.rs
浏览文件 @
3333fef1
tag
taggy
{
enum
taggy
{
cons
(
@
mutable
taggy
);
nil
;
}
...
...
src/test/run-pass/drop-on-empty-block-exit.rs
浏览文件 @
3333fef1
tag
t
{
foo
(
@
int
);
}
enum
t
{
foo
(
@
int
);
}
fn
main
()
{
let
tt
=
foo
(
@
10
);
alt
tt
{
foo
(
z
)
{
}
}
}
src/test/run-pass/empty-tag.rs
浏览文件 @
3333fef1
tag
chan
{
chan_t
;
}
enum
chan
{
chan_t
;
}
fn
wrapper3
(
i
:
chan
)
{
assert
i
==
chan_t
;
...
...
src/test/run-pass/export-abstract-tag.rs
浏览文件 @
3333fef1
...
...
@@ -5,7 +5,7 @@ mod foo {
export
t
;
export
f
;
tag
t
{
t1
;
}
enum
t
{
t1
;
}
fn
f
()
->
t
{
ret
t1
;
}
}
...
...
src/test/run-pass/export-non-interference.rs
浏览文件 @
3333fef1
...
...
@@ -2,6 +2,6 @@
export
foo
;
export
main
;
tag
list_cell
<
T
>
{
cons
(
@
list_cell
<
T
>
);
}
enum
list_cell
<
T
>
{
cons
(
@
list_cell
<
T
>
);
}
fn
main
()
{
}
src/test/run-pass/export-tag-variant.rs
浏览文件 @
3333fef1
// Export the
tag variants, without the tag
// Export the
enum variants, without the enum
mod
foo
{
export
t1
;
tag
t
{
t1
;
}
enum
t
{
t1
;
}
}
fn
main
()
{
let
v
=
foo
::
t1
;
}
src/test/run-pass/export-unexported-dep.rs
浏览文件 @
3333fef1
...
...
@@ -6,7 +6,7 @@ mod foo {
export
g
;
// not exported
tag
t
{
t1
;
t2
;
}
enum
t
{
t1
;
t2
;
}
fn
f
()
->
t
{
ret
t1
;
}
...
...
src/test/run-pass/expr-alt-struct.rs
浏览文件 @
3333fef1
...
...
@@ -10,7 +10,7 @@ fn test_rec() {
}
fn
test_tag
()
{
tag
mood
{
happy
;
sad
;
}
enum
mood
{
happy
;
sad
;
}
let
rs
=
alt
true
{
true
{
happy
}
false
{
sad
}
};
assert
(
rs
==
happy
);
}
...
...
src/test/run-pass/expr-if-struct.rs
浏览文件 @
3333fef1
...
...
@@ -10,7 +10,7 @@ fn test_rec() {
}
fn
test_tag
()
{
tag
mood
{
happy
;
sad
;
}
enum
mood
{
happy
;
sad
;
}
let
rs
=
if
true
{
happy
}
else
{
sad
};
assert
(
rs
==
happy
);
}
...
...
src/test/run-pass/generic-ivec-leak.rs
浏览文件 @
3333fef1
tag
wrapper
<
T
>
{
wrapped
(
T
);
}
enum
wrapper
<
T
>
{
wrapped
(
T
);
}
fn
main
()
{
let
w
=
wrapped
([
1
,
2
,
3
,
4
,
5
]);
}
src/test/run-pass/generic-recursive-tag.rs
浏览文件 @
3333fef1
tag
list
<
T
>
{
cons
(
@
T
,
@
list
<
T
>
);
nil
;
}
enum
list
<
T
>
{
cons
(
@
T
,
@
list
<
T
>
);
nil
;
}
fn
main
()
{
let
a
:
list
<
int
>
=
...
...
src/test/run-pass/generic-tag-alt.rs
浏览文件 @
3333fef1
tag
foo
<
T
>
{
arm
(
T
);
}
enum
foo
<
T
>
{
arm
(
T
);
}
fn
altfoo
<
T
>
(
f
:
foo
<
T
>
)
{
let
hit
=
false
;
...
...
src/test/run-pass/generic-tag-corruption.rs
浏览文件 @
3333fef1
...
...
@@ -2,6 +2,6 @@
// This causes memory corruption in stage0.
tag
thing
<
K
>
{
some
(
K
);
}
enum
thing
<
K
>
{
some
(
K
);
}
fn
main
()
{
let
x
=
some
(
"hi"
);
}
src/test/run-pass/generic-tag-local.rs
浏览文件 @
3333fef1
tag
clam
<
T
>
{
a
(
T
);
}
enum
clam
<
T
>
{
a
(
T
);
}
fn
main
()
{
let
c
=
a
(
3
);
}
src/test/run-pass/generic-tag-values.rs
浏览文件 @
3333fef1
...
...
@@ -2,7 +2,7 @@
// -*- rust -*-
tag
noption
<
T
>
{
some
(
T
);
}
enum
noption
<
T
>
{
some
(
T
);
}
fn
main
()
{
let
nop
:
noption
<
int
>
=
some
::
<
int
>
(
5
);
...
...
src/test/run-pass/generic-tag.rs
浏览文件 @
3333fef1
tag
option
<
T
>
{
some
(
@
T
);
none
;
}
enum
option
<
T
>
{
some
(
@
T
);
none
;
}
fn
main
()
{
let
a
:
option
<
int
>
=
some
::
<
int
>
(
@
10
);
a
=
none
::
<
int
>
;
}
src/test/run-pass/hashmap-memory.rs
浏览文件 @
3333fef1
...
...
@@ -30,7 +30,7 @@ mod map_reduce {
type
mapper
=
native
fn
(
str
,
putter
);
tag
ctrl_proto
{
find_reducer
([
u8
],
chan
<
int
>
);
mapper_done
;
}
enum
ctrl_proto
{
find_reducer
([
u8
],
chan
<
int
>
);
mapper_done
;
}
fn
start_mappers
(
ctrl
:
chan
<
ctrl_proto
>
,
inputs
:
[
str
])
{
for
i
:
str
in
inputs
{
...
...
src/test/run-pass/iface-cast.rs
浏览文件 @
3333fef1
// Test cyclic detector when using iface instances.
tag
Tree
=
TreeR
;
enum
Tree
=
TreeR
;
type
TreeR
=
@
{
mutable
left
:
option
<
Tree
>
,
mutable
right
:
option
<
Tree
>
,
...
...
src/test/run-pass/init-res-into-things.rs
浏览文件 @
3333fef1
...
...
@@ -22,7 +22,7 @@ fn test_rec() {
}
fn
test_tag
()
{
tag
t
{
enum
t
{
t0
(
r
);
}
...
...
@@ -62,7 +62,7 @@ fn test_box_rec() {
fn
main
()
{
test_box
();
test_rec
();
// FIXME:
tag
constructors don't optimize their arguments into moves
// FIXME:
enum
constructors don't optimize their arguments into moves
// test_tag();
test_tup
();
test_unique
();
...
...
src/test/run-pass/issue-687.rs
浏览文件 @
3333fef1
...
...
@@ -7,7 +7,7 @@
import
comm
::
recv
;
import
comm
::
send
;
tag
msg
{
closed
;
received
([
u8
]);
}
enum
msg
{
closed
;
received
([
u8
]);
}
fn
producer
(
c
:
chan
<
[
u8
]
>
)
{
send
(
c
,
[
1u8
,
2u8
,
3u8
,
4u8
]);
...
...
src/test/run-pass/issue-970.rs
浏览文件 @
3333fef1
tag
maybe_ordered_pair
{
enum
maybe_ordered_pair
{
yes
({
low
:
int
,
high
:
int
}
:
less_than
(
*
.low
,
*
.high
));
no
;
}
...
...
src/test/run-pass/issue-980.rs
浏览文件 @
3333fef1
tag
maybe_pointy
{
enum
maybe_pointy
{
no_pointy
;
yes_pointy
(
@
pointy
);
}
...
...
src/test/run-pass/leak-tag-copy.rs
浏览文件 @
3333fef1
tag
t
{
a
;
b
(
@
int
);
}
enum
t
{
a
;
b
(
@
int
);
}
fn
main
()
{
let
x
=
b
(
@
10
);
x
=
a
;
}
src/test/run-pass/let-destruct.rs
浏览文件 @
3333fef1
tag
xx
=
int
;
enum
xx
=
int
;
fn
main
()
{
let
@
{
x
:
xx
(
x
),
y
:
y
}
=
@
{
x
:
xx
(
10
),
y
:
20
};
...
...
src/test/run-pass/list.rs
浏览文件 @
3333fef1
...
...
@@ -2,6 +2,6 @@
// -*- rust -*-
tag
list
{
cons
(
int
,
@
list
);
nil
;
}
enum
list
{
cons
(
int
,
@
list
);
nil
;
}
fn
main
()
{
cons
(
10
,
@
cons
(
11
,
@
cons
(
12
,
@
nil
)));
}
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
浏览文件 @
3333fef1
use
std
;
import
std
::
list
;
tag
foo
{
enum
foo
{
a
(
uint
);
b
(
str
);
}
...
...
src/test/run-pass/log-knows-the-names-of-variants.rs
浏览文件 @
3333fef1
tag
foo
{
enum
foo
{
a
(
uint
);
b
(
str
);
c
;
...
...
src/test/run-pass/log-linearized.rs
浏览文件 @
3333fef1
// Tests that shapes respect linearize_ty_params().
tag
option
<
T
>
{
enum
option
<
T
>
{
none
;
some
(
T
);
}
...
...
src/test/run-pass/mlist-cycle.rs
浏览文件 @
3333fef1
...
...
@@ -4,7 +4,7 @@
type
cell
=
{
mutable
c
:
@
list
};
tag
list
{
link
(
@
cell
);
nil
;
}
enum
list
{
link
(
@
cell
);
nil
;
}
fn
main
()
{
let
first
:
@
cell
=
@
{
mutable
c
:
@
nil
()};
...
...
src/test/run-pass/mlist.rs
浏览文件 @
3333fef1
// -*- rust -*-
tag
mlist
{
cons
(
int
,
@
mlist
);
nil
;
}
enum
mlist
{
cons
(
int
,
@
mlist
);
nil
;
}
fn
main
()
{
cons
(
10
,
@
cons
(
11
,
@
cons
(
12
,
@
nil
)));
}
src/test/run-pass/mutual-recursion-group.rs
浏览文件 @
3333fef1
...
...
@@ -2,12 +2,12 @@
// -*- rust -*-
tag
colour
{
red
;
green
;
blue
;
}
enum
colour
{
red
;
green
;
blue
;
}
tag
tree
{
children
(
@
list
);
leaf
(
colour
);
}
enum
tree
{
children
(
@
list
);
leaf
(
colour
);
}
tag
list
{
cons
(
@
tree
,
@
list
);
nil
;
}
enum
list
{
cons
(
@
tree
,
@
list
);
nil
;
}
tag
small_list
{
kons
(
int
,
@
small_list
);
neel
;
}
enum
small_list
{
kons
(
int
,
@
small_list
);
neel
;
}
fn
main
()
{
}
src/test/run-pass/nested-pattern.rs
浏览文件 @
3333fef1
...
...
@@ -6,7 +6,7 @@
import
option
::
some
;
import
option
::
none
;
tag
t
{
foo
(
int
,
uint
);
bar
(
int
,
option
::
t
<
int
>
);
}
enum
t
{
foo
(
int
,
uint
);
bar
(
int
,
option
::
t
<
int
>
);
}
fn
nested
(
o
:
t
)
{
alt
o
{
...
...
src/test/run-pass/newtype-polymorphic.rs
浏览文件 @
3333fef1
tag
myvec
<
X
>
=
[
X
];
enum
myvec
<
X
>
=
[
X
];
fn
myvec_deref
<
X
:
copy
>
(
mv
:
myvec
<
X
>
)
->
[
X
]
{
ret
*
mv
;
}
...
...
src/test/run-pass/newtype.rs
浏览文件 @
3333fef1
tag
mytype
=
{
compute
:
native
fn
(
mytype
)
->
int
,
val
:
int
};
enum
mytype
=
{
compute
:
native
fn
(
mytype
)
->
int
,
val
:
int
};
fn
compute
(
i
:
mytype
)
->
int
{
ret
i
.val
+
20
;
}
...
...
src/test/run-pass/non-boolean-pure-fns.rs
浏览文件 @
3333fef1
...
...
@@ -13,7 +13,7 @@
// Of course, the compiler can't take advantage of the
// knowledge that ls is a cons node. Future work.
// Also, this is pretty contrived since nonempty_list
// could be a "
tag
refinement", if we implement those.
// could be a "
enum
refinement", if we implement those.
fn
safe_head
<
T
:
copy
>
(
ls
:
list
<
T
>
)
:
nonempty_list
(
ls
)
->
T
{
check
is_not_empty
(
ls
);
ret
head
(
ls
);
...
...
src/test/run-pass/nullary-or-pattern.rs
浏览文件 @
3333fef1
tag
blah
{
a
;
b
;
}
enum
blah
{
a
;
b
;
}
fn
or_alt
(
q
:
blah
)
->
int
{
alt
q
{
a
|
b
{
42
}
}
...
...
src/test/run-pass/or-pattern.rs
浏览文件 @
3333fef1
tag
blah
{
a
(
int
,
int
,
uint
);
b
(
int
,
int
);
c
;
}
enum
blah
{
a
(
int
,
int
,
uint
);
b
(
int
,
int
);
c
;
}
fn
or_alt
(
q
:
blah
)
->
int
{
alt
q
{
a
(
x
,
y
,
_
)
|
b
(
x
,
y
)
{
ret
x
+
y
;
}
c
{
ret
0
;
}
}
...
...
src/test/run-pass/record-pat.rs
浏览文件 @
3333fef1
tag
t1
{
a
(
int
);
b
(
uint
);
}
enum
t1
{
a
(
int
);
b
(
uint
);
}
type
t2
=
{
x
:
t1
,
y
:
int
};
tag
t3
{
c
(
t2
,
uint
);
}
enum
t3
{
c
(
t2
,
uint
);
}
fn
m
(
in
:
t3
)
->
int
{
alt
in
{
...
...
src/test/run-pass/resource-in-struct.rs
浏览文件 @
3333fef1
...
...
@@ -5,7 +5,7 @@
resource
close_res
(
i
:
closable
)
{
*
i
=
false
;
}
tag
option
<
T
>
{
none
;
some
(
T
);
}
enum
option
<
T
>
{
none
;
some
(
T
);
}
fn
sink
(
res
:
option
<
close_res
>
)
{
}
...
...
src/test/run-pass/ret-none.rs
浏览文件 @
3333fef1
tag
option
<
T
>
{
none
;
some
(
T
);
}
enum
option
<
T
>
{
none
;
some
(
T
);
}
fn
f
<
T
:
copy
>
()
->
option
<
T
>
{
ret
none
;
}
...
...
src/test/run-pass/shadow.rs
浏览文件 @
3333fef1
...
...
@@ -16,6 +16,6 @@ fn foo(c: [int]) {
}
}
tag
t
<
T
>
{
none
;
some
(
T
);
}
enum
t
<
T
>
{
none
;
some
(
T
);
}
fn
main
()
{
let
x
=
10
;
let
x
=
x
+
20
;
assert
(
x
==
30
);
foo
([]);
}
src/test/run-pass/shape_intrinsic_tag_then_rec.rs
浏览文件 @
3333fef1
// Exercises a bug in the shape code that was exposed
// on x86_64: when there is a
tag
embedded in an
// on x86_64: when there is a
enum
embedded in an
// interior record which is then itself interior to
// something else, shape calculations were off.
use
std
;
...
...
@@ -7,7 +7,7 @@
import
std
::
list
::
list
;
import
option
;
tag
opt_span
{
enum
opt_span
{
//hack (as opposed to option::t), to make `span` compile
os_none
;
...
...
src/test/run-pass/simple-alt-generic-tag.rs
浏览文件 @
3333fef1
tag
opt
<
T
>
{
none
;
}
enum
opt
<
T
>
{
none
;
}
fn
main
()
{
let
x
=
none
::
<
int
>
;
...
...
src/test/run-pass/simple-generic-alt.rs
浏览文件 @
3333fef1
tag
clam
<
T
>
{
a
(
T
);
}
enum
clam
<
T
>
{
a
(
T
);
}
fn
main
()
{
let
c
=
a
(
2
);
alt
c
{
a
::
<
int
>
(
_
)
{
}
}
}
src/test/run-pass/simple-generic-tag.rs
浏览文件 @
3333fef1
tag
clam
<
T
>
{
a
(
T
);
}
enum
clam
<
T
>
{
a
(
T
);
}
fn
main
()
{
}
src/test/run-pass/size-and-align.rs
浏览文件 @
3333fef1
...
...
@@ -2,7 +2,7 @@
// -*- rust -*-
tag
clam
<
T
>
{
a
(
T
,
int
);
b
;
}
enum
clam
<
T
>
{
a
(
T
,
int
);
b
;
}
fn
uhoh
<
T
>
(
v
:
[
clam
<
T
>
])
{
alt
v
[
1
]
{
...
...
src/test/run-pass/structured-compare-recursive.rs
浏览文件 @
3333fef1
tag
taggy
{
foo
(
@
taggy
);
bar
;
}
enum
taggy
{
foo
(
@
taggy
);
bar
;
}
fn
main
()
{
assert
(
bar
<=
bar
);
}
src/test/run-pass/structured-compare.rs
浏览文件 @
3333fef1
tag
foo
{
large
;
small
;
}
enum
foo
{
large
;
small
;
}
fn
main
()
{
let
a
=
{
x
:
1
,
y
:
2
,
z
:
3
};
...
...
src/test/run-pass/tag-disr-val-shape.rs
浏览文件 @
3333fef1
// xfail-pretty Issue #1510
tag
color
{
enum
color
{
red
=
0xff0000
;
green
=
0x00ff00
;
blue
=
0x0000ff
;
...
...
src/test/run-pass/tag-in-block.rs
浏览文件 @
3333fef1
...
...
@@ -2,7 +2,7 @@
fn
foo
()
{
fn
zed
(
z
:
bar
)
{
}
tag
bar
{
nil
;
}
enum
bar
{
nil
;
}
fn
baz
()
{
zed
(
nil
);
}
}
...
...
src/test/run-pass/tag-variant-disr-val.rs
浏览文件 @
3333fef1
tag
color
{
enum
color
{
red
=
0xff0000
;
green
=
0x00ff00
;
blue
=
0x0000ff
;
...
...
src/test/run-pass/tag.rs
浏览文件 @
3333fef1
...
...
@@ -2,7 +2,7 @@
// -*- rust -*-
tag
colour
{
red
(
int
,
int
);
green
;
}
enum
colour
{
red
(
int
,
int
);
green
;
}
fn
f
()
{
let
x
=
red
(
1
,
2
);
let
y
=
green
;
assert
(
x
!=
y
);
}
...
...
src/test/run-pass/task-comm-16.rs
浏览文件 @
3333fef1
...
...
@@ -50,7 +50,7 @@ fn test_str() {
}
fn
test_tag
()
{
tag
t
{
tag1
;
tag2
(
int
);
tag3
(
int
,
u8
,
char
);
}
enum
t
{
tag1
;
tag2
(
int
);
tag3
(
int
,
u8
,
char
);
}
let
po
=
port
();
let
ch
=
chan
(
po
);
send
(
ch
,
tag1
);
...
...
src/test/run-pass/unchecked-predicates.rs
浏览文件 @
3333fef1
...
...
@@ -26,7 +26,7 @@ fn count<T>(_t: T, &&u: uint) -> uint { u + 1u }
// Of course, the compiler can't take advantage of the
// knowledge that ls is a cons node. Future work.
// Also, this is pretty contrived since nonempty_list
// could be a "
tag
refinement", if we implement those.
// could be a "
enum
refinement", if we implement those.
fn
safe_head
<
T
:
copy
>
(
ls
:
list
<
T
>
)
:
nonempty_list
(
ls
)
->
T
{
check
is_not_empty
(
ls
);
ret
head
(
ls
)
...
...
src/test/run-pass/uniq-cc-generic.rs
浏览文件 @
3333fef1
tag
maybe_pointy
{
enum
maybe_pointy
{
none
;
p
(
@
pointy
);
}
...
...
src/test/run-pass/uniq-cc.rs
浏览文件 @
3333fef1
tag
maybe_pointy
{
enum
maybe_pointy
{
none
;
p
(
@
pointy
);
}
...
...
src/test/run-pass/unique-containing-tag.rs
浏览文件 @
3333fef1
fn
main
()
{
tag
t
{
t1
(
int
);
t2
(
int
);
}
enum
t
{
t1
(
int
);
t2
(
int
);
}
let
x
=
~
t1
(
10
);
...
...
src/test/run-pass/unique-in-tag.rs
浏览文件 @
3333fef1
fn
test1
()
{
tag
bar
{
u
(
~
int
);
w
(
int
);
}
enum
bar
{
u
(
~
int
);
w
(
int
);
}
let
x
=
u
(
~
10
);
assert
alt
x
{
...
...
src/test/run-pass/unique-pat-2.rs
浏览文件 @
3333fef1
type
foo
=
{
a
:
int
,
b
:
uint
};
tag
bar
{
u
(
~
foo
);
w
(
int
);
}
enum
bar
{
u
(
~
foo
);
w
(
int
);
}
fn
main
()
{
assert
(
alt
u
(
~
{
a
:
10
,
b
:
40u
})
{
...
...
src/test/run-pass/unique-pat-3.rs
浏览文件 @
3333fef1
tag
bar
{
u
(
~
int
);
w
(
int
);
}
enum
bar
{
u
(
~
int
);
w
(
int
);
}
fn
main
()
{
assert
alt
u
(
~
10
)
{
...
...
src/test/run-pass/use-uninit-alt.rs
浏览文件 @
3333fef1
...
...
@@ -6,6 +6,6 @@ fn foo<T>(o: myoption<T>) -> int {
ret
x
;
}
tag
myoption
<
T
>
{
none
;
some
(
T
);
}
enum
myoption
<
T
>
{
none
;
some
(
T
);
}
fn
main
()
{
log
(
debug
,
5
);
}
src/test/run-pass/use-uninit-alt2.rs
浏览文件 @
3333fef1
...
...
@@ -6,6 +6,6 @@ fn foo<T>(o: myoption<T>) -> int {
ret
x
;
}
tag
myoption
<
T
>
{
none
;
some
(
T
);
}
enum
myoption
<
T
>
{
none
;
some
(
T
);
}
fn
main
()
{
log
(
debug
,
5
);
}
src/test/run-pass/while-prelude-drop.rs
浏览文件 @
3333fef1
tag
t
{
a
;
b
(
str
);
}
enum
t
{
a
;
b
(
str
);
}
fn
make
(
i
:
int
)
->
t
{
if
i
>
10
{
ret
a
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录