Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
592c2e1d
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
592c2e1d
编写于
1月 30, 2013
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: Remove export from the tests, language, and libraries. rs=deexporting
上级
2a65842c
变更
81
显示空白变更内容
内联
并排
Showing
81 changed file
with
232 addition
and
528 deletion
+232
-528
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
+3
-3
src/test/run-pass/alt-path.rs
src/test/run-pass/alt-path.rs
+1
-2
src/test/run-pass/attr-before-view-item2.rs
src/test/run-pass/attr-before-view-item2.rs
+2
-3
src/test/run-pass/binops.rs
src/test/run-pass/binops.rs
+2
-3
src/test/run-pass/c-stack-as-value.rs
src/test/run-pass/c-stack-as-value.rs
+1
-2
src/test/run-pass/c-stack-returning-int64.rs
src/test/run-pass/c-stack-returning-int64.rs
+2
-3
src/test/run-pass/cci_borrow.rs
src/test/run-pass/cci_borrow.rs
+1
-3
src/test/run-pass/cci_capture_clause.rs
src/test/run-pass/cci_capture_clause.rs
+1
-3
src/test/run-pass/cci_nested_exe.rs
src/test/run-pass/cci_nested_exe.rs
+1
-4
src/test/run-pass/cci_no_inline_exe.rs
src/test/run-pass/cci_no_inline_exe.rs
+1
-3
src/test/run-pass/class-exports.rs
src/test/run-pass/class-exports.rs
+8
-11
src/test/run-pass/conditional-compile.rs
src/test/run-pass/conditional-compile.rs
+9
-18
src/test/run-pass/crateresolve2.rs
src/test/run-pass/crateresolve2.rs
+3
-6
src/test/run-pass/crateresolve3.rs
src/test/run-pass/crateresolve3.rs
+2
-4
src/test/run-pass/crateresolve4.rs
src/test/run-pass/crateresolve4.rs
+5
-9
src/test/run-pass/export-abstract-tag.rs
src/test/run-pass/export-abstract-tag.rs
+2
-6
src/test/run-pass/export-glob-imports-target.rs
src/test/run-pass/export-glob-imports-target.rs
+3
-5
src/test/run-pass/export-glob.rs
src/test/run-pass/export-glob.rs
+0
-29
src/test/run-pass/export-multi.rs
src/test/run-pass/export-multi.rs
+2
-5
src/test/run-pass/export-non-interference.rs
src/test/run-pass/export-non-interference.rs
+1
-4
src/test/run-pass/export-tag-variant.rs
src/test/run-pass/export-tag-variant.rs
+1
-5
src/test/run-pass/export-unexported-dep.rs
src/test/run-pass/export-unexported-dep.rs
+2
-6
src/test/run-pass/expr-scope.rs
src/test/run-pass/expr-scope.rs
+1
-3
src/test/run-pass/extern-call-deep.rs
src/test/run-pass/extern-call-deep.rs
+2
-3
src/test/run-pass/extern-call-deep2.rs
src/test/run-pass/extern-call-deep2.rs
+2
-3
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/extern-call-scrub.rs
+2
-3
src/test/run-pass/extern-call.rs
src/test/run-pass/extern-call.rs
+2
-3
src/test/run-pass/extern-stress.rs
src/test/run-pass/extern-stress.rs
+2
-3
src/test/run-pass/extern-yield.rs
src/test/run-pass/extern-yield.rs
+2
-3
src/test/run-pass/foreign-dupe.rs
src/test/run-pass/foreign-dupe.rs
+2
-4
src/test/run-pass/foreign-fn-linkname.rs
src/test/run-pass/foreign-fn-linkname.rs
+1
-2
src/test/run-pass/foreign-lib-path.rs
src/test/run-pass/foreign-lib-path.rs
+2
-3
src/test/run-pass/foreign-mod-unused-const.rs
src/test/run-pass/foreign-mod-unused-const.rs
+1
-2
src/test/run-pass/foreign-no-abi.rs
src/test/run-pass/foreign-no-abi.rs
+1
-2
src/test/run-pass/foreign-struct.rs
src/test/run-pass/foreign-struct.rs
+1
-2
src/test/run-pass/foreign2.rs
src/test/run-pass/foreign2.rs
+5
-9
src/test/run-pass/generic-fn-twice.rs
src/test/run-pass/generic-fn-twice.rs
+1
-2
src/test/run-pass/global-scope.rs
src/test/run-pass/global-scope.rs
+4
-7
src/test/run-pass/import-from-foreign.rs
src/test/run-pass/import-from-foreign.rs
+3
-7
src/test/run-pass/import-from.rs
src/test/run-pass/import-from.rs
+2
-3
src/test/run-pass/import-glob-0.rs
src/test/run-pass/import-glob-0.rs
+10
-20
src/test/run-pass/import-glob-1.rs
src/test/run-pass/import-glob-1.rs
+0
-60
src/test/run-pass/import-trailing-comma.rs
src/test/run-pass/import-trailing-comma.rs
+3
-5
src/test/run-pass/import.rs
src/test/run-pass/import.rs
+2
-4
src/test/run-pass/import2.rs
src/test/run-pass/import2.rs
+1
-2
src/test/run-pass/import3.rs
src/test/run-pass/import3.rs
+2
-4
src/test/run-pass/import4.rs
src/test/run-pass/import4.rs
+1
-2
src/test/run-pass/import5.rs
src/test/run-pass/import5.rs
+3
-7
src/test/run-pass/import6.rs
src/test/run-pass/import6.rs
+3
-7
src/test/run-pass/import7.rs
src/test/run-pass/import7.rs
+5
-11
src/test/run-pass/import8.rs
src/test/run-pass/import8.rs
+1
-2
src/test/run-pass/inner-module.rs
src/test/run-pass/inner-module.rs
+3
-5
src/test/run-pass/intrinsic-alignment.rs
src/test/run-pass/intrinsic-alignment.rs
+2
-3
src/test/run-pass/intrinsic-atomics.rs
src/test/run-pass/intrinsic-atomics.rs
+13
-14
src/test/run-pass/intrinsic-frame-address.rs
src/test/run-pass/intrinsic-frame-address.rs
+1
-2
src/test/run-pass/issue-1251.rs
src/test/run-pass/issue-1251.rs
+1
-2
src/test/run-pass/issue-1866.rs
src/test/run-pass/issue-1866.rs
+6
-10
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-2904.rs
+2
-3
src/test/run-pass/item-attributes.rs
src/test/run-pass/item-attributes.rs
+18
-51
src/test/run-pass/item-name-overload.rs
src/test/run-pass/item-name-overload.rs
+2
-4
src/test/run-pass/keyword-changes-2012-07-31.rs
src/test/run-pass/keyword-changes-2012-07-31.rs
+1
-2
src/test/run-pass/mod-inside-fn.rs
src/test/run-pass/mod-inside-fn.rs
+2
-3
src/test/run-pass/mod-view-items.rs
src/test/run-pass/mod-view-items.rs
+1
-2
src/test/run-pass/morestack-address.rs
src/test/run-pass/morestack-address.rs
+1
-2
src/test/run-pass/morestack6.rs
src/test/run-pass/morestack6.rs
+7
-8
src/test/run-pass/nil-decl-in-foreign.rs
src/test/run-pass/nil-decl-in-foreign.rs
+2
-3
src/test/run-pass/path.rs
src/test/run-pass/path.rs
+1
-2
src/test/run-pass/rec-align-u32.rs
src/test/run-pass/rec-align-u32.rs
+6
-9
src/test/run-pass/rec-align-u64.rs
src/test/run-pass/rec-align-u64.rs
+10
-16
src/test/run-pass/rt-sched-1.rs
src/test/run-pass/rt-sched-1.rs
+4
-5
src/test/run-pass/self-shadowing-import.rs
src/test/run-pass/self-shadowing-import.rs
+4
-8
src/test/run-pass/static-method-xcrate.rs
src/test/run-pass/static-method-xcrate.rs
+0
-1
src/test/run-pass/struct-return.rs
src/test/run-pass/struct-return.rs
+2
-3
src/test/run-pass/syntax-extension-source-utils.rs
src/test/run-pass/syntax-extension-source-utils.rs
+4
-7
src/test/run-pass/tag-exports.rs
src/test/run-pass/tag-exports.rs
+4
-15
src/test/run-pass/type-in-nested-module.rs
src/test/run-pass/type-in-nested-module.rs
+3
-5
src/test/run-pass/use-import-export.rs
src/test/run-pass/use-import-export.rs
+2
-4
src/test/run-pass/use-mod.rs
src/test/run-pass/use-mod.rs
+2
-4
src/test/run-pass/use.rs
src/test/run-pass/use.rs
+2
-3
src/test/run-pass/warn-ctypes-inhibit.rs
src/test/run-pass/warn-ctypes-inhibit.rs
+2
-3
src/test/run-pass/x86stdcall2.rs
src/test/run-pass/x86stdcall2.rs
+4
-4
未找到文件。
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
浏览文件 @
592c2e1d
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
#[link(name
=
"crate_method_reexport_grrrrrrr2"
)]
;
#[link(name
=
"crate_method_reexport_grrrrrrr2"
)]
;
use
name_pool
::
add
;
pub
use
name_pool
::
add
;
mod
name_pool
{
pub
mod
name_pool
{
pub
type
name_pool
=
();
pub
type
name_pool
=
();
pub
trait
add
{
pub
trait
add
{
...
@@ -26,7 +26,7 @@ fn add(s: ~str) {
...
@@ -26,7 +26,7 @@ fn add(s: ~str) {
}
}
pub
mod
rust
{
pub
mod
rust
{
use
name_pool
::
add
;
pub
use
name_pool
::
add
;
pub
type
rt
=
@
();
pub
type
rt
=
@
();
...
...
src/test/run-pass/alt-path.rs
浏览文件 @
592c2e1d
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
mod
m1
{
mod
m1
{
#[legacy_exports]
;
pub
enum
foo
{
foo1
,
foo2
,
}
enum
foo
{
foo1
,
foo2
,
}
}
}
fn
bar
(
x
:
m1
::
foo
)
{
match
x
{
m1
::
foo1
=>
{
}
m1
::
foo2
=>
{
}
}
}
fn
bar
(
x
:
m1
::
foo
)
{
match
x
{
m1
::
foo1
=>
{
}
m1
::
foo2
=>
{
}
}
}
...
...
src/test/run-pass/attr-before-view-item2.rs
浏览文件 @
592c2e1d
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
// error-pattern:expected item
// error-pattern:expected item
mod
m
{
mod
m
{
#[legacy_exports]
;
#[foo
=
"bar"
]
#[foo
=
"bar"
]
extern
mod
std
;
extern
mod
std
;
}
}
...
...
src/test/run-pass/binops.rs
浏览文件 @
592c2e1d
...
@@ -82,9 +82,8 @@ fn test_ptr() {
...
@@ -82,9 +82,8 @@ fn test_ptr() {
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[nolink]
#[nolink]
extern
mod
test
{
extern
mod
test
{
#[legacy_exports]
;
pub
fn
rust_get_sched_id
()
->
libc
::
intptr_t
;
fn
rust_get_sched_id
()
->
libc
::
intptr_t
;
pub
fn
get_task_id
()
->
libc
::
intptr_t
;
fn
get_task_id
()
->
libc
::
intptr_t
;
}
}
struct
p
{
struct
p
{
...
...
src/test/run-pass/c-stack-as-value.rs
浏览文件 @
592c2e1d
...
@@ -10,8 +10,7 @@
...
@@ -10,8 +10,7 @@
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
get_task_id
()
->
libc
::
intptr_t
;
fn
get_task_id
()
->
libc
::
intptr_t
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/c-stack-returning-int64.rs
浏览文件 @
592c2e1d
...
@@ -13,9 +13,8 @@
...
@@ -13,9 +13,8 @@
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[nolink]
#[nolink]
extern
mod
libc
{
extern
mod
libc
{
#[legacy_exports]
;
pub
fn
atol
(
x
:
*
u8
)
->
int
;
fn
atol
(
x
:
*
u8
)
->
int
;
pub
fn
atoll
(
x
:
*
u8
)
->
i64
;
fn
atoll
(
x
:
*
u8
)
->
i64
;
}
}
fn
atol
(
s
:
~
str
)
->
int
{
fn
atol
(
s
:
~
str
)
->
int
{
...
...
src/test/run-pass/cci_borrow.rs
浏览文件 @
592c2e1d
...
@@ -11,12 +11,10 @@
...
@@ -11,12 +11,10 @@
// xfail-fast - check-fast doesn't understand aux-build
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_borrow_lib.rs
// aux-build:cci_borrow_lib.rs
#[legacy_exports]
;
extern
mod
cci_borrow_lib
;
extern
mod
cci_borrow_lib
;
use
cci_borrow_lib
::
foo
;
use
cci_borrow_lib
::
foo
;
fn
main
()
{
pub
fn
main
()
{
let
p
=
@
22u
;
let
p
=
@
22u
;
let
r
=
foo
(
p
);
let
r
=
foo
(
p
);
debug!
(
"r=%u"
,
r
);
debug!
(
"r=%u"
,
r
);
...
...
src/test/run-pass/cci_capture_clause.rs
浏览文件 @
592c2e1d
...
@@ -14,10 +14,8 @@
...
@@ -14,10 +14,8 @@
// This test makes sure we can do cross-crate inlining on functions
// This test makes sure we can do cross-crate inlining on functions
// that use capture clauses.
// that use capture clauses.
#[legacy_exports]
;
extern
mod
cci_capture_clause
;
extern
mod
cci_capture_clause
;
fn
main
()
{
pub
fn
main
()
{
cci_capture_clause
::
foo
(())
.recv
()
cci_capture_clause
::
foo
(())
.recv
()
}
}
src/test/run-pass/cci_nested_exe.rs
浏览文件 @
592c2e1d
...
@@ -11,13 +11,10 @@
...
@@ -11,13 +11,10 @@
// xfail-fast - check-fast doesn't understand aux-build
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_nested_lib.rs
// aux-build:cci_nested_lib.rs
#[legacy_modes]
;
#[legacy_exports]
;
extern
mod
cci_nested_lib
;
extern
mod
cci_nested_lib
;
use
cci_nested_lib
::
*
;
use
cci_nested_lib
::
*
;
fn
main
()
{
pub
fn
main
()
{
let
lst
=
new_int_alist
();
let
lst
=
new_int_alist
();
alist_add
(
lst
,
22
,
~
"hi"
);
alist_add
(
lst
,
22
,
~
"hi"
);
alist_add
(
lst
,
44
,
~
"ho"
);
alist_add
(
lst
,
44
,
~
"ho"
);
...
...
src/test/run-pass/cci_no_inline_exe.rs
浏览文件 @
592c2e1d
...
@@ -11,12 +11,10 @@
...
@@ -11,12 +11,10 @@
// xfail-fast - check-fast doesn't understand aux-build
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_no_inline_lib.rs
// aux-build:cci_no_inline_lib.rs
#[legacy_exports]
;
extern
mod
cci_no_inline_lib
;
extern
mod
cci_no_inline_lib
;
use
cci_no_inline_lib
::
iter
;
use
cci_no_inline_lib
::
iter
;
fn
main
()
{
pub
fn
main
()
{
// Check that a cross-crate call function not marked as inline
// Check that a cross-crate call function not marked as inline
// does not, in fact, get inlined. Also, perhaps more
// does not, in fact, get inlined. Also, perhaps more
// importantly, checks that our scheme of using
// importantly, checks that our scheme of using
...
...
src/test/run-pass/class-exports.rs
浏览文件 @
592c2e1d
...
@@ -16,24 +16,21 @@
...
@@ -16,24 +16,21 @@
use
kitty
::
*
;
use
kitty
::
*
;
mod
kitty
{
mod
kitty
{
#[legacy_exports]
;
pub
struct
cat
{
export
cat
;
struct
cat
{
meows
:
uint
,
meows
:
uint
,
name
:
~
str
,
name
:
~
str
,
}
}
impl
cat
{
pub
impl
cat
{
fn
get_name
()
->
~
str
{
copy
self
.name
}
fn
get_name
()
->
~
str
{
copy
self
.name
}
}
}
fn
cat
(
in_name
:
~
str
)
->
cat
{
pub
fn
cat
(
in_name
:
~
str
)
->
cat
{
cat
{
cat
{
name
:
in_name
,
name
:
in_name
,
meows
:
0u
meows
:
0u
}
}
}
}
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/conditional-compile.rs
浏览文件 @
592c2e1d
...
@@ -22,15 +22,13 @@
...
@@ -22,15 +22,13 @@
#[cfg(bogus)]
#[cfg(bogus)]
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
// This symbol doesn't exist and would be a link error if this
// This symbol doesn't exist and would be a link error if this
// module was translated
// module was translated
fn
bogus
();
pub
fn
bogus
();
}
}
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
extern
mod
rustrt
{}
#[legacy_exports]
;
}
#[cfg(bogus)]
#[cfg(bogus)]
type
t
=
int
;
type
t
=
int
;
...
@@ -66,21 +64,18 @@ fn r(i:int) -> r {
...
@@ -66,21 +64,18 @@ fn r(i:int) -> r {
#[cfg(bogus)]
#[cfg(bogus)]
mod
m
{
mod
m
{
#[legacy_exports]
;
// This needs to parse but would fail in typeck. Since it's not in
// This needs to parse but would fail in typeck. Since it's not in
// the current config it should not be typechecked.
// the current config it should not be typechecked.
fn
bogus
()
{
return
0
;
}
pub
fn
bogus
()
{
return
0
;
}
}
}
mod
m
{
mod
m
{
#[legacy_exports]
;
// Submodules have slightly different code paths than the top-level
// Submodules have slightly different code paths than the top-level
// module, so let's make sure this jazz works here as well
// module, so let's make sure this jazz works here as well
#[cfg(bogus)]
#[cfg(bogus)]
fn
f
()
{
}
pub
fn
f
()
{
}
fn
f
()
{
}
pub
fn
f
()
{
}
}
}
// Since the bogus configuration isn't defined main will just be
// Since the bogus configuration isn't defined main will just be
...
@@ -111,23 +106,19 @@ fn f() { }
...
@@ -111,23 +106,19 @@ fn f() { }
}
}
mod
test_foreign_items
{
mod
test_foreign_items
{
#[legacy_exports]
;
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
pub
extern
mod
rustrt
{
#[legacy_exports]
;
#[cfg(bogus)]
#[cfg(bogus)]
fn
rust_getcwd
()
->
~
str
;
pub
fn
rust_getcwd
()
->
~
str
;
fn
rust_getcwd
()
->
~
str
;
pub
fn
rust_getcwd
()
->
~
str
;
}
}
}
}
mod
test_use_statements
{
mod
test_use_statements
{
#[legacy_exports]
;
#[cfg(bogus)]
#[cfg(bogus)]
use
flippity_foo
;
use
flippity_foo
;
extern
mod
rustrt
{
pub
extern
mod
rustrt
{
#[legacy_exports]
;
#[cfg(bogus)]
#[cfg(bogus)]
use
flippity_foo
;
use
flippity_foo
;
}
}
...
...
src/test/run-pass/crateresolve2.rs
浏览文件 @
592c2e1d
...
@@ -14,21 +14,18 @@
...
@@ -14,21 +14,18 @@
// aux-build:crateresolve2-3.rs
// aux-build:crateresolve2-3.rs
mod
a
{
mod
a
{
#[legacy_exports]
;
extern
mod
crateresolve2
(
vers
=
"0.1"
);
extern
mod
crateresolve2
(
vers
=
"0.1"
);
fn
f
()
{
assert
crateresolve2
::
f
()
==
10
;
}
pub
fn
f
()
{
assert
crateresolve2
::
f
()
==
10
;
}
}
}
mod
b
{
mod
b
{
#[legacy_exports]
;
extern
mod
crateresolve2
(
vers
=
"0.2"
);
extern
mod
crateresolve2
(
vers
=
"0.2"
);
fn
f
()
{
assert
crateresolve2
::
f
()
==
20
;
}
pub
fn
f
()
{
assert
crateresolve2
::
f
()
==
20
;
}
}
}
mod
c
{
mod
c
{
#[legacy_exports]
;
extern
mod
crateresolve2
(
vers
=
"0.3"
);
extern
mod
crateresolve2
(
vers
=
"0.3"
);
fn
f
()
{
assert
crateresolve2
::
f
()
==
30
;
}
pub
fn
f
()
{
assert
crateresolve2
::
f
()
==
30
;
}
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/crateresolve3.rs
浏览文件 @
592c2e1d
...
@@ -16,15 +16,13 @@
...
@@ -16,15 +16,13 @@
// as long as no name collision on invoked functions.
// as long as no name collision on invoked functions.
mod
a
{
mod
a
{
#[legacy_exports]
;
extern
mod
crateresolve3
(
vers
=
"0.1"
);
extern
mod
crateresolve3
(
vers
=
"0.1"
);
fn
f
()
{
assert
crateresolve3
::
f
()
==
10
;
}
pub
fn
f
()
{
assert
crateresolve3
::
f
()
==
10
;
}
}
}
mod
b
{
mod
b
{
#[legacy_exports]
;
extern
mod
crateresolve3
(
vers
=
"0.2"
);
extern
mod
crateresolve3
(
vers
=
"0.2"
);
fn
f
()
{
assert
crateresolve3
::
g
()
==
20
;
}
pub
fn
f
()
{
assert
crateresolve3
::
g
()
==
20
;
}
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/crateresolve4.rs
浏览文件 @
592c2e1d
...
@@ -14,21 +14,17 @@
...
@@ -14,21 +14,17 @@
// aux-build:crateresolve4b-1.rs
// aux-build:crateresolve4b-1.rs
// aux-build:crateresolve4b-2.rs
// aux-build:crateresolve4b-2.rs
#[legacy_exports]
;
pub
mod
a
{
mod
a
{
#[legacy_exports]
;
extern
mod
crateresolve4b
(
vers
=
"0.1"
);
extern
mod
crateresolve4b
(
vers
=
"0.1"
);
fn
f
()
{
assert
crateresolve4b
::
f
()
==
20
;
}
pub
fn
f
()
{
assert
crateresolve4b
::
f
()
==
20
;
}
}
}
mod
b
{
pub
mod
b
{
#[legacy_exports]
;
extern
mod
crateresolve4b
(
vers
=
"0.2"
);
extern
mod
crateresolve4b
(
vers
=
"0.2"
);
fn
f
()
{
assert
crateresolve4b
::
g
()
==
10
;
}
pub
fn
f
()
{
assert
crateresolve4b
::
g
()
==
10
;
}
}
}
fn
main
()
{
pub
fn
main
()
{
a
::
f
();
a
::
f
();
b
::
f
();
b
::
f
();
}
}
src/test/run-pass/export-abstract-tag.rs
浏览文件 @
592c2e1d
...
@@ -12,13 +12,9 @@
...
@@ -12,13 +12,9 @@
// sort of ADT.
// sort of ADT.
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
enum
t
{
t1
,
}
export
t
;
export
f
;
enum
t
{
t1
,
}
pub
fn
f
()
->
t
{
return
t1
;
}
fn
f
()
->
t
{
return
t1
;
}
}
}
fn
main
()
{
let
v
:
foo
::
t
=
foo
::
f
();
}
fn
main
()
{
let
v
:
foo
::
t
=
foo
::
f
();
}
src/test/run-pass/export-glob-imports-target.rs
浏览文件 @
592c2e1d
...
@@ -16,13 +16,11 @@
...
@@ -16,13 +16,11 @@
// Modified to not use export since it's going away. --pcw
// Modified to not use export since it's going away. --pcw
mod
foo
{
mod
foo
{
#[legacy_exports]
;
use
foo
::
bar
::
*
;
use
foo
::
bar
::
*
;
mod
bar
{
pub
mod
bar
{
#[legacy_exports]
;
pub
const
a
:
int
=
10
;
const
a
:
int
=
10
;
}
}
fn
zum
()
{
pub
fn
zum
()
{
let
b
=
a
;
let
b
=
a
;
}
}
}
}
...
...
src/test/run-pass/export-glob.rs
已删除
100644 → 0
浏览文件 @
2a65842c
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Test that a glob-export functions as an explicit
// named export when referenced from outside its scope.
// Modified to not use export since it's going away. --pcw
mod
foo
{
#[legacy_exports]
;
use
foo
::
bar
::
*
;
export
a
;
export
bar
;
mod
bar
{
#[legacy_exports]
;
const
a
:
int
=
10
;
}
}
fn
main
()
{
let
v
=
foo
::
a
;
}
src/test/run-pass/export-multi.rs
浏览文件 @
592c2e1d
...
@@ -14,11 +14,8 @@
...
@@ -14,11 +14,8 @@
use
m
::
g
;
use
m
::
g
;
mod
m
{
mod
m
{
#[legacy_exports]
;
pub
fn
f
()
{
}
export
f
,
g
;
pub
fn
g
()
{
}
fn
f
()
{
}
fn
g
()
{
}
}
}
fn
main
()
{
f
();
g
();
m
::
f
();
m
::
g
();
}
fn
main
()
{
f
();
g
();
m
::
f
();
m
::
g
();
}
src/test/run-pass/export-non-interference.rs
浏览文件 @
592c2e1d
...
@@ -9,9 +9,6 @@
...
@@ -9,9 +9,6 @@
// except according to those terms.
// except according to those terms.
export
foo
;
export
main
;
enum
list_cell
<
T
>
{
cons
(
@
list_cell
<
T
>
),
nil
}
enum
list_cell
<
T
>
{
cons
(
@
list_cell
<
T
>
),
nil
}
fn
main
()
{
}
pub
fn
main
()
{
}
src/test/run-pass/export-tag-variant.rs
浏览文件 @
592c2e1d
...
@@ -8,12 +8,8 @@
...
@@ -8,12 +8,8 @@
// option. This file may not be copied, modified, or distributed
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// except according to those terms.
// Export the enum variants, without the enum
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
enum
t
{
t1
,
}
export
t1
;
enum
t
{
t1
,
}
}
}
fn
main
()
{
let
v
=
foo
::
t1
;
}
fn
main
()
{
let
v
=
foo
::
t1
;
}
src/test/run-pass/export-unexported-dep.rs
浏览文件 @
592c2e1d
...
@@ -12,10 +12,6 @@
...
@@ -12,10 +12,6 @@
// that are not exported, allowing for a sort of poor-man's ADT
// that are not exported, allowing for a sort of poor-man's ADT
mod
foo
{
mod
foo
{
#[legacy_exports]
;
export
f
;
export
g
;
// not exported
// not exported
enum
t
{
t1
,
t2
,
}
enum
t
{
t1
,
t2
,
}
...
@@ -26,9 +22,9 @@ impl t : cmp::Eq {
...
@@ -26,9 +22,9 @@ impl t : cmp::Eq {
pure
fn
ne
(
&
self
,
other
:
&
t
)
->
bool
{
!
(
*
self
)
.eq
(
other
)
}
pure
fn
ne
(
&
self
,
other
:
&
t
)
->
bool
{
!
(
*
self
)
.eq
(
other
)
}
}
}
fn
f
()
->
t
{
return
t1
;
}
pub
fn
f
()
->
t
{
return
t1
;
}
fn
g
(
v
:
t
)
{
assert
(
v
==
t1
);
}
pub
fn
g
(
v
:
t
)
{
assert
(
v
==
t1
);
}
}
}
fn
main
()
{
foo
::
g
(
foo
::
f
());
}
fn
main
()
{
foo
::
g
(
foo
::
f
());
}
src/test/run-pass/expr-scope.rs
浏览文件 @
592c2e1d
...
@@ -11,7 +11,5 @@
...
@@ -11,7 +11,5 @@
// Regression test for issue #762
// Regression test for issue #762
// xfail-fast
// xfail-fast
#[legacy_exports]
;
pub
fn
f
()
{
}
fn
f
()
{
}
fn
main
()
{
return
::
f
();
}
fn
main
()
{
return
::
f
();
}
src/test/run-pass/extern-call-deep.rs
浏览文件 @
592c2e1d
...
@@ -9,8 +9,7 @@
...
@@ -9,8 +9,7 @@
// except according to those terms.
// except according to those terms.
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
}
...
...
src/test/run-pass/extern-call-deep2.rs
浏览文件 @
592c2e1d
...
@@ -9,8 +9,7 @@
...
@@ -9,8 +9,7 @@
// except according to those terms.
// except according to those terms.
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
}
...
...
src/test/run-pass/extern-call-scrub.rs
浏览文件 @
592c2e1d
...
@@ -13,8 +13,7 @@
...
@@ -13,8 +13,7 @@
// directions
// directions
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
}
...
...
src/test/run-pass/extern-call.rs
浏览文件 @
592c2e1d
...
@@ -9,8 +9,7 @@
...
@@ -9,8 +9,7 @@
// except according to those terms.
// except according to those terms.
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
}
...
...
src/test/run-pass/extern-stress.rs
浏览文件 @
592c2e1d
...
@@ -12,8 +12,7 @@
...
@@ -12,8 +12,7 @@
// while holding onto C stacks
// while holding onto C stacks
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
}
...
...
src/test/run-pass/extern-yield.rs
浏览文件 @
592c2e1d
...
@@ -9,8 +9,7 @@
...
@@ -9,8 +9,7 @@
// except according to those terms.
// except according to those terms.
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
}
...
...
src/test/run-pass/foreign-dupe.rs
浏览文件 @
592c2e1d
...
@@ -14,15 +14,13 @@
...
@@ -14,15 +14,13 @@
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[link_name
=
"rustrt"
]
#[link_name
=
"rustrt"
]
extern
mod
rustrt1
{
extern
mod
rustrt1
{
#[legacy_exports]
;
pub
fn
last_os_error
()
->
~
str
;
fn
last_os_error
()
->
~
str
;
}
}
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[link_name
=
"rustrt"
]
#[link_name
=
"rustrt"
]
extern
mod
rustrt2
{
extern
mod
rustrt2
{
#[legacy_exports]
;
pub
fn
last_os_error
()
->
~
str
;
fn
last_os_error
()
->
~
str
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/foreign-fn-linkname.rs
浏览文件 @
592c2e1d
...
@@ -14,9 +14,8 @@
...
@@ -14,9 +14,8 @@
#[nolink]
#[nolink]
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
libc
{
extern
mod
libc
{
#[legacy_exports]
;
#[link_name
=
"strlen"
]
#[link_name
=
"strlen"
]
fn
my_strlen
(
str
:
*
u8
)
->
uint
;
pub
fn
my_strlen
(
str
:
*
u8
)
->
uint
;
}
}
fn
strlen
(
str
:
~
str
)
->
uint
{
fn
strlen
(
str
:
~
str
)
->
uint
{
...
...
src/test/run-pass/foreign-lib-path.rs
浏览文件 @
592c2e1d
...
@@ -16,8 +16,7 @@
...
@@ -16,8 +16,7 @@
// wouthout providing a -L argument to the compiler, and that
// wouthout providing a -L argument to the compiler, and that
// will also be found successfully at runtime.
// will also be found successfully at runtime.
extern
mod
WHATGOESHERE
{
extern
mod
WHATGOESHERE
{
#[legacy_exports]
;
pub
fn
IDONTKNOW
()
->
u32
;
fn
IDONTKNOW
()
->
u32
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/foreign-mod-unused-const.rs
浏览文件 @
592c2e1d
...
@@ -10,8 +10,7 @@
...
@@ -10,8 +10,7 @@
#[nolink]
#[nolink]
extern
mod
foo
{
extern
mod
foo
{
#[legacy_exports]
;
pub
const
errno
:
int
;
const
errno
:
int
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/foreign-no-abi.rs
浏览文件 @
592c2e1d
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
// ABI is cdecl by default
// ABI is cdecl by default
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
get_task_id
()
->
libc
::
intptr_t
;
fn
get_task_id
()
->
libc
::
intptr_t
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/foreign-struct.rs
浏览文件 @
592c2e1d
...
@@ -15,8 +15,7 @@ enum void { }
...
@@ -15,8 +15,7 @@ enum void { }
#[nolink]
#[nolink]
extern
mod
bindgen
{
extern
mod
bindgen
{
#[legacy_exports]
;
pub
fn
printf
(
++
v
:
void
);
fn
printf
(
++
v
:
void
);
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/run-pass/foreign2.rs
浏览文件 @
592c2e1d
...
@@ -10,25 +10,21 @@
...
@@ -10,25 +10,21 @@
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[nolink]
#[nolink]
extern
mod
bar
{
extern
mod
bar
{}
#[legacy_exports]
;
}
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[nolink]
#[nolink]
extern
mod
zed
{
extern
mod
zed
{}
#[legacy_exports]
;
}
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[nolink]
#[nolink]
extern
mod
libc
{
extern
mod
libc
{
#[legacy_exports]
;
pub
fn
write
(
fd
:
int
,
buf
:
*
u8
,
fn
write
(
fd
:
int
,
buf
:
*
u8
,
count
:
::
core
::
libc
::
size_t
)
->
::
core
::
libc
::
ssize_t
;
count
:
::
core
::
libc
::
size_t
)
->
::
core
::
libc
::
ssize_t
;
}
}
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
#[nolink]
#[nolink]
extern
mod
baz
{
extern
mod
baz
{}
#[legacy_exports]
;
}
fn
main
()
{
}
fn
main
()
{
}
src/test/run-pass/generic-fn-twice.rs
浏览文件 @
592c2e1d
...
@@ -13,8 +13,7 @@
...
@@ -13,8 +13,7 @@
// -*- rust -*-
// -*- rust -*-
mod
foomod
{
mod
foomod
{
#[legacy_exports]
;
pub
fn
foo
<
T
>
()
{
}
fn
foo
<
T
>
()
{
}
}
}
fn
main
()
{
foomod
::
foo
::
<
int
>
();
foomod
::
foo
::
<
int
>
();
}
fn
main
()
{
foomod
::
foo
::
<
int
>
();
foomod
::
foo
::
<
int
>
();
}
src/test/run-pass/global-scope.rs
浏览文件 @
592c2e1d
...
@@ -10,14 +10,11 @@
...
@@ -10,14 +10,11 @@
// xfail-fast
// xfail-fast
#[legacy_exports]
;
pub
fn
f
()
->
int
{
return
1
;
}
fn
f
()
->
int
{
return
1
;
}
pub
mod
foo
{
pub
fn
f
()
->
int
{
return
2
;
}
mod
foo
{
pub
fn
g
()
{
assert
(
f
()
==
2
);
assert
(::
f
()
==
1
);
}
#[legacy_exports]
;
fn
f
()
->
int
{
return
2
;
}
fn
g
()
{
assert
(
f
()
==
2
);
assert
(::
f
()
==
1
);
}
}
}
fn
main
()
{
return
foo
::
g
();
}
fn
main
()
{
return
foo
::
g
();
}
...
...
src/test/run-pass/import-from-foreign.rs
浏览文件 @
592c2e1d
...
@@ -11,17 +11,13 @@
...
@@ -11,17 +11,13 @@
// except according to those terms.
// except according to those terms.
mod
spam
{
mod
spam
{
#[legacy_exports]
;
pub
fn
ham
()
{
}
fn
ham
()
{
}
pub
fn
eggs
()
{
}
fn
eggs
()
{
}
}
}
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
use
spam
::{
ham
,
eggs
};
use
spam
::{
ham
,
eggs
};
export
ham
;
export
eggs
;
}
}
fn
main
()
{
rustrt
::
ham
();
rustrt
::
eggs
();
}
fn
main
()
{
rustrt
::
ham
();
rustrt
::
eggs
();
}
src/test/run-pass/import-from.rs
浏览文件 @
592c2e1d
...
@@ -13,9 +13,8 @@
...
@@ -13,9 +13,8 @@
use
spam
::{
ham
,
eggs
};
use
spam
::{
ham
,
eggs
};
mod
spam
{
mod
spam
{
#[legacy_exports]
;
pub
fn
ham
()
{
}
fn
ham
()
{
}
pub
fn
eggs
()
{
}
fn
eggs
()
{
}
}
}
fn
main
()
{
ham
();
eggs
();
}
fn
main
()
{
ham
();
eggs
();
}
src/test/run-pass/import-glob-0.rs
浏览文件 @
592c2e1d
...
@@ -14,30 +14,20 @@
...
@@ -14,30 +14,20 @@
use
dug
::
too
::
greedily
::
and
::
too
::
deep
::
*
;
use
dug
::
too
::
greedily
::
and
::
too
::
deep
::
*
;
mod
module_of_many_things
{
mod
module_of_many_things
{
#[legacy_exports]
;
pub
fn
f1
()
{
debug!
(
"f1"
);
}
export
f1
;
pub
fn
f2
()
{
debug!
(
"f2"
);
}
export
f2
;
export
f4
;
fn
f1
()
{
debug!
(
"f1"
);
}
fn
f2
()
{
debug!
(
"f2"
);
}
fn
f3
()
{
debug!
(
"f3"
);
}
fn
f3
()
{
debug!
(
"f3"
);
}
fn
f4
()
{
debug!
(
"f4"
);
}
pub
fn
f4
()
{
debug!
(
"f4"
);
}
}
}
mod
dug
{
mod
dug
{
#[legacy_exports]
;
pub
mod
too
{
mod
too
{
pub
mod
greedily
{
#[legacy_exports]
;
pub
mod
and
{
mod
greedily
{
pub
mod
too
{
#[legacy_exports]
;
pub
mod
deep
{
mod
and
{
pub
fn
nameless_fear
()
{
debug!
(
"Boo!"
);
}
#[legacy_exports]
;
pub
fn
also_redstone
()
{
debug!
(
"Whatever."
);
}
mod
too
{
#[legacy_exports]
;
mod
deep
{
#[legacy_exports]
;
fn
nameless_fear
()
{
debug!
(
"Boo!"
);
}
fn
also_redstone
()
{
debug!
(
"Whatever."
);
}
}
}
}
}
}
}
...
...
src/test/run-pass/import-glob-1.rs
已删除
100644 → 0
浏览文件 @
2a65842c
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use
a1
::
b1
::
word_traveler
;
mod
a1
{
#[legacy_exports]
;
//
mod
b1
{
#[legacy_exports]
;
//
use
a2
::
b1
::
*
;
// = move\
export
word_traveler
;
// |
}
// |
mod
b2
{
#[legacy_exports]
;
// |
use
a2
::
b2
::
*
;
// = move\ -\ |
export
word_traveler
;
// | | |
}
// | | |
}
// | | |
// | | |
mod
a2
{
#[legacy_exports]
;
// | | |
#[abi
=
"cdecl"
]
#[nolink]
extern
mod
b1
{
#[legacy_exports]
;
// | | |
use
a1
::
b2
::
*
;
// | = move/ -/
export
word_traveler
;
// |
}
// |
mod
b2
{
#[legacy_exports]
;
// |
fn
word_traveler
()
{
// |
debug!
(
"ahoy!"
);
// -/
}
//
}
//
}
//
fn
main
()
{
word_traveler
();
}
src/test/run-pass/import-trailing-comma.rs
浏览文件 @
592c2e1d
...
@@ -13,11 +13,9 @@
...
@@ -13,11 +13,9 @@
use
foo
::
bar
::{
baz
,
quux
,};
use
foo
::
bar
::{
baz
,
quux
,};
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
mod
bar
{
mod
bar
{
pub
fn
baz
()
{
}
#[legacy_exports]
;
pub
fn
quux
()
{
}
fn
baz
()
{
}
fn
quux
()
{
}
}
}
}
}
...
...
src/test/run-pass/import.rs
浏览文件 @
592c2e1d
...
@@ -11,15 +11,13 @@
...
@@ -11,15 +11,13 @@
// except according to those terms.
// except according to those terms.
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
fn
x
(
y
:
int
)
{
log
(
debug
,
y
);
}
fn
x
(
y
:
int
)
{
log
(
debug
,
y
);
}
}
}
mod
bar
{
mod
bar
{
#[legacy_exports]
;
use
foo
::
x
;
use
foo
::
x
;
use
z
=
foo
::
x
;
use
z
=
foo
::
x
;
fn
thing
()
{
x
(
10
);
z
(
10
);
}
pub
fn
thing
()
{
x
(
10
);
z
(
10
);
}
}
}
fn
main
()
{
bar
::
thing
();
}
fn
main
()
{
bar
::
thing
();
}
src/test/run-pass/import2.rs
浏览文件 @
592c2e1d
...
@@ -14,8 +14,7 @@
...
@@ -14,8 +14,7 @@
use
zed
::
bar
;
use
zed
::
bar
;
mod
zed
{
mod
zed
{
#[legacy_exports]
;
pub
fn
bar
()
{
debug!
(
"bar"
);
}
fn
bar
()
{
debug!
(
"bar"
);
}
}
}
fn
main
()
{
bar
();
}
fn
main
()
{
bar
();
}
src/test/run-pass/import3.rs
浏览文件 @
592c2e1d
...
@@ -15,10 +15,8 @@
...
@@ -15,10 +15,8 @@
use
zed
::
bar
;
use
zed
::
bar
;
mod
baz
{
mod
baz
{
#[legacy_exports]
;
pub
mod
zed
{
mod
zed
{
pub
fn
bar
()
{
debug!
(
"bar2"
);
}
#[legacy_exports]
;
fn
bar
()
{
debug!
(
"bar2"
);
}
}
}
}
}
...
...
src/test/run-pass/import4.rs
浏览文件 @
592c2e1d
...
@@ -14,8 +14,7 @@
...
@@ -14,8 +14,7 @@
use
zed
::
bar
;
use
zed
::
bar
;
mod
zed
{
mod
zed
{
#[legacy_exports]
;
pub
fn
bar
()
{
debug!
(
"bar"
);
}
fn
bar
()
{
debug!
(
"bar"
);
}
}
}
fn
main
()
{
let
zed
=
42
;
bar
();
}
fn
main
()
{
let
zed
=
42
;
bar
();
}
src/test/run-pass/import5.rs
浏览文件 @
592c2e1d
...
@@ -12,13 +12,9 @@
...
@@ -12,13 +12,9 @@
use
foo
::
bar
;
use
foo
::
bar
;
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
use
foo
::
zed
::
bar
;
use
foo
::
zed
::
bar
;
pub
mod
zed
{
export
bar
;
pub
fn
bar
()
{
debug!
(
"foo"
);
}
export
zed
;
mod
zed
{
#[legacy_exports]
;
fn
bar
()
{
debug!
(
"foo"
);
}
}
}
}
}
...
...
src/test/run-pass/import6.rs
浏览文件 @
592c2e1d
...
@@ -13,15 +13,11 @@
...
@@ -13,15 +13,11 @@
use
foo
::
zed
;
use
foo
::
zed
;
use
bar
::
baz
;
use
bar
::
baz
;
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
mod
zed
{
mod
zed
{
pub
fn
baz
()
{
debug!
(
"baz"
);
}
#[legacy_exports]
;
fn
baz
()
{
debug!
(
"baz"
);
}
}
}
}
}
mod
bar
{
mod
bar
{
#[legacy_exports]
;
pub
use
zed
::
baz
;
use
zed
::
baz
;
export
baz
;
}
}
fn
main
()
{
baz
();
}
fn
main
()
{
baz
();
}
src/test/run-pass/import7.rs
浏览文件 @
592c2e1d
...
@@ -13,20 +13,14 @@
...
@@ -13,20 +13,14 @@
use
foo
::
zed
;
use
foo
::
zed
;
use
bar
::
baz
;
use
bar
::
baz
;
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
mod
zed
{
mod
zed
{
pub
fn
baz
()
{
debug!
(
"baz"
);
}
#[legacy_exports]
;
fn
baz
()
{
debug!
(
"baz"
);
}
}
}
}
}
mod
bar
{
mod
bar
{
#[legacy_exports]
;
pub
use
zed
::
baz
;
use
zed
::
baz
;
pub
mod
foo
{
export
baz
;
pub
mod
zed
{}
mod
foo
{
#[legacy_exports]
;
mod
zed
{
#[legacy_exports]
;
}
}
}
}
}
fn
main
()
{
baz
();
}
fn
main
()
{
baz
();
}
src/test/run-pass/import8.rs
浏览文件 @
592c2e1d
...
@@ -15,8 +15,7 @@
...
@@ -15,8 +15,7 @@
use
z
=
foo
::
x
;
use
z
=
foo
::
x
;
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
fn
x
(
y
:
int
)
{
log
(
debug
,
y
);
}
fn
x
(
y
:
int
)
{
log
(
debug
,
y
);
}
}
}
fn
main
()
{
x
(
10
);
z
(
10
);
}
fn
main
()
{
x
(
10
);
z
(
10
);
}
src/test/run-pass/inner-module.rs
浏览文件 @
592c2e1d
...
@@ -13,12 +13,10 @@
...
@@ -13,12 +13,10 @@
// -*- rust -*-
// -*- rust -*-
mod
inner
{
mod
inner
{
#[legacy_exports]
;
pub
mod
inner2
{
mod
inner2
{
pub
fn
hello
()
{
debug!
(
"hello, modular world"
);
}
#[legacy_exports]
;
fn
hello
()
{
debug!
(
"hello, modular world"
);
}
}
}
fn
hello
()
{
inner2
::
hello
();
}
pub
fn
hello
()
{
inner2
::
hello
();
}
}
}
fn
main
()
{
inner
::
hello
();
inner
::
inner2
::
hello
();
}
fn
main
()
{
inner
::
hello
();
inner
::
inner2
::
hello
();
}
src/test/run-pass/intrinsic-alignment.rs
浏览文件 @
592c2e1d
...
@@ -12,9 +12,8 @@
...
@@ -12,9 +12,8 @@
#[abi
=
"rust-intrinsic"
]
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
extern
mod
rusti
{
#[legacy_exports]
;
pub
fn
pref_align_of
<
T
>
()
->
uint
;
fn
pref_align_of
<
T
>
()
->
uint
;
pub
fn
min_align_of
<
T
>
()
->
uint
;
fn
min_align_of
<
T
>
()
->
uint
;
}
}
#[cfg(target_os
=
"linux"
)]
#[cfg(target_os
=
"linux"
)]
...
...
src/test/run-pass/intrinsic-atomics.rs
浏览文件 @
592c2e1d
...
@@ -10,22 +10,21 @@
...
@@ -10,22 +10,21 @@
#[abi
=
"rust-intrinsic"
]
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
extern
mod
rusti
{
#[legacy_exports]
;
pub
fn
atomic_cxchg
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
fn
atomic_cxchg
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
pub
fn
atomic_cxchg_acq
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
fn
atomic_cxchg_acq
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
pub
fn
atomic_cxchg_rel
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
fn
atomic_cxchg_rel
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xchg
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xchg
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xchg_acq
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xchg_acq
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xchg_rel
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xchg_rel
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xadd
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xadd
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xadd_acq
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xadd_acq
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xadd_rel
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xadd_rel
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xsub
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xsub
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xsub_acq
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xsub_acq
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
pub
fn
atomic_xsub_rel
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
fn
atomic_xsub_rel
(
dst
:
&
mut
int
,
src
:
int
)
->
int
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/intrinsic-frame-address.rs
浏览文件 @
592c2e1d
...
@@ -12,8 +12,7 @@
...
@@ -12,8 +12,7 @@
#[legacy_modes]
;
#[legacy_modes]
;
#[abi
=
"rust-intrinsic"
]
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
extern
mod
rusti
{
#[legacy_exports]
;
pub
fn
frame_address
(
f
:
&
once
fn
(
*
u8
));
fn
frame_address
(
f
:
&
once
fn
(
*
u8
));
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/issue-1251.rs
浏览文件 @
592c2e1d
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
#[link(name
=
"get_task_id"
)]
;
#[link(name
=
"get_task_id"
)]
;
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
get_task_id
()
->
libc
::
intptr_t
;
fn
get_task_id
()
->
libc
::
intptr_t
;
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/run-pass/issue-1866.rs
浏览文件 @
592c2e1d
...
@@ -10,20 +10,16 @@
...
@@ -10,20 +10,16 @@
// xfail-test
// xfail-test
mod
a
{
mod
a
{
#[legacy_exports]
;
pub
type
rust_task
=
uint
;
type
rust_task
=
uint
;
pub
extern
mod
rustrt
{
extern
mod
rustrt
{
pub
fn
rust_task_is_unwinding
(
rt
:
*
rust_task
)
->
bool
;
#[legacy_exports]
;
fn
rust_task_is_unwinding
(
rt
:
*
rust_task
)
->
bool
;
}
}
}
}
mod
b
{
mod
b
{
#[legacy_exports]
;
pub
type
rust_task
=
bool
;
type
rust_task
=
bool
;
pub
extern
mod
rustrt
{
extern
mod
rustrt
{
pub
fn
rust_task_is_unwinding
(
rt
:
*
rust_task
)
->
bool
;
#[legacy_exports]
;
fn
rust_task_is_unwinding
(
rt
:
*
rust_task
)
->
bool
;
}
}
}
}
...
...
src/test/run-pass/issue-2904.rs
浏览文件 @
592c2e1d
...
@@ -75,14 +75,13 @@ fn read_board_grid<rdr: &static io::Reader>(+in: rdr) -> ~[~[square]] {
...
@@ -75,14 +75,13 @@ fn read_board_grid<rdr: &static io::Reader>(+in: rdr) -> ~[~[square]] {
}
}
mod
test
{
mod
test
{
#[legacy_exports]
;
#[test]
#[test]
fn
trivial_to_str
()
{
pub
fn
trivial_to_str
()
{
assert
lambda
.to_str
()
==
"
\\
"
assert
lambda
.to_str
()
==
"
\\
"
}
}
#[test]
#[test]
fn
read_simple_board
()
{
pub
fn
read_simple_board
()
{
let
s
=
include_str!
(
"./maps/contest1.map"
);
let
s
=
include_str!
(
"./maps/contest1.map"
);
io
::
with_str_reader
(
s
,
read_board_grid
)
io
::
with_str_reader
(
s
,
read_board_grid
)
}
}
...
...
src/test/run-pass/item-attributes.rs
浏览文件 @
592c2e1d
...
@@ -25,49 +25,40 @@
...
@@ -25,49 +25,40 @@
// These are are attributes of the following mod
// These are are attributes of the following mod
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
mod
test_first_item_in_file_mod
{
mod
test_first_item_in_file_mod
{}
#[legacy_exports]
;
}
mod
test_single_attr_outer
{
mod
test_single_attr_outer
{
#[legacy_exports]
;
#[attr
=
"val"
]
#[attr
=
"val"
]
const
x
:
int
=
10
;
pub
const
x
:
int
=
10
;
#[attr
=
"val"
]
#[attr
=
"val"
]
fn
f
()
{
}
pub
fn
f
()
{
}
#[attr
=
"val"
]
#[attr
=
"val"
]
mod
mod1
{
pub
mod
mod1
{}
#[legacy_exports]
;
}
#[attr
=
"val"
]
#[attr
=
"val"
]
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
pub
extern
mod
rustrt
{}
#[legacy_exports]
;
}
}
}
mod
test_multi_attr_outer
{
mod
test_multi_attr_outer
{
#[legacy_exports]
;
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
const
x
:
int
=
10
;
pub
const
x
:
int
=
10
;
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
fn
f
()
{
}
pub
fn
f
()
{
}
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
mod
mod1
{
pub
mod
mod1
{}
#[legacy_exports]
;
}
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
pub
extern
mod
rustrt
{}
#[legacy_exports]
;
}
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
...
@@ -75,10 +66,7 @@ mod mod1 {
...
@@ -75,10 +66,7 @@ mod mod1 {
}
}
mod
test_stmt_single_attr_outer
{
mod
test_stmt_single_attr_outer
{
#[legacy_exports]
;
pub
fn
f
()
{
fn
f
()
{
#[attr
=
"val"
]
#[attr
=
"val"
]
const
x
:
int
=
10
;
const
x
:
int
=
10
;
...
@@ -87,21 +75,17 @@ fn f() { }
...
@@ -87,21 +75,17 @@ fn f() { }
#[attr
=
"val"
]
#[attr
=
"val"
]
mod
mod1
{
mod
mod1
{
#[legacy_exports]
;
}
}
#[attr
=
"val"
]
#[attr
=
"val"
]
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
}
}
}
}
}
}
mod
test_stmt_multi_attr_outer
{
mod
test_stmt_multi_attr_outer
{
#[legacy_exports]
;
pub
fn
f
()
{
fn
f
()
{
#[attr1
=
"val"
]
#[attr1
=
"val"
]
#[attr2
=
"val"
]
#[attr2
=
"val"
]
...
@@ -115,34 +99,26 @@ fn f() { }
...
@@ -115,34 +99,26 @@ fn f() { }
#[attr1 = "val"]
#[attr1 = "val"]
#[attr2 = "val"]
#[attr2 = "val"]
mod mod1 {
mod mod1 {
#[legacy_exports];
}
}
#[attr1 = "val"]
#[attr1 = "val"]
#[attr2 = "val"]
#[attr2 = "val"]
#[abi = "cdecl"]
#[abi = "cdecl"]
extern mod rustrt {
extern mod rustrt {
#[legacy_exports];
}
}
*/
*/
}
}
}
}
mod
test_attr_inner
{
mod
test_attr_inner
{
#[legacy_exports]
;
pub
mod
m
{
mod
m
{
#[legacy_exports]
;
// This is an attribute of mod m
// This is an attribute of mod m
#[attr
=
"val"
]
;
#[attr
=
"val"
]
;
}
}
}
}
mod
test_attr_inner_then_outer
{
mod
test_attr_inner_then_outer
{
#[legacy_exports]
;
pub
mod
m
{
mod
m
{
#[legacy_exports]
;
// This is an attribute of mod m
// This is an attribute of mod m
#[attr
=
"val"
]
;
#[attr
=
"val"
]
;
// This is an attribute of fn f
// This is an attribute of fn f
...
@@ -152,9 +128,7 @@ fn f() { }
...
@@ -152,9 +128,7 @@ fn f() { }
}
}
mod
test_attr_inner_then_outer_multi
{
mod
test_attr_inner_then_outer_multi
{
#[legacy_exports]
;
pub
mod
m
{
mod
m
{
#[legacy_exports]
;
// This is an attribute of mod m
// This is an attribute of mod m
#[attr1
=
"val"
]
;
#[attr1
=
"val"
]
;
#[attr2
=
"val"
]
;
#[attr2
=
"val"
]
;
...
@@ -166,11 +140,9 @@ fn f() { }
...
@@ -166,11 +140,9 @@ fn f() { }
}
}
mod
test_distinguish_syntax_ext
{
mod
test_distinguish_syntax_ext
{
#[legacy_exports]
;
extern
mod
std
;
extern
mod
std
;
fn
f
()
{
pub
fn
f
()
{
fmt!
(
"test%s"
,
~
"s"
);
fmt!
(
"test%s"
,
~
"s"
);
#[attr
=
"val"
]
#[attr
=
"val"
]
fn
g
()
{
}
fn
g
()
{
}
...
@@ -178,19 +150,16 @@ fn g() { }
...
@@ -178,19 +150,16 @@ fn g() { }
}
}
mod
test_other_forms
{
mod
test_other_forms
{
#[legacy_exports]
;
#[attr]
#[attr]
#[attr(word)]
#[attr(word)]
#[attr(attr(word))]
#[attr(attr(word))]
#[attr(key1
=
"val"
,
key2
=
"val"
,
attr)]
#[attr(key1
=
"val"
,
key2
=
"val"
,
attr)]
fn
f
()
{
}
pub
fn
f
()
{
}
}
}
mod
test_foreign_items
{
mod
test_foreign_items
{
#[legacy_exports]
;
#[abi
=
"cdecl"
]
#[abi
=
"cdecl"
]
extern
mod
rustrt
{
pub
extern
mod
rustrt
{
#[legacy_exports]
;
#[attr]
;
#[attr]
;
#[attr]
#[attr]
...
@@ -199,7 +168,6 @@ mod test_foreign_items {
...
@@ -199,7 +168,6 @@ mod test_foreign_items {
}
}
mod
test_literals
{
mod
test_literals
{
#[legacy_exports]
;
#[str
=
"s"
]
;
#[str
=
"s"
]
;
#[char
=
'c'
]
;
#[char
=
'c'
]
;
#[int
=
100
]
;
#[int
=
100
]
;
...
@@ -209,8 +177,7 @@ mod test_literals {
...
@@ -209,8 +177,7 @@ mod test_literals {
#[mach_float
=
1.0f32
]
;
#[mach_float
=
1.0f32
]
;
#[
nil
=
()]
;
#[
nil
=
()]
;
#[bool
=
true
]
;
#[bool
=
true
]
;
mod
m
{
mod
m
{}
#[legacy_exports]
;
}
}
}
fn
test_fn_inner
()
{
fn
test_fn_inner
()
{
...
...
src/test/run-pass/item-name-overload.rs
浏览文件 @
592c2e1d
...
@@ -13,13 +13,11 @@
...
@@ -13,13 +13,11 @@
// -*- rust -*-
// -*- rust -*-
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
fn
baz
()
{
}
fn
baz
()
{
}
}
}
mod
bar
{
mod
bar
{
#[legacy_exports]
;
pub
fn
baz
()
{
}
fn
baz
()
{
}
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/run-pass/keyword-changes-2012-07-31.rs
浏览文件 @
592c2e1d
...
@@ -16,7 +16,6 @@ fn main() {
...
@@ -16,7 +16,6 @@ fn main() {
}
}
mod
foo
{
mod
foo
{
#[legacy_exports]
;
}
}
fn
bar
()
->
int
{
fn
bar
()
->
int
{
...
...
src/test/run-pass/mod-inside-fn.rs
浏览文件 @
592c2e1d
...
@@ -10,8 +10,7 @@
...
@@ -10,8 +10,7 @@
fn
f
()
->
int
{
fn
f
()
->
int
{
mod
m
{
mod
m
{
#[legacy_exports]
;
pub
fn
g
()
->
int
{
720
}
fn
g
()
->
int
{
720
}
}
}
m
::
g
()
m
::
g
()
...
...
src/test/run-pass/mod-view-items.rs
浏览文件 @
592c2e1d
...
@@ -17,9 +17,8 @@
...
@@ -17,9 +17,8 @@
// begin failing.
// begin failing.
mod
m
{
mod
m
{
#[legacy_exports]
;
use
core
::
vec
;
use
core
::
vec
;
fn
f
()
->
~
[
int
]
{
vec
::
from_elem
(
1u
,
0
)
}
pub
fn
f
()
->
~
[
int
]
{
vec
::
from_elem
(
1u
,
0
)
}
}
}
fn
main
()
{
let
x
=
m
::
f
();
}
fn
main
()
{
let
x
=
m
::
f
();
}
src/test/run-pass/morestack-address.rs
浏览文件 @
592c2e1d
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
#[nolink]
#[nolink]
#[abi
=
"rust-intrinsic"
]
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
extern
mod
rusti
{
#[legacy_exports]
;
pub
fn
morestack_addr
()
->
*
();
fn
morestack_addr
()
->
*
();
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/morestack6.rs
浏览文件 @
592c2e1d
...
@@ -12,15 +12,14 @@
...
@@ -12,15 +12,14 @@
// external symbols as close to the red zone as possible.
// external symbols as close to the red zone as possible.
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
debug_get_stk_seg
()
->
*
u8
;
fn
debug_get_stk_seg
()
->
*
u8
;
fn
rust_get_sched_id
()
->
libc
::
intptr_t
;
pub
fn
rust_get_sched_id
()
->
libc
::
intptr_t
;
fn
last_os_error
()
->
~
str
;
pub
fn
last_os_error
()
->
~
str
;
fn
rust_getcwd
()
->
~
str
;
pub
fn
rust_getcwd
()
->
~
str
;
fn
get_task_id
()
->
libc
::
intptr_t
;
pub
fn
get_task_id
()
->
libc
::
intptr_t
;
fn
rust_sched_threads
();
pub
fn
rust_sched_threads
();
fn
rust_get_task
();
pub
fn
rust_get_task
();
}
}
fn
calllink01
()
{
unsafe
{
rustrt
::
rust_get_sched_id
();
}
}
fn
calllink01
()
{
unsafe
{
rustrt
::
rust_get_sched_id
();
}
}
...
...
src/test/run-pass/nil-decl-in-foreign.rs
浏览文件 @
592c2e1d
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
// Issue #901
// Issue #901
#[nolink]
#[nolink]
extern
mod
libc
{
extern
mod
libc
{
#[legacy_exports]
;
pub
fn
printf
(
x
:
());
fn
printf
(
x
:
());
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/run-pass/path.rs
浏览文件 @
592c2e1d
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
fn
bar
(
offset
:
uint
)
{
}
fn
bar
(
offset
:
uint
)
{
}
}
}
fn
main
()
{
foo
::
bar
(
0u
);
}
fn
main
()
{
foo
::
bar
(
0u
);
}
src/test/run-pass/rec-align-u32.rs
浏览文件 @
592c2e1d
...
@@ -12,9 +12,8 @@
...
@@ -12,9 +12,8 @@
#[abi
=
"rust-intrinsic"
]
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
extern
mod
rusti
{
#[legacy_exports]
;
pub
fn
pref_align_of
<
T
>
()
->
uint
;
fn
pref_align_of
<
T
>
()
->
uint
;
pub
fn
min_align_of
<
T
>
()
->
uint
;
fn
min_align_of
<
T
>
()
->
uint
;
}
}
// This is the type with the questionable alignment
// This is the type with the questionable alignment
...
@@ -32,16 +31,14 @@ struct Outer {
...
@@ -32,16 +31,14 @@ struct Outer {
#[cfg(target_arch
=
"x86"
)]
#[cfg(target_arch
=
"x86"
)]
mod
m
{
mod
m
{
#[legacy_exports]
;
pub
fn
align
()
->
uint
{
4u
}
fn
align
()
->
uint
{
4u
}
pub
fn
size
()
->
uint
{
8u
}
fn
size
()
->
uint
{
8u
}
}
}
#[cfg(target_arch
=
"x86_64"
)]
#[cfg(target_arch
=
"x86_64"
)]
mod
m
{
mod
m
{
#[legacy_exports]
;
pub
fn
align
()
->
uint
{
4u
}
fn
align
()
->
uint
{
4u
}
pub
fn
size
()
->
uint
{
8u
}
fn
size
()
->
uint
{
8u
}
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/rec-align-u64.rs
浏览文件 @
592c2e1d
...
@@ -12,9 +12,8 @@
...
@@ -12,9 +12,8 @@
#[abi
=
"rust-intrinsic"
]
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
extern
mod
rusti
{
#[legacy_exports]
;
pub
fn
pref_align_of
<
T
>
()
->
uint
;
fn
pref_align_of
<
T
>
()
->
uint
;
pub
fn
min_align_of
<
T
>
()
->
uint
;
fn
min_align_of
<
T
>
()
->
uint
;
}
}
// This is the type with the questionable alignment
// This is the type with the questionable alignment
...
@@ -34,30 +33,25 @@ struct Outer {
...
@@ -34,30 +33,25 @@ struct Outer {
#[cfg(target_os
=
"macos"
)]
#[cfg(target_os
=
"macos"
)]
#[cfg(target_os
=
"freebsd"
)]
#[cfg(target_os
=
"freebsd"
)]
mod
m
{
mod
m
{
#[legacy_exports]
;
#[cfg(target_arch
=
"x86"
)]
#[cfg(target_arch
=
"x86"
)]
mod
m
{
pub
mod
m
{
#[legacy_exports]
;
pub
fn
align
()
->
uint
{
4u
}
fn
align
()
->
uint
{
4u
}
pub
fn
size
()
->
uint
{
12u
}
fn
size
()
->
uint
{
12u
}
}
}
#[cfg(target_arch
=
"x86_64"
)]
#[cfg(target_arch
=
"x86_64"
)]
mod
m
{
mod
m
{
#[legacy_exports]
;
pub
fn
align
()
->
uint
{
8u
}
fn
align
()
->
uint
{
8u
}
pub
fn
size
()
->
uint
{
16u
}
fn
size
()
->
uint
{
16u
}
}
}
}
}
#[cfg(target_os
=
"win32"
)]
#[cfg(target_os
=
"win32"
)]
mod
m
{
mod
m
{
#[legacy_exports]
;
#[cfg(target_arch
=
"x86"
)]
#[cfg(target_arch
=
"x86"
)]
mod
m
{
pub
mod
m
{
#[legacy_exports]
;
pub
fn
align
()
->
uint
{
8u
}
fn
align
()
->
uint
{
8u
}
pub
fn
size
()
->
uint
{
16u
}
fn
size
()
->
uint
{
16u
}
}
}
}
}
...
...
src/test/run-pass/rt-sched-1.rs
浏览文件 @
592c2e1d
...
@@ -19,11 +19,10 @@
...
@@ -19,11 +19,10 @@
type
closure
=
*
libc
::
c_void
;
type
closure
=
*
libc
::
c_void
;
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
rust_new_sched
(
num_threads
:
libc
::
uintptr_t
)
->
sched_id
;
fn
rust_new_sched
(
num_threads
:
libc
::
uintptr_t
)
->
sched_id
;
pub
fn
rust_get_sched_id
()
->
sched_id
;
fn
rust_get_sched_id
()
->
sched_id
;
pub
fn
rust_new_task_in_sched
(
id
:
sched_id
)
->
task_id
;
fn
rust_new_task_in_sched
(
id
:
sched_id
)
->
task_id
;
pub
fn
start_task
(
id
:
task_id
,
f
:
closure
);
fn
start_task
(
id
:
task_id
,
f
:
closure
);
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/self-shadowing-import.rs
浏览文件 @
592c2e1d
...
@@ -11,20 +11,16 @@
...
@@ -11,20 +11,16 @@
// except according to those terms.
// except according to those terms.
mod
a
{
mod
a
{
#[legacy_exports]
;
pub
mod
b
{
mod
b
{
pub
mod
a
{
#[legacy_exports]
;
pub
fn
foo
()
->
int
{
return
1
;
}
mod
a
{
#[legacy_exports]
;
fn
foo
()
->
int
{
return
1
;
}
}
}
}
}
}
}
mod
c
{
mod
c
{
#[legacy_exports]
;
use
a
::
b
::
a
;
use
a
::
b
::
a
;
fn
bar
()
{
assert
(
a
::
foo
()
==
1
);
}
pub
fn
bar
()
{
assert
(
a
::
foo
()
==
1
);
}
}
}
fn
main
()
{
c
::
bar
();
}
fn
main
()
{
c
::
bar
();
}
src/test/run-pass/static-method-xcrate.rs
浏览文件 @
592c2e1d
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
// xfail-fast
// xfail-fast
// aux-build:static-methods-crate.rs
// aux-build:static-methods-crate.rs
#[legacy_exports]
;
extern
mod
static_methods_crate
;
extern
mod
static_methods_crate
;
use
static_methods_crate
::
read
;
use
static_methods_crate
::
read
;
...
...
src/test/run-pass/struct-return.rs
浏览文件 @
592c2e1d
...
@@ -13,9 +13,8 @@ struct Floats { a: f64, b: u8, c: f64 }
...
@@ -13,9 +13,8 @@ struct Floats { a: f64, b: u8, c: f64 }
#[nolink]
#[nolink]
extern
mod
rustrt
{
extern
mod
rustrt
{
#[legacy_exports]
;
pub
fn
debug_abi_1
(
++
q
:
Quad
)
->
Quad
;
fn
debug_abi_1
(
++
q
:
Quad
)
->
Quad
;
pub
fn
debug_abi_2
(
++
f
:
Floats
)
->
Floats
;
fn
debug_abi_2
(
++
f
:
Floats
)
->
Floats
;
}
}
fn
test1
()
{
fn
test1
()
{
...
...
src/test/run-pass/syntax-extension-source-utils.rs
浏览文件 @
592c2e1d
...
@@ -10,18 +10,15 @@
...
@@ -10,18 +10,15 @@
// This test is brittle!
// This test is brittle!
// xfail-pretty - the pretty tests lose path information, breaking include!
// xfail-pretty - the pretty tests lose path information, breaking include!
#[legacy_exports]
;
mod
m1
{
pub
mod
m1
{
#[legacy_exports]
;
pub
mod
m2
{
mod
m2
{
pub
fn
where_am_i
()
->
~
str
{
(
module_path!
())
.to_owned
()
}
#[legacy_exports]
;
fn
where_am_i
()
->
~
str
{
(
module_path!
())
.to_owned
()
}
}
}
}
}
fn
main
()
{
fn
main
()
{
assert
(
line!
()
==
2
4
);
assert
(
line!
()
==
2
1
);
assert
(
col!
()
==
11
);
assert
(
col!
()
==
11
);
assert
(
file!
()
.to_owned
()
.ends_with
(
~
"syntax-extension-source-utils.rs"
));
assert
(
file!
()
.to_owned
()
.ends_with
(
~
"syntax-extension-source-utils.rs"
));
assert
(
stringify!
((
2
*
3
)
+
5
)
.to_owned
()
==
~
"( 2 * 3 ) + 5"
);
assert
(
stringify!
((
2
*
3
)
+
5
)
.to_owned
()
==
~
"( 2 * 3 ) + 5"
);
...
...
src/test/run-pass/tag-exports.rs
浏览文件 @
592c2e1d
...
@@ -13,21 +13,10 @@
...
@@ -13,21 +13,10 @@
use
alder
::
*
;
use
alder
::
*
;
mod
alder
{
mod
alder
{
#[legacy_exports]
;
pub
enum
burnside
{
couch
,
davis
}
export
burnside
;
pub
enum
everett
{
flanders
,
glisan
,
hoyt
}
export
couch
;
pub
enum
irving
{
johnson
,
kearney
,
lovejoy
}
export
everett
;
pub
enum
marshall
{
northrup
,
overton
}
export
flanders
;
export
irving
;
export
johnson
;
export
kearney
;
export
marshall
;
enum
burnside
{
couch
,
davis
}
enum
everett
{
flanders
,
glisan
,
hoyt
}
enum
irving
{
johnson
,
kearney
,
lovejoy
}
enum
marshall
{
northrup
,
overton
}
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/type-in-nested-module.rs
浏览文件 @
592c2e1d
...
@@ -11,12 +11,10 @@
...
@@ -11,12 +11,10 @@
mod
a
{
mod
a
{
#[legacy_exports]
;
pub
mod
b
{
mod
b
{
pub
type
t
=
int
;
#[legacy_exports]
;
type
t
=
int
;
fn
foo
()
{
let
x
:
t
=
10
;
}
pub
fn
foo
()
{
let
x
:
t
=
10
;
}
}
}
}
}
...
...
src/test/run-pass/use-import-export.rs
浏览文件 @
592c2e1d
...
@@ -11,13 +11,11 @@
...
@@ -11,13 +11,11 @@
mod
foo
{
mod
foo
{
#[legacy_exports]
;
pub
fn
x
()
->
int
{
return
1
;
}
fn
x
()
->
int
{
return
1
;
}
}
}
mod
bar
{
mod
bar
{
#[legacy_exports]
;
pub
fn
y
()
->
int
{
return
1
;
}
fn
y
()
->
int
{
return
1
;
}
}
}
fn
main
()
{
foo
::
x
();
bar
::
y
();
}
fn
main
()
{
foo
::
x
();
bar
::
y
();
}
src/test/run-pass/use-mod.rs
浏览文件 @
592c2e1d
...
@@ -13,10 +13,8 @@
...
@@ -13,10 +13,8 @@
use
mod
a
::
b
;
use
mod
a
::
b
;
mod
a
{
mod
a
{
#[legacy_exports]
;
pub
mod
b
{
mod
b
{
pub
fn
f
()
{}
#[legacy_exports]
;
fn
f
()
{}
}
}
}
}
...
...
src/test/run-pass/use.rs
浏览文件 @
592c2e1d
...
@@ -19,9 +19,8 @@
...
@@ -19,9 +19,8 @@
use
core
::
str
;
use
core
::
str
;
use
x
=
zed
::
str
;
use
x
=
zed
::
str
;
mod
baz
{
mod
baz
{
#[legacy_exports]
;
pub
use
bar
::
str
;
use
bar
::
str
;
pub
use
x
=
core
::
str
;
use
x
=
core
::
str
;
}
}
fn
main
()
{
}
fn
main
()
{
}
src/test/run-pass/warn-ctypes-inhibit.rs
浏览文件 @
592c2e1d
...
@@ -14,8 +14,7 @@
...
@@ -14,8 +14,7 @@
#[nolink]
#[nolink]
extern
mod
libc
{
extern
mod
libc
{
#[legacy_exports]
;
pub
fn
malloc
(
size
:
int
)
->
*
u8
;
fn
malloc
(
size
:
int
)
->
*
u8
;
}
}
fn
main
()
{
fn
main
()
{
...
...
src/test/run-pass/x86stdcall2.rs
浏览文件 @
592c2e1d
...
@@ -17,10 +17,10 @@
...
@@ -17,10 +17,10 @@
#[cfg(target_os
=
"win32"
)]
#[cfg(target_os
=
"win32"
)]
#[abi
=
"stdcall"
]
#[abi
=
"stdcall"
]
extern
mod
kernel32
{
extern
mod
kernel32
{
#[legacy_exports]
;
pub
fn
GetProcessHeap
()
->
HANDLE
;
fn
GetProcessHeap
()
->
HANDLE
;
pub
fn
HeapAlloc
(
hHeap
:
HANDLE
,
dwFlags
:
DWORD
,
dwBytes
:
SIZE_T
)
fn
HeapAlloc
(
hHeap
:
HANDLE
,
dwFlags
:
DWORD
,
dwBytes
:
SIZE_T
)
->
LPVOID
;
->
LPVOID
;
fn
HeapFree
(
hHeap
:
HANDLE
,
dwFlags
:
DWORD
,
lpMem
:
LPVOID
)
->
BOOL
;
pub
fn
HeapFree
(
hHeap
:
HANDLE
,
dwFlags
:
DWORD
,
lpMem
:
LPVOID
)
->
BOOL
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录