Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
02c1d2ff
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,发现更多精彩内容 >>
提交
02c1d2ff
编写于
1月 03, 2014
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: Make all the run-pass tests use `pub fn main`
上级
82a09b9a
变更
73
显示空白变更内容
内联
并排
Showing
73 changed file
with
73 addition
and
73 deletion
+73
-73
src/test/run-pass/borrowck-assign-to-subfield.rs
src/test/run-pass/borrowck-assign-to-subfield.rs
+1
-1
src/test/run-pass/borrowck-nested-calls.rs
src/test/run-pass/borrowck-nested-calls.rs
+1
-1
src/test/run-pass/builtin-superkinds-capabilities-xc.rs
src/test/run-pass/builtin-superkinds-capabilities-xc.rs
+1
-1
src/test/run-pass/builtin-superkinds-in-metadata.rs
src/test/run-pass/builtin-superkinds-in-metadata.rs
+1
-1
src/test/run-pass/cfg-macros-foo.rs
src/test/run-pass/cfg-macros-foo.rs
+1
-1
src/test/run-pass/cfg-macros-notfoo.rs
src/test/run-pass/cfg-macros-notfoo.rs
+1
-1
src/test/run-pass/cfg_inner_static.rs
src/test/run-pass/cfg_inner_static.rs
+1
-1
src/test/run-pass/cfgs-on-items.rs
src/test/run-pass/cfgs-on-items.rs
+1
-1
src/test/run-pass/conditional-debug-macro-off.rs
src/test/run-pass/conditional-debug-macro-off.rs
+1
-1
src/test/run-pass/conditional-debug-macro-on.rs
src/test/run-pass/conditional-debug-macro-on.rs
+1
-1
src/test/run-pass/const-cross-crate-const.rs
src/test/run-pass/const-cross-crate-const.rs
+1
-1
src/test/run-pass/cross-crate-const-pat.rs
src/test/run-pass/cross-crate-const-pat.rs
+1
-1
src/test/run-pass/cross-crate-newtype-struct-pat.rs
src/test/run-pass/cross-crate-newtype-struct-pat.rs
+1
-1
src/test/run-pass/deriving-global.rs
src/test/run-pass/deriving-global.rs
+1
-1
src/test/run-pass/deriving-rand.rs
src/test/run-pass/deriving-rand.rs
+1
-1
src/test/run-pass/dupe-first-attr.rc
src/test/run-pass/dupe-first-attr.rc
+1
-1
src/test/run-pass/extern-calling-convention-test.rs
src/test/run-pass/extern-calling-convention-test.rs
+1
-1
src/test/run-pass/extern-fn-reachable.rs
src/test/run-pass/extern-fn-reachable.rs
+1
-1
src/test/run-pass/extern-mod-ordering-exe.rs
src/test/run-pass/extern-mod-ordering-exe.rs
+1
-1
src/test/run-pass/issue-10626.rs
src/test/run-pass/issue-10626.rs
+1
-1
src/test/run-pass/issue-10806.rs
src/test/run-pass/issue-10806.rs
+1
-1
src/test/run-pass/issue-11085.rs
src/test/run-pass/issue-11085.rs
+1
-1
src/test/run-pass/issue-11224.rs
src/test/run-pass/issue-11224.rs
+1
-1
src/test/run-pass/issue-11225-1.rs
src/test/run-pass/issue-11225-1.rs
+1
-1
src/test/run-pass/issue-11225-2.rs
src/test/run-pass/issue-11225-2.rs
+1
-1
src/test/run-pass/issue-3290.rs
src/test/run-pass/issue-3290.rs
+1
-1
src/test/run-pass/issue-3796.rs
src/test/run-pass/issue-3796.rs
+1
-1
src/test/run-pass/issue-4208.rs
src/test/run-pass/issue-4208.rs
+1
-1
src/test/run-pass/issue-4241.rs
src/test/run-pass/issue-4241.rs
+1
-1
src/test/run-pass/issue-4252.rs
src/test/run-pass/issue-4252.rs
+1
-1
src/test/run-pass/issue-4545.rs
src/test/run-pass/issue-4545.rs
+1
-1
src/test/run-pass/issue-5950.rs
src/test/run-pass/issue-5950.rs
+1
-1
src/test/run-pass/issue-6334.rs
src/test/run-pass/issue-6334.rs
+1
-1
src/test/run-pass/issue-7178.rs
src/test/run-pass/issue-7178.rs
+1
-1
src/test/run-pass/issue-8044.rs
src/test/run-pass/issue-8044.rs
+1
-1
src/test/run-pass/issue-8259.rs
src/test/run-pass/issue-8259.rs
+1
-1
src/test/run-pass/issue-8498.rs
src/test/run-pass/issue-8498.rs
+1
-1
src/test/run-pass/issue-9188.rs
src/test/run-pass/issue-9188.rs
+1
-1
src/test/run-pass/issue-9906.rs
src/test/run-pass/issue-9906.rs
+1
-1
src/test/run-pass/issue-9968.rs
src/test/run-pass/issue-9968.rs
+1
-1
src/test/run-pass/issue_9155.rs
src/test/run-pass/issue_9155.rs
+1
-1
src/test/run-pass/linkage-visibility.rs
src/test/run-pass/linkage-visibility.rs
+1
-1
src/test/run-pass/logging-enabled-debug.rs
src/test/run-pass/logging-enabled-debug.rs
+1
-1
src/test/run-pass/logging-enabled.rs
src/test/run-pass/logging-enabled.rs
+1
-1
src/test/run-pass/logging-right-crate.rs
src/test/run-pass/logging-right-crate.rs
+1
-1
src/test/run-pass/logging_before_rt_started.rs
src/test/run-pass/logging_before_rt_started.rs
+1
-1
src/test/run-pass/macro-with-attrs1.rs
src/test/run-pass/macro-with-attrs1.rs
+1
-1
src/test/run-pass/native-print-no-runtime.rs
src/test/run-pass/native-print-no-runtime.rs
+1
-1
src/test/run-pass/no-std-xcrate.rs
src/test/run-pass/no-std-xcrate.rs
+1
-1
src/test/run-pass/no-std-xcrate2.rs
src/test/run-pass/no-std-xcrate2.rs
+1
-1
src/test/run-pass/once-move-out-on-heap.rs
src/test/run-pass/once-move-out-on-heap.rs
+1
-1
src/test/run-pass/once-move-out-on-stack.rs
src/test/run-pass/once-move-out-on-stack.rs
+1
-1
src/test/run-pass/osx-frameworks.rs
src/test/run-pass/osx-frameworks.rs
+1
-1
src/test/run-pass/packed-struct-size-xc.rs
src/test/run-pass/packed-struct-size-xc.rs
+1
-1
src/test/run-pass/priv-impl-prim-ty.rs
src/test/run-pass/priv-impl-prim-ty.rs
+1
-1
src/test/run-pass/privacy-reexport.rs
src/test/run-pass/privacy-reexport.rs
+1
-1
src/test/run-pass/reexport-should-still-link.rs
src/test/run-pass/reexport-should-still-link.rs
+1
-1
src/test/run-pass/rename-directory.rs
src/test/run-pass/rename-directory.rs
+1
-1
src/test/run-pass/signal-exit-status.rs
src/test/run-pass/signal-exit-status.rs
+1
-1
src/test/run-pass/smallest-hello-world.rs
src/test/run-pass/smallest-hello-world.rs
+1
-1
src/test/run-pass/spawning-with-debug.rs
src/test/run-pass/spawning-with-debug.rs
+1
-1
src/test/run-pass/static-function-pointer-xc.rs
src/test/run-pass/static-function-pointer-xc.rs
+1
-1
src/test/run-pass/struct_variant_xc.rs
src/test/run-pass/struct_variant_xc.rs
+1
-1
src/test/run-pass/syntax-extension-cfg.rs
src/test/run-pass/syntax-extension-cfg.rs
+1
-1
src/test/run-pass/tempfile.rs
src/test/run-pass/tempfile.rs
+1
-1
src/test/run-pass/trait-bounds-in-arc.rs
src/test/run-pass/trait-bounds-in-arc.rs
+1
-1
src/test/run-pass/trait-default-method-xc-2.rs
src/test/run-pass/trait-default-method-xc-2.rs
+1
-1
src/test/run-pass/trait-default-method-xc.rs
src/test/run-pass/trait-default-method-xc.rs
+1
-1
src/test/run-pass/tydesc-name.rs
src/test/run-pass/tydesc-name.rs
+1
-1
src/test/run-pass/typeid-intrinsic.rs
src/test/run-pass/typeid-intrinsic.rs
+1
-1
src/test/run-pass/use_inline_dtor.rs
src/test/run-pass/use_inline_dtor.rs
+1
-1
src/test/run-pass/xcrate-address-insignificant.rs
src/test/run-pass/xcrate-address-insignificant.rs
+1
-1
src/test/run-pass/xcrate-unit-struct.rs
src/test/run-pass/xcrate-unit-struct.rs
+1
-1
未找到文件。
src/test/run-pass/borrowck-assign-to-subfield.rs
浏览文件 @
02c1d2ff
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn
main
()
{
pub
fn
main
()
{
struct
A
{
a
:
int
,
w
:
B
,
...
...
src/test/run-pass/borrowck-nested-calls.rs
浏览文件 @
02c1d2ff
...
...
@@ -24,7 +24,7 @@ pub fn next_b(&mut self) -> uint {
}
}
fn
main
()
{
pub
fn
main
()
{
let
mut
f
=
Foo
{
a
:
22
,
b
:
23
};
f
.inc_a
(
f
.next_b
());
assert_eq!
(
f
.a
,
22
+
23
);
...
...
src/test/run-pass/builtin-superkinds-capabilities-xc.rs
浏览文件 @
02c1d2ff
...
...
@@ -28,7 +28,7 @@ fn foo<T: RequiresRequiresFreezeAndSend>(val: T, chan: Chan<T>) {
chan
.send
(
val
);
}
fn
main
()
{
pub
fn
main
()
{
let
(
p
,
c
)
=
Chan
::
new
();
foo
(
X
(
31337
),
c
);
assert
!
(
p
.recv
()
==
X
(
31337
));
...
...
src/test/run-pass/builtin-superkinds-in-metadata.rs
浏览文件 @
02c1d2ff
...
...
@@ -26,4 +26,4 @@ impl <T:Freeze+Send> RequiresRequiresFreezeAndSend for X<T> { }
impl
<
T
:
Pod
>
RequiresPod
for
X
<
T
>
{
}
fn
main
()
{
}
pub
fn
main
()
{
}
src/test/run-pass/cfg-macros-foo.rs
浏览文件 @
02c1d2ff
...
...
@@ -32,6 +32,6 @@ mod foo {
}
}
fn
main
()
{
pub
fn
main
()
{
assert
!
(
bar!
())
}
src/test/run-pass/cfg-macros-notfoo.rs
浏览文件 @
02c1d2ff
...
...
@@ -32,6 +32,6 @@ mod foo {
}
}
fn
main
()
{
pub
fn
main
()
{
assert
!
(
!
bar!
())
}
src/test/run-pass/cfg_inner_static.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
cfg_inner_static
;
fn
main
()
{
pub
fn
main
()
{
cfg_inner_static
::
foo
();
}
src/test/run-pass/cfgs-on-items.rs
浏览文件 @
02c1d2ff
...
...
@@ -25,7 +25,7 @@ fn foo2() -> int { 2 }
fn
foo2
()
->
int
{
3
}
fn
main
()
{
pub
fn
main
()
{
assert_eq!
(
1
,
foo1
());
assert_eq!
(
3
,
foo2
());
}
src/test/run-pass/conditional-debug-macro-off.rs
浏览文件 @
02c1d2ff
...
...
@@ -12,7 +12,7 @@
// compile-flags: --cfg ndebug
// exec-env:RUST_LOG=conditional-debug-macro-off=4
fn
main
()
{
pub
fn
main
()
{
// only fails if debug! evaluates its argument.
debug!
(
"{:?}"
,
{
if
true
{
fail!
()
}
});
}
src/test/run-pass/conditional-debug-macro-on.rs
浏览文件 @
02c1d2ff
...
...
@@ -11,7 +11,7 @@
// xfail-fast compile-flags directive doesn't work for check-fast
// exec-env:RUST_LOG=conditional-debug-macro-on=4
fn
main
()
{
pub
fn
main
()
{
// exits early if debug! evaluates its arguments, otherwise it
// will hit the fail.
debug!
(
"{:?}"
,
{
if
true
{
return
;
}
});
...
...
src/test/run-pass/const-cross-crate-const.rs
浏览文件 @
02c1d2ff
...
...
@@ -16,7 +16,7 @@
static
a
:
uint
=
cci_const
::
uint_val
;
static
b
:
uint
=
cci_const
::
uint_expr
+
5
;
fn
main
()
{
pub
fn
main
()
{
assert_eq!
(
a
,
12
);
let
foo2
=
a
;
assert_eq!
(
foo2
,
cci_const
::
uint_val
);
...
...
src/test/run-pass/cross-crate-const-pat.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
extern
mod
cci_const
;
fn
main
()
{
pub
fn
main
()
{
let
x
=
cci_const
::
uint_val
;
match
x
{
cci_const
::
uint_val
=>
{}
...
...
src/test/run-pass/cross-crate-newtype-struct-pat.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
extern
mod
newtype_struct_xc
;
fn
main
()
{
pub
fn
main
()
{
let
x
=
newtype_struct_xc
::
Au
(
21
);
match
x
{
newtype_struct_xc
::
Au
(
n
)
=>
assert_eq!
(
n
,
21
)
...
...
src/test/run-pass/deriving-global.rs
浏览文件 @
02c1d2ff
...
...
@@ -39,4 +39,4 @@ struct B { x: uint, y: int }
}
fn
main
()
{}
pub
fn
main
()
{}
src/test/run-pass/deriving-rand.rs
浏览文件 @
02c1d2ff
...
...
@@ -32,7 +32,7 @@ enum D {
D2
{
x
:
(),
y
:
()
}
}
fn
main
()
{
pub
fn
main
()
{
// check there's no segfaults
20
.times
(||
{
rand
::
random
::
<
A
>
();
...
...
src/test/run-pass/dupe-first-attr.rc
浏览文件 @
02c1d2ff
...
...
@@ -26,4 +26,4 @@ mod hello;
#[cfg(target_os = "android")]
mod hello;
fn main() { }
\ No newline at end of file
pub fn main() { }
src/test/run-pass/extern-calling-convention-test.rs
浏览文件 @
02c1d2ff
...
...
@@ -15,6 +15,6 @@
use
extern_calling_convention
::
foo
;
fn
main
()
{
pub
fn
main
()
{
foo
(
1
,
2
,
3
,
4
);
}
src/test/run-pass/extern-fn-reachable.rs
浏览文件 @
02c1d2ff
...
...
@@ -27,7 +27,7 @@ pub mod bar {
#[no_mangle]
pub
fn
fun5
()
{}
fn
main
()
{
pub
fn
main
()
{
unsafe
{
let
a
=
DynamicLibrary
::
open
(
None
)
.unwrap
();
assert
!
(
a
.symbol
::
<
int
>
(
"fun1"
)
.is_ok
());
...
...
src/test/run-pass/extern-mod-ordering-exe.rs
浏览文件 @
02c1d2ff
...
...
@@ -5,6 +5,6 @@
use
extern_mod_ordering_lib
::
extern_mod_ordering_lib
;
fn
main
()
{
pub
fn
main
()
{
extern_mod_ordering_lib
::
f
();
}
src/test/run-pass/issue-10626.rs
浏览文件 @
02c1d2ff
...
...
@@ -16,7 +16,7 @@
use
std
::
os
;
use
std
::
io
::
process
;
fn
main
()
{
pub
fn
main
()
{
let
args
=
os
::
args
();
if
args
.len
()
>
1
&&
args
[
1
]
==
~
"child"
{
for
_
in
range
(
0
,
1000
)
{
...
...
src/test/run-pass/issue-10806.rs
浏览文件 @
02c1d2ff
...
...
@@ -38,7 +38,7 @@ pub fn plugh() -> int {
}
}
fn
main
()
{
pub
fn
main
()
{
let
_
x
=
baz
::
quux
();
let
_
y
=
grault
::
garply
();
let
_
z
=
waldo
::
plugh
();
...
...
src/test/run-pass/issue-11085.rs
浏览文件 @
02c1d2ff
...
...
@@ -43,7 +43,7 @@ enum Bar3 {
}
}
fn
main
()
{
pub
fn
main
()
{
let
_
f
=
Foo
{
foo
:
3
};
let
_
f
=
Foo2
{
foo
:
3
};
...
...
src/test/run-pass/issue-11224.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,4 +13,4 @@
extern
mod
unused
=
"issue-11224"
;
fn
main
()
{}
pub
fn
main
()
{}
src/test/run-pass/issue-11225-1.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
foo
=
"issue-11225-1"
;
fn
main
()
{
pub
fn
main
()
{
foo
::
foo
(
1
);
}
src/test/run-pass/issue-11225-2.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
foo
=
"issue-11225-2"
;
fn
main
()
{
pub
fn
main
()
{
foo
::
foo
(
1
);
}
src/test/run-pass/issue-3290.rs
浏览文件 @
02c1d2ff
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
// xfail-test FIXME #3290
fn
main
()
{
pub
fn
main
()
{
let
mut
x
=
~
3
;
x
=
x
;
assert_eq!
(
*
x
,
3
);
...
...
src/test/run-pass/issue-3796.rs
浏览文件 @
02c1d2ff
...
...
@@ -10,7 +10,7 @@
// xfail-test FIXME #3796
#[deny(dead_assignment)]
;
fn
main
()
{
pub
fn
main
()
{
let
mut
x
=
1
;
let
f
:
||
->
int
=
||
{
x
+
20
};
assert_eq!
(
f
(),
21
);
...
...
src/test/run-pass/issue-4208.rs
浏览文件 @
02c1d2ff
...
...
@@ -16,4 +16,4 @@
fn
foo
<
T
,
A
:
Angle
<
T
>>
(
theta
:
A
)
->
T
{
sin
(
&
theta
)
}
fn
main
()
{}
pub
fn
main
()
{}
src/test/run-pass/issue-4241.rs
浏览文件 @
02c1d2ff
...
...
@@ -127,5 +127,5 @@ fn query2(cmd: ~[~str]) -> Result {
}
fn
main
()
{
pub
fn
main
()
{
}
src/test/run-pass/issue-4252.rs
浏览文件 @
02c1d2ff
...
...
@@ -31,7 +31,7 @@ fn drop(&mut self) {
}
}
fn
main
()
{
pub
fn
main
()
{
let
y
=
Y
;
let
_
z
=
Z
{
x
:
y
};
}
src/test/run-pass/issue-4545.rs
浏览文件 @
02c1d2ff
...
...
@@ -12,4 +12,4 @@
// aux-build:issue-4545.rs
extern
mod
somelib
=
"issue-4545"
;
fn
main
()
{
somelib
::
mk
::
<
int
>
();
}
pub
fn
main
()
{
somelib
::
mk
::
<
int
>
();
}
src/test/run-pass/issue-5950.rs
浏览文件 @
02c1d2ff
...
...
@@ -14,4 +14,4 @@
mod
local
{
}
fn
main
()
{}
pub
fn
main
()
{}
src/test/run-pass/issue-6334.rs
浏览文件 @
02c1d2ff
...
...
@@ -48,7 +48,7 @@ fn use_c<S:C, T:B+A>(s: &S, t: &T) -> uint {
s
.combine
(
t
)
}
fn
main
()
{
pub
fn
main
()
{
let
foo
=
Foo
;
let
bar
=
Bar
;
let
r
=
use_c
(
&
bar
,
&
foo
);
...
...
src/test/run-pass/issue-7178.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
cross_crate_self
=
"issue-7178"
;
fn
main
()
{
pub
fn
main
()
{
let
_
=
cross_crate_self
::
Foo
::
new
(
&
1
i
);
}
src/test/run-pass/issue-8044.rs
浏览文件 @
02c1d2ff
...
...
@@ -14,6 +14,6 @@
extern
mod
minimal
=
"issue-8044"
;
use
minimal
::{
BTree
,
leaf
};
fn
main
()
{
pub
fn
main
()
{
BTree
::
<
int
>
{
node
:
leaf
(
1
)
};
}
src/test/run-pass/issue-8259.rs
浏览文件 @
02c1d2ff
...
...
@@ -14,4 +14,4 @@
extern
mod
other
=
"issue-8259"
;
static
a
:
other
::
Foo
<
'static
>
=
other
::
A
;
fn
main
()
{}
pub
fn
main
()
{}
src/test/run-pass/issue-8498.rs
浏览文件 @
02c1d2ff
...
...
@@ -10,7 +10,7 @@
// xfail-test
fn
main
()
{
pub
fn
main
()
{
// This is ok
match
&
[(
~
5
,
~
7
)]
{
ps
=>
{
...
...
src/test/run-pass/issue-9188.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
extern
mod
issue_9188
;
fn
main
()
{
pub
fn
main
()
{
let
a
=
issue_9188
::
bar
();
let
b
=
issue_9188
::
foo
::
<
int
>
();
assert_eq!
(
*
a
,
*
b
);
...
...
src/test/run-pass/issue-9906.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
extern
mod
testmod
=
"issue-9906"
;
fn
main
()
{
pub
fn
main
()
{
testmod
::
foo
();
testmod
::
FooBar
::
new
(
1
);
}
src/test/run-pass/issue-9968.rs
浏览文件 @
02c1d2ff
...
...
@@ -15,7 +15,7 @@
use
lib
::{
Trait
,
Struct
};
fn
main
()
pub
fn
main
()
{
Struct
::
init
()
.test
();
}
src/test/run-pass/issue_9155.rs
浏览文件 @
02c1d2ff
...
...
@@ -15,6 +15,6 @@
struct
Baz
;
fn
main
()
{
pub
fn
main
()
{
issue_9155
::
Foo
::
new
(
Baz
);
}
src/test/run-pass/linkage-visibility.rs
浏览文件 @
02c1d2ff
...
...
@@ -15,7 +15,7 @@
extern
mod
foo
=
"linkage-visibility"
;
fn
main
()
{
pub
fn
main
()
{
foo
::
test
();
foo
::
foo2
::
<
int
>
();
foo
::
foo
();
...
...
src/test/run-pass/logging-enabled-debug.rs
浏览文件 @
02c1d2ff
...
...
@@ -14,7 +14,7 @@
use
std
::
logging
;
fn
main
()
{
pub
fn
main
()
{
if
log_enabled!
(
logging
::
DEBUG
)
{
fail
!
(
"what?! debugging?"
);
}
...
...
src/test/run-pass/logging-enabled.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
use
std
::
logging
;
fn
main
()
{
pub
fn
main
()
{
if
log_enabled!
(
logging
::
DEBUG
)
{
fail
!
(
"what?! debugging?"
);
}
...
...
src/test/run-pass/logging-right-crate.rs
浏览文件 @
02c1d2ff
...
...
@@ -24,7 +24,7 @@
extern
mod
logging_right_crate
;
fn
main
()
{
pub
fn
main
()
{
// this function fails if logging is turned on
logging_right_crate
::
foo
::
<
int
>
();
}
src/test/run-pass/logging_before_rt_started.rs
浏览文件 @
02c1d2ff
...
...
@@ -17,4 +17,4 @@
// this test will trigger "output during runtime initialization" to make sure
// that the bug isn't re-introduced.
fn
main
()
{}
pub
fn
main
()
{}
src/test/run-pass/macro-with-attrs1.rs
浏览文件 @
02c1d2ff
...
...
@@ -19,6 +19,6 @@
#[cfg(not(foo))]
macro_rules!
foo
(
()
=>
(
2
)
)
fn
main
()
{
pub
fn
main
()
{
assert_eq!
(
foo!
(),
1
);
}
src/test/run-pass/native-print-no-runtime.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
#[no_uv]
;
#[start]
fn
main
(
_
:
int
,
_
:
**
u8
)
->
int
{
pub
fn
main
(
_
:
int
,
_
:
**
u8
)
->
int
{
println!
(
"hello"
);
0
}
src/test/run-pass/no-std-xcrate.rs
浏览文件 @
02c1d2ff
...
...
@@ -16,6 +16,6 @@
extern
mod
no_std_crate
;
fn
main
()
{
pub
fn
main
()
{
no_std_crate
::
foo
();
}
src/test/run-pass/no-std-xcrate2.rs
浏览文件 @
02c1d2ff
...
...
@@ -29,7 +29,7 @@ pub mod linkhack {
}
#[start]
fn
main
(
_
:
int
,
_
:
**
u8
,
_
:
*
u8
)
->
int
{
pub
fn
main
(
_
:
int
,
_
:
**
u8
,
_
:
*
u8
)
->
int
{
no_std_crate
::
foo
();
0
}
src/test/run-pass/once-move-out-on-heap.rs
浏览文件 @
02c1d2ff
...
...
@@ -20,7 +20,7 @@ fn foo(blk: proc()) {
blk
();
}
fn
main
()
{
pub
fn
main
()
{
let
x
=
arc
::
Arc
::
new
(
true
);
do
foo
{
assert
!
(
*
x
.get
());
...
...
src/test/run-pass/once-move-out-on-stack.rs
浏览文件 @
02c1d2ff
...
...
@@ -20,7 +20,7 @@ fn foo(blk: once ||) {
blk
();
}
fn
main
()
{
pub
fn
main
()
{
let
x
=
arc
::
Arc
::
new
(
true
);
foo
(||
{
assert
!
(
*
x
.get
());
...
...
src/test/run-pass/osx-frameworks.rs
浏览文件 @
02c1d2ff
...
...
@@ -17,7 +17,7 @@
}
#[cfg(target_os
=
"macos"
)]
fn
main
()
{
pub
fn
main
()
{
unsafe
{
CFRunLoopGetTypeID
();
}
}
...
...
src/test/run-pass/packed-struct-size-xc.rs
浏览文件 @
02c1d2ff
...
...
@@ -5,6 +5,6 @@
use
std
::
mem
;
fn
main
()
{
pub
fn
main
()
{
assert_eq!
(
mem
::
size_of
::
<
packed
::
S
>
(),
5
);
}
src/test/run-pass/priv-impl-prim-ty.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
extern
mod
bar
=
"priv-impl-prim-ty"
;
fn
main
()
{
pub
fn
main
()
{
bar
::
frob
(
1
i
);
}
src/test/run-pass/privacy-reexport.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
privacy_reexport
;
fn
main
()
{
pub
fn
main
()
{
privacy_reexport
::
bar
::
frob
();
}
src/test/run-pass/reexport-should-still-link.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
foo
=
"reexport-should-still-link"
;
fn
main
()
{
pub
fn
main
()
{
foo
::
bar
();
}
src/test/run-pass/rename-directory.rs
浏览文件 @
02c1d2ff
...
...
@@ -55,4 +55,4 @@ fn rename_directory() {
}
}
fn
main
()
{
rename_directory
()
}
pub
fn
main
()
{
rename_directory
()
}
src/test/run-pass/signal-exit-status.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,7 +13,7 @@
use
std
::{
os
,
run
};
use
std
::
io
::
process
;
fn
main
()
{
pub
fn
main
()
{
let
args
=
os
::
args
();
if
args
.len
()
>=
2
&&
args
[
1
]
==
~
"signal"
{
// Raise a segfault.
...
...
src/test/run-pass/smallest-hello-world.rs
浏览文件 @
02c1d2ff
...
...
@@ -32,7 +32,7 @@ pub mod linkhack {
}
#[start]
fn
main
(
_
:
int
,
_
:
**
u8
,
_
:
*
u8
)
->
int
{
pub
fn
main
(
_
:
int
,
_
:
**
u8
,
_
:
*
u8
)
->
int
{
unsafe
{
let
(
ptr
,
_
):
(
*
u8
,
uint
)
=
transmute
(
"Hello!"
);
puts
(
ptr
);
...
...
src/test/run-pass/spawning-with-debug.rs
浏览文件 @
02c1d2ff
...
...
@@ -15,7 +15,7 @@
use
std
::
task
;
fn
main
()
{
pub
fn
main
()
{
let
mut
t
=
task
::
task
();
t
.spawn
(
proc
()
());
}
src/test/run-pass/static-function-pointer-xc.rs
浏览文件 @
02c1d2ff
...
...
@@ -14,7 +14,7 @@
fn
f
(
x
:
int
)
->
int
{
x
}
fn
main
()
{
pub
fn
main
()
{
assert_eq!
(
aux
::
F
(
42
),
-
42
);
unsafe
{
assert_eq!
(
aux
::
MutF
(
42
),
-
42
);
...
...
src/test/run-pass/struct_variant_xc.rs
浏览文件 @
02c1d2ff
...
...
@@ -14,6 +14,6 @@
use
struct_variant_xc_aux
::
Variant
;
fn
main
()
{
pub
fn
main
()
{
let
_
=
Variant
{
arg
:
1
};
}
src/test/run-pass/syntax-extension-cfg.rs
浏览文件 @
02c1d2ff
...
...
@@ -11,7 +11,7 @@
// xfail-fast compile-flags doesn't work with fast-check
// compile-flags: --cfg foo --cfg bar(baz) --cfg qux="foo"
fn
main
()
{
pub
fn
main
()
{
// check
if
!
cfg!
(
foo
)
{
fail
!
()
}
if
cfg!
(
not
(
foo
))
{
fail
!
()
}
...
...
src/test/run-pass/tempfile.rs
浏览文件 @
02c1d2ff
...
...
@@ -141,7 +141,7 @@ fn in_tmpdir(f: ||) {
f
();
}
fn
main
()
{
pub
fn
main
()
{
in_tmpdir
(
test_tempdir
);
in_tmpdir
(
test_rm_tempdir
);
in_tmpdir
(
recursive_mkdir_rel
);
...
...
src/test/run-pass/trait-bounds-in-arc.rs
浏览文件 @
02c1d2ff
...
...
@@ -60,7 +60,7 @@ fn num_legs(&self) -> uint { 0 }
fn
of_good_pedigree
(
&
self
)
->
bool
{
self
.swim_speed
>=
500
}
}
fn
main
()
{
pub
fn
main
()
{
let
catte
=
Catte
{
num_whiskers
:
7
,
name
:
~
"alonzo_church"
};
let
dogge1
=
Dogge
{
bark_decibels
:
100
,
tricks_known
:
42
,
name
:
~
"alan_turing"
};
let
dogge2
=
Dogge
{
bark_decibels
:
55
,
tricks_known
:
11
,
name
:
~
"albert_einstein"
};
...
...
src/test/run-pass/trait-default-method-xc-2.rs
浏览文件 @
02c1d2ff
...
...
@@ -9,7 +9,7 @@
use
aux2
::{
a_struct
,
welp
};
fn
main
()
{
pub
fn
main
()
{
let
a
=
a_struct
{
x
:
0
};
let
b
=
a_struct
{
x
:
1
};
...
...
src/test/run-pass/trait-default-method-xc.rs
浏览文件 @
02c1d2ff
...
...
@@ -44,7 +44,7 @@ fn test_eq(&self, rhs: &stuff::thing) -> bool {
}
fn
main
()
{
pub
fn
main
()
{
// Some tests of random things
f
(
0
);
...
...
src/test/run-pass/tydesc-name.rs
浏览文件 @
02c1d2ff
...
...
@@ -16,7 +16,7 @@ struct Foo<T> {
x
:
T
}
fn
main
()
{
pub
fn
main
()
{
unsafe
{
assert_eq!
((
*
get_tydesc
::
<
int
>
())
.name
,
"int"
);
assert_eq!
((
*
get_tydesc
::
<~
[
int
]
>
())
.name
,
"~[int]"
);
...
...
src/test/run-pass/typeid-intrinsic.rs
浏览文件 @
02c1d2ff
...
...
@@ -21,7 +21,7 @@
struct
A
;
struct
Test
;
fn
main
()
{
pub
fn
main
()
{
unsafe
{
assert_eq!
(
intrinsics
::
type_id
::
<
other1
::
A
>
(),
other1
::
id_A
());
assert_eq!
(
intrinsics
::
type_id
::
<
other1
::
B
>
(),
other1
::
id_B
());
...
...
src/test/run-pass/use_inline_dtor.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
inline_dtor
;
fn
main
()
{
pub
fn
main
()
{
let
_
x
=
inline_dtor
::
Foo
;
}
src/test/run-pass/xcrate-address-insignificant.rs
浏览文件 @
02c1d2ff
...
...
@@ -13,6 +13,6 @@
extern
mod
foo
=
"xcrate_address_insignificant"
;
fn
main
()
{
pub
fn
main
()
{
assert_eq!
(
foo
::
foo
::
<
f64
>
(),
foo
::
bar
());
}
src/test/run-pass/xcrate-unit-struct.rs
浏览文件 @
02c1d2ff
...
...
@@ -21,7 +21,7 @@
fn
f1
(
_
:
xcrate_unit_struct
::
Struct
)
{}
fn
f2
(
_
:
xcrate_unit_struct
::
Unit
)
{}
fn
main
()
{
pub
fn
main
()
{
f1
(
xcrate_unit_struct
::
Struct
);
f2
(
xcrate_unit_struct
::
Unit
);
f2
(
xcrate_unit_struct
::
Argument
(
xcrate_unit_struct
::
Struct
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录