Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
2a65842c
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,发现更多精彩内容 >>
提交
2a65842c
编写于
1月 30, 2013
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: De-export aux, bench, compile-fail, and run-fail. rs=deexporting
上级
77f2aac3
变更
85
隐藏空白更改
内联
并排
Showing
85 changed file
with
218 addition
and
409 deletion
+218
-409
src/test/auxiliary/cci_borrow_lib.rs
src/test/auxiliary/cci_borrow_lib.rs
+1
-3
src/test/auxiliary/cci_class.rs
src/test/auxiliary/cci_class.rs
+6
-11
src/test/auxiliary/cci_class_2.rs
src/test/auxiliary/cci_class_2.rs
+9
-12
src/test/auxiliary/cci_class_3.rs
src/test/auxiliary/cci_class_3.rs
+7
-13
src/test/auxiliary/cci_class_4.rs
src/test/auxiliary/cci_class_4.rs
+21
-26
src/test/auxiliary/cci_class_5.rs
src/test/auxiliary/cci_class_5.rs
+3
-4
src/test/auxiliary/cci_class_6.rs
src/test/auxiliary/cci_class_6.rs
+13
-18
src/test/auxiliary/cci_class_trait.rs
src/test/auxiliary/cci_class_trait.rs
+4
-7
src/test/auxiliary/cci_intrinsic.rs
src/test/auxiliary/cci_intrinsic.rs
+2
-4
src/test/auxiliary/cci_iter_lib.rs
src/test/auxiliary/cci_iter_lib.rs
+1
-2
src/test/auxiliary/cci_nested_lib.rs
src/test/auxiliary/cci_nested_lib.rs
+6
-7
src/test/auxiliary/cci_no_inline_lib.rs
src/test/auxiliary/cci_no_inline_lib.rs
+2
-2
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
+7
-16
src/test/auxiliary/crateresolve1-1.rs
src/test/auxiliary/crateresolve1-1.rs
+1
-2
src/test/auxiliary/crateresolve1-2.rs
src/test/auxiliary/crateresolve1-2.rs
+1
-2
src/test/auxiliary/crateresolve1-3.rs
src/test/auxiliary/crateresolve1-3.rs
+1
-2
src/test/auxiliary/crateresolve2-1.rs
src/test/auxiliary/crateresolve2-1.rs
+1
-2
src/test/auxiliary/crateresolve2-2.rs
src/test/auxiliary/crateresolve2-2.rs
+1
-2
src/test/auxiliary/crateresolve2-3.rs
src/test/auxiliary/crateresolve2-3.rs
+1
-2
src/test/auxiliary/crateresolve3-1.rs
src/test/auxiliary/crateresolve3-1.rs
+1
-2
src/test/auxiliary/crateresolve3-2.rs
src/test/auxiliary/crateresolve3-2.rs
+1
-2
src/test/auxiliary/crateresolve4a-1.rs
src/test/auxiliary/crateresolve4a-1.rs
+1
-2
src/test/auxiliary/crateresolve4a-2.rs
src/test/auxiliary/crateresolve4a-2.rs
+1
-2
src/test/auxiliary/crateresolve4b-1.rs
src/test/auxiliary/crateresolve4b-1.rs
+1
-2
src/test/auxiliary/crateresolve4b-2.rs
src/test/auxiliary/crateresolve4b-2.rs
+1
-2
src/test/auxiliary/crateresolve5-1.rs
src/test/auxiliary/crateresolve5-1.rs
+5
-6
src/test/auxiliary/crateresolve5-2.rs
src/test/auxiliary/crateresolve5-2.rs
+5
-6
src/test/auxiliary/crateresolve7x.rs
src/test/auxiliary/crateresolve7x.rs
+4
-7
src/test/auxiliary/crateresolve_calories-1.rs
src/test/auxiliary/crateresolve_calories-1.rs
+1
-2
src/test/auxiliary/crateresolve_calories-2.rs
src/test/auxiliary/crateresolve_calories-2.rs
+1
-2
src/test/auxiliary/extern-crosscrate-source.rs
src/test/auxiliary/extern-crosscrate-source.rs
+5
-7
src/test/auxiliary/foreign_lib.rs
src/test/auxiliary/foreign_lib.rs
+3
-5
src/test/auxiliary/issue-2380.rs
src/test/auxiliary/issue-2380.rs
+2
-3
src/test/auxiliary/issue-3012-1.rs
src/test/auxiliary/issue-3012-1.rs
+9
-15
src/test/auxiliary/issue_2316_b.rs
src/test/auxiliary/issue_2316_b.rs
+5
-11
src/test/auxiliary/issue_2723_a.rs
src/test/auxiliary/issue_2723_a.rs
+3
-4
src/test/bench/shootout-nbody.rs
src/test/bench/shootout-nbody.rs
+1
-2
src/test/compile-fail/attr-bad-meta.rs
src/test/compile-fail/attr-bad-meta.rs
+1
-2
src/test/compile-fail/bad-expr-path.rs
src/test/compile-fail/bad-expr-path.rs
+1
-2
src/test/compile-fail/bad-expr-path2.rs
src/test/compile-fail/bad-expr-path2.rs
+1
-3
src/test/compile-fail/crateresolve2.rs
src/test/compile-fail/crateresolve2.rs
+1
-2
src/test/compile-fail/empty-linkname.rs
src/test/compile-fail/empty-linkname.rs
+0
-1
src/test/compile-fail/empty-linkname2.rs
src/test/compile-fail/empty-linkname2.rs
+0
-1
src/test/compile-fail/export-fully-qualified.rs
src/test/compile-fail/export-fully-qualified.rs
+1
-5
src/test/compile-fail/export-import.rs
src/test/compile-fail/export-import.rs
+1
-4
src/test/compile-fail/export-tag-variant.rs
src/test/compile-fail/export-tag-variant.rs
+1
-4
src/test/compile-fail/export.rs
src/test/compile-fail/export.rs
+1
-3
src/test/compile-fail/export2.rs
src/test/compile-fail/export2.rs
+2
-8
src/test/compile-fail/foreign-unsafe-fn-called.rs
src/test/compile-fail/foreign-unsafe-fn-called.rs
+1
-2
src/test/compile-fail/foreign-unsafe-fn.rs
src/test/compile-fail/foreign-unsafe-fn.rs
+1
-2
src/test/compile-fail/fully-qualified-type-name2.rs
src/test/compile-fail/fully-qualified-type-name2.rs
+2
-4
src/test/compile-fail/import-from-missing.rs
src/test/compile-fail/import-from-missing.rs
+1
-2
src/test/compile-fail/import-from-rename.rs
src/test/compile-fail/import-from-rename.rs
+2
-3
src/test/compile-fail/import-glob-0.rs
src/test/compile-fail/import-glob-0.rs
+3
-8
src/test/compile-fail/import-glob-circular.rs
src/test/compile-fail/import-glob-circular.rs
+6
-15
src/test/compile-fail/import-glob-export.rs
src/test/compile-fail/import-glob-export.rs
+0
-23
src/test/compile-fail/import-glob-rename.rs
src/test/compile-fail/import-glob-rename.rs
+2
-3
src/test/compile-fail/import-loop-2.rs
src/test/compile-fail/import-loop-2.rs
+2
-6
src/test/compile-fail/import-loop.rs
src/test/compile-fail/import-loop.rs
+1
-3
src/test/compile-fail/import.rs
src/test/compile-fail/import.rs
+1
-2
src/test/compile-fail/import2.rs
src/test/compile-fail/import2.rs
+2
-4
src/test/compile-fail/import4.rs
src/test/compile-fail/import4.rs
+2
-4
src/test/compile-fail/issue-1655.rs
src/test/compile-fail/issue-1655.rs
+0
-1
src/test/compile-fail/issue-2123.rs
src/test/compile-fail/issue-2123.rs
+0
-1
src/test/compile-fail/issue-2848.rs
src/test/compile-fail/issue-2848.rs
+1
-2
src/test/compile-fail/issue-2937.rs
src/test/compile-fail/issue-2937.rs
+0
-1
src/test/compile-fail/issue-3099-b.rs
src/test/compile-fail/issue-3099-b.rs
+2
-4
src/test/compile-fail/keyword.rs
src/test/compile-fail/keyword.rs
+2
-3
src/test/compile-fail/nolink-with-link-args.rs
src/test/compile-fail/nolink-with-link-args.rs
+2
-3
src/test/compile-fail/private-impl-method.rs
src/test/compile-fail/private-impl-method.rs
+2
-3
src/test/compile-fail/private-item-simple.rs
src/test/compile-fail/private-item-simple.rs
+0
-1
src/test/compile-fail/private-method.rs
src/test/compile-fail/private-method.rs
+12
-14
src/test/compile-fail/private-struct-field-ctor.rs
src/test/compile-fail/private-struct-field-ctor.rs
+1
-2
src/test/compile-fail/private-struct-field-pattern.rs
src/test/compile-fail/private-struct-field-pattern.rs
+2
-3
src/test/compile-fail/private-struct-field.rs
src/test/compile-fail/private-struct-field.rs
+2
-3
src/test/compile-fail/private-variant.rs
src/test/compile-fail/private-variant.rs
+1
-2
src/test/compile-fail/redundant-link-args.rs
src/test/compile-fail/redundant-link-args.rs
+0
-2
src/test/compile-fail/regions-glb-free-free.rs
src/test/compile-fail/regions-glb-free-free.rs
+3
-4
src/test/compile-fail/unused-imports-warn.rs
src/test/compile-fail/unused-imports-warn.rs
+4
-7
src/test/compile-fail/warn-ctypes-err-attr.rs
src/test/compile-fail/warn-ctypes-err-attr.rs
+2
-3
src/test/compile-fail/warn-ctypes.rs
src/test/compile-fail/warn-ctypes.rs
+2
-3
src/test/compile-fail/warn-foreign-int-types.rs
src/test/compile-fail/warn-foreign-int-types.rs
+2
-3
src/test/run-fail/extern-fail.rs
src/test/run-fail/extern-fail.rs
+2
-3
src/test/run-fail/morestack2.rs
src/test/run-fail/morestack2.rs
+1
-2
src/test/run-fail/run-unexported-tests.rs
src/test/run-fail/run-unexported-tests.rs
+1
-4
未找到文件。
src/test/auxiliary/cci_borrow_lib.rs
浏览文件 @
2a65842c
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
fn
foo
(
x
:
&
uint
)
->
uint
{
pub
fn
foo
(
x
:
&
uint
)
->
uint
{
*
x
}
src/test/auxiliary/cci_class.rs
浏览文件 @
2a65842c
...
...
@@ -8,22 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
mod
kitties
{
#[legacy_exports]
;
pub
mod
kitties
{
pub
struct
cat
{
priv
mut
meows
:
uint
,
struct
cat
{
priv
mut
meows
:
uint
,
how_hungry
:
int
,
}
how_hungry
:
int
,
}
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
pub
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
}
}
}
src/test/auxiliary/cci_class_2.rs
浏览文件 @
2a65842c
...
...
@@ -8,26 +8,23 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
pub
mod
kitties
{
pub
struct
cat
{
priv
mut
meows
:
uint
,
mod
kitties
{
#[legacy_exports]
;
how_hungry
:
int
,
struct
cat
{
priv
mut
meows
:
uint
,
how_hungry
:
int
,
}
}
impl
cat
{
pub
impl
cat
{
fn
speak
()
{}
}
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
pub
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
}
}
}
src/test/auxiliary/cci_class_3.rs
浏览文件 @
2a65842c
...
...
@@ -8,28 +8,22 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
pub
mod
kitties
{
pub
struct
cat
{
priv
mut
meows
:
uint
,
mod
kitties
{
#[legacy_exports]
;
struct
cat
{
priv
mut
meows
:
uint
,
how_hungry
:
int
,
}
how_hungry
:
int
,
}
impl
cat
{
pub
impl
cat
{
fn
speak
()
{
self
.meows
+=
1u
;
}
fn
meow_count
()
->
uint
{
self
.meows
}
}
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
pub
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
}
}
}
src/test/auxiliary/cci_class_4.rs
浏览文件 @
2a65842c
...
...
@@ -8,35 +8,31 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
mod
kitties
{
#[legacy_exports]
;
pub
mod
kitties
{
pub
struct
cat
{
priv
mut
meows
:
uint
,
struct
cat
{
priv
mut
meows
:
uint
,
mut
how_hungry
:
int
,
name
:
~
str
,
}
impl
cat
{
mut
how_hungry
:
int
,
name
:
~
str
,
}
fn
speak
()
{
self
.meow
();
}
pub
impl
cat
{
fn
speak
()
{
self
.meow
();
}
fn
eat
()
->
bool
{
if
self
.how_hungry
>
0
{
error!
(
"OM NOM NOM"
);
self
.how_hungry
-=
2
;
return
true
;
}
else
{
error!
(
"Not hungry!"
);
return
false
;
fn
eat
()
->
bool
{
if
self
.how_hungry
>
0
{
error!
(
"OM NOM NOM"
);
self
.how_hungry
-=
2
;
return
true
;
}
else
{
error!
(
"Not hungry!"
);
return
false
;
}
}
}
}
}
p
riv
impl
cat
{
p
ub
impl
cat
{
fn
meow
()
{
error!
(
"Meow"
);
self
.meows
+=
1u
;
...
...
@@ -46,12 +42,11 @@ fn meow() {
}
}
fn
cat
(
in_x
:
uint
,
in_y
:
int
,
in_name
:
~
str
)
->
cat
{
pub
fn
cat
(
in_x
:
uint
,
in_y
:
int
,
in_name
:
~
str
)
->
cat
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
,
name
:
in_name
}
}
}
src/test/auxiliary/cci_class_5.rs
浏览文件 @
2a65842c
...
...
@@ -8,14 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
mod
kitties
{
pub
mod
kitties
{
pub
struct
cat
{
priv
mut
meows
:
uint
,
how_hungry
:
int
,
}
impl
cat
{
pub
impl
cat
{
priv
fn
nap
()
{
for
uint
::
range
(
1
,
10000u
)
|
_
i
|{}}
}
...
...
@@ -26,4 +25,4 @@ pub fn cat(in_x : uint, in_y : int) -> cat {
}
}
}
\ No newline at end of file
}
src/test/auxiliary/cci_class_6.rs
浏览文件 @
2a65842c
...
...
@@ -8,32 +8,27 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
pub
mod
kitties
{
pub
struct
cat
<
U
>
{
priv
mut
info
:
~
[
U
],
priv
mut
meows
:
uint
,
mod
kitties
{
#[legacy_exports]
;
struct
cat
<
U
>
{
priv
mut
info
:
~
[
U
],
priv
mut
meows
:
uint
,
how_hungry
:
int
,
}
how_hungry
:
int
,
}
impl
<
U
>
cat
<
U
>
{
pub
impl
<
U
>
cat
<
U
>
{
fn
speak
<
T
>
(
stuff
:
~
[
T
])
{
self
.meows
+=
stuff
.len
();
}
fn
meow_count
()
->
uint
{
self
.meows
}
}
fn
cat
<
U
>
(
in_x
:
uint
,
in_y
:
int
,
-
in_info
:
~
[
U
])
->
cat
<
U
>
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
,
info
:
move
in_info
pub
fn
cat
<
U
>
(
in_x
:
uint
,
in_y
:
int
,
-
in_info
:
~
[
U
])
->
cat
<
U
>
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
,
info
:
move
in_info
}
}
}
}
src/test/auxiliary/cci_class_trait.rs
浏览文件 @
2a65842c
...
...
@@ -8,11 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
mod
animals
{
#[legacy_exports]
;
trait
noisy
{
fn
speak
();
}
pub
mod
animals
{
pub
trait
noisy
{
fn
speak
();
}
}
src/test/auxiliary/cci_intrinsic.rs
浏览文件 @
2a65842c
...
...
@@ -8,10 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
#[abi
=
"rust-intrinsic"
]
extern
mod
rusti
{
#[legacy_exports]
;
pub
extern
mod
rusti
{
fn
atomic_cxchg
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
fn
atomic_cxchg_acq
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
fn
atomic_cxchg_rel
(
dst
:
&
mut
int
,
old
:
int
,
src
:
int
)
->
int
;
...
...
@@ -30,7 +28,7 @@
}
#[inline(always)]
fn
atomic_xchg
(
dst
:
&
mut
int
,
src
:
int
)
->
int
{
pub
fn
atomic_xchg
(
dst
:
&
mut
int
,
src
:
int
)
->
int
{
unsafe
{
rusti
::
atomic_xchg
(
dst
,
src
)
}
...
...
src/test/auxiliary/cci_iter_lib.rs
浏览文件 @
2a65842c
...
...
@@ -10,10 +10,9 @@
#[link(name=
"cci_iter_lib"
,
vers=
"0.0"
)]
;
#[legacy_modes]
;
#[legacy_exports]
;
#[inline]
fn
iter
<
T
>
(
v
:
~
[
T
],
f
:
fn
(
T
))
{
pub
fn
iter
<
T
>
(
v
:
~
[
T
],
f
:
fn
(
T
))
{
let
mut
i
=
0u
;
let
n
=
vec
::
len
(
v
);
while
i
<
n
{
...
...
src/test/auxiliary/cci_nested_lib.rs
浏览文件 @
2a65842c
...
...
@@ -9,19 +9,18 @@
// except according to those terms.
#[legacy_modes]
;
#[legacy_exports]
;
use
dvec
::
DVec
;
struct
Entry
<
A
,
B
>
{
key
:
A
,
value
:
B
}
pub
struct
Entry
<
A
,
B
>
{
key
:
A
,
value
:
B
}
struct
alist
<
A
,
B
>
{
eq_fn
:
fn
@
(
A
,
A
)
->
bool
,
data
:
DVec
<
Entry
<
A
,
B
>>
}
pub
struct
alist
<
A
,
B
>
{
eq_fn
:
fn
@
(
A
,
A
)
->
bool
,
data
:
DVec
<
Entry
<
A
,
B
>>
}
fn
alist_add
<
A
:
Copy
,
B
:
Copy
>
(
lst
:
alist
<
A
,
B
>
,
k
:
A
,
v
:
B
)
{
pub
fn
alist_add
<
A
:
Copy
,
B
:
Copy
>
(
lst
:
alist
<
A
,
B
>
,
k
:
A
,
v
:
B
)
{
lst
.data
.push
(
Entry
{
key
:
k
,
value
:
v
});
}
fn
alist_get
<
A
:
Copy
,
B
:
Copy
>
(
lst
:
alist
<
A
,
B
>
,
k
:
A
)
->
B
{
pub
fn
alist_get
<
A
:
Copy
,
B
:
Copy
>
(
lst
:
alist
<
A
,
B
>
,
k
:
A
)
->
B
{
let
eq_fn
=
lst
.eq_fn
;
for
lst
.data.each
|
entry
|
{
if
eq_fn
(
entry
.key
,
k
)
{
return
entry
.value
;
}
...
...
@@ -30,13 +29,13 @@ fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
}
#[inline]
fn
new_int_alist
<
B
:
Copy
>
()
->
alist
<
int
,
B
>
{
pub
fn
new_int_alist
<
B
:
Copy
>
()
->
alist
<
int
,
B
>
{
fn
eq_int
(
&&
a
:
int
,
&&
b
:
int
)
->
bool
{
a
==
b
}
return
alist
{
eq_fn
:
eq_int
,
data
:
DVec
()};
}
#[inline]
fn
new_int_alist_2
<
B
:
Copy
>
()
->
alist
<
int
,
B
>
{
pub
fn
new_int_alist_2
<
B
:
Copy
>
()
->
alist
<
int
,
B
>
{
#[inline]
fn
eq_int
(
&&
a
:
int
,
&&
b
:
int
)
->
bool
{
a
==
b
}
return
alist
{
eq_fn
:
eq_int
,
data
:
DVec
()};
...
...
src/test/auxiliary/cci_no_inline_lib.rs
浏览文件 @
2a65842c
...
...
@@ -9,10 +9,9 @@
// except according to those terms.
#[link(name=
"cci_no_inline_lib"
,
vers=
"0.0"
)]
;
#[legacy_exports]
;
// same as cci_iter_lib, more-or-less, but not marked inline
fn
iter
(
v
:
~
[
uint
],
f
:
fn
(
uint
))
{
pub
fn
iter
(
v
:
~
[
uint
],
f
:
fn
(
uint
))
{
let
mut
i
=
0u
;
let
n
=
vec
::
len
(
v
);
while
i
<
n
{
...
...
@@ -20,3 +19,4 @@ fn iter(v: ~[uint], f: fn(uint)) {
i
+=
1u
;
}
}
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
浏览文件 @
2a65842c
...
...
@@ -10,40 +10,31 @@
#[link(name
=
"crate_method_reexport_grrrrrrr2"
)]
;
export
rust
;
use
name_pool
::
add
;
mod
name_pool
{
#[legacy_exports]
;
type
name_pool
=
();
pub
type
name_pool
=
();
trait
add
{
pub
trait
add
{
fn
add
(
s
:
~
str
);
}
impl
name_pool
:
add
{
pub
impl
name_pool
:
add
{
fn
add
(
s
:
~
str
)
{
}
}
}
mod
rust
{
#[legacy_exports]
;
pub
mod
rust
{
use
name_pool
::
add
;
export
add
;
export
rt
;
export
cx
;
type
rt
=
@
();
pub
type
rt
=
@
();
trait
cx
{
pub
trait
cx
{
fn
cx
();
}
impl
rt
:
cx
{
pub
impl
rt
:
cx
{
fn
cx
()
{
}
}
...
...
src/test/auxiliary/crateresolve1-1.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
10
}
pub
fn
f
()
->
int
{
10
}
src/test/auxiliary/crateresolve1-2.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.2"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
20
}
pub
fn
f
()
->
int
{
20
}
src/test/auxiliary/crateresolve1-3.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.3"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
30
}
pub
fn
f
()
->
int
{
30
}
src/test/auxiliary/crateresolve2-1.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
10
}
pub
fn
f
()
->
int
{
10
}
src/test/auxiliary/crateresolve2-2.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.2"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
20
}
pub
fn
f
()
->
int
{
20
}
src/test/auxiliary/crateresolve2-3.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.3"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
30
}
pub
fn
f
()
->
int
{
30
}
src/test/auxiliary/crateresolve3-1.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
10
}
pub
fn
f
()
->
int
{
10
}
src/test/auxiliary/crateresolve3-2.rs
浏览文件 @
2a65842c
...
...
@@ -12,6 +12,5 @@
vers
=
"0.2"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
g
()
->
int
{
20
}
pub
fn
g
()
->
int
{
20
}
src/test/auxiliary/crateresolve4a-1.rs
浏览文件 @
2a65842c
...
...
@@ -10,6 +10,5 @@
#[link(name
=
"crateresolve4a"
,
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
10
}
pub
fn
f
()
->
int
{
10
}
src/test/auxiliary/crateresolve4a-2.rs
浏览文件 @
2a65842c
...
...
@@ -10,6 +10,5 @@
#[link(name
=
"crateresolve4a"
,
vers=
"0.2"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
g
()
->
int
{
20
}
pub
fn
g
()
->
int
{
20
}
src/test/auxiliary/crateresolve4b-1.rs
浏览文件 @
2a65842c
...
...
@@ -12,8 +12,7 @@
// aux-build:crateresolve4a-2.rs
#[link(name
=
"crateresolve4b"
,
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
extern
mod
crateresolve4a
(
vers
=
"0.2"
);
fn
f
()
->
int
{
crateresolve4a
::
g
()
}
pub
fn
f
()
->
int
{
crateresolve4a
::
g
()
}
src/test/auxiliary/crateresolve4b-2.rs
浏览文件 @
2a65842c
...
...
@@ -12,8 +12,7 @@
// aux-build:crateresolve4a-2.rs
#[link(name
=
"crateresolve4b"
,
vers
=
"0.2"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
extern
mod
crateresolve4a
(
vers
=
"0.1"
);
fn
g
()
->
int
{
crateresolve4a
::
f
()
}
pub
fn
g
()
->
int
{
crateresolve4a
::
f
()
}
src/test/auxiliary/crateresolve5-1.rs
浏览文件 @
2a65842c
...
...
@@ -12,18 +12,17 @@
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
struct
NameVal
{
name
:
~
str
,
val
:
int
}
pub
struct
NameVal
{
name
:
~
str
,
val
:
int
}
fn
struct_nameval
()
->
NameVal
{
pub
fn
struct_nameval
()
->
NameVal
{
NameVal
{
name
:
~
"crateresolve5"
,
val
:
10
}
}
enum
e
{
pub
enum
e
{
e_val
}
fn
nominal
()
->
e
{
e_val
}
pub
fn
nominal
()
->
e
{
e_val
}
fn
f
()
->
int
{
10
}
pub
fn
f
()
->
int
{
10
}
src/test/auxiliary/crateresolve5-2.rs
浏览文件 @
2a65842c
...
...
@@ -12,17 +12,16 @@
vers
=
"0.2"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
struct
NameVal
{
name
:
~
str
,
val
:
int
}
fn
struct_nameval
()
->
NameVal
{
pub
struct
NameVal
{
name
:
~
str
,
val
:
int
}
pub
fn
struct_nameval
()
->
NameVal
{
NameVal
{
name
:
~
"crateresolve5"
,
val
:
10
}
}
enum
e
{
pub
enum
e
{
e_val
}
fn
nominal
()
->
e
{
e_val
}
pub
fn
nominal
()
->
e
{
e_val
}
fn
f
()
->
int
{
20
}
pub
fn
f
()
->
int
{
20
}
src/test/auxiliary/crateresolve7x.rs
浏览文件 @
2a65842c
...
...
@@ -13,15 +13,12 @@
// aux-build:crateresolve_calories-2.rs
// These both have the same version but differ in other metadata
#[legacy_exports]
;
mod
a
{
#[legacy_exports]
;
pub
mod
a
{
extern
mod
cr_1
(
name
=
"crateresolve_calories"
,
vers
=
"0.1"
,
calories
=
"100"
);
fn
f
()
->
int
{
cr_1
::
f
()
}
pub
fn
f
()
->
int
{
cr_1
::
f
()
}
}
mod
b
{
#[legacy_exports]
;
pub
mod
b
{
extern
mod
cr_2
(
name
=
"crateresolve_calories"
,
vers
=
"0.1"
,
calories
=
"200"
);
fn
f
()
->
int
{
cr_2
::
f
()
}
pub
fn
f
()
->
int
{
cr_2
::
f
()
}
}
src/test/auxiliary/crateresolve_calories-1.rs
浏览文件 @
2a65842c
...
...
@@ -13,6 +13,5 @@
calories
=
"100"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
100
}
pub
fn
f
()
->
int
{
100
}
src/test/auxiliary/crateresolve_calories-2.rs
浏览文件 @
2a65842c
...
...
@@ -13,6 +13,5 @@
calories
=
"200"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
fn
f
()
->
int
{
200
}
pub
fn
f
()
->
int
{
200
}
src/test/auxiliary/extern-crosscrate-source.rs
浏览文件 @
2a65842c
...
...
@@ -12,22 +12,20 @@
vers
=
"0.1"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
extern
mod
rustrt
{
#[legacy_exports]
;
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
pub
extern
mod
rustrt
{
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
fn
fact
(
n
:
uint
)
->
uint
{
pub
fn
fact
(
n
:
uint
)
->
uint
{
unsafe
{
debug!
(
"n = %?"
,
n
);
rustrt
::
rust_dbg_call
(
cb
,
n
)
}
}
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
pub
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/auxiliary/foreign_lib.rs
浏览文件 @
2a65842c
...
...
@@ -9,9 +9,7 @@
// except according to those terms.
#[link(name=
"foreign_lib"
,
vers=
"0.0"
)]
;
#[legacy_exports]
;
extern
mod
rustrt
{
#[legacy_exports]
;
fn
last_os_error
()
->
~
str
;
}
\ No newline at end of file
pub
extern
mod
rustrt
{
pub
fn
last_os_error
()
->
~
str
;
}
src/test/auxiliary/issue-2380.rs
浏览文件 @
2a65842c
...
...
@@ -10,11 +10,10 @@
#[link(name
=
"a"
,
vers
=
"0.0"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
trait
i
<
T
>
{
}
pub
trait
i
<
T
>
{
}
fn
f
<
T
>
()
->
i
<
T
>
{
pub
fn
f
<
T
>
()
->
i
<
T
>
{
impl
<
T
>
():
i
<
T
>
{
}
()
as
i
::
<
T
>
...
...
src/test/auxiliary/issue-3012-1.rs
浏览文件 @
2a65842c
...
...
@@ -10,27 +10,21 @@
#[link(name=
"socketlib"
,
vers=
"0.0"
)]
;
#[crate_type
=
"lib"
]
;
#[legacy_exports]
;
mod
socket
{
#[legacy_exports]
;
export
socket_handle
;
struct
socket_handle
{
sockfd
:
libc
::
c_int
,
}
pub
mod
socket
{
pub
struct
socket_handle
{
sockfd
:
libc
::
c_int
,
}
impl
socket_handle
:
Drop
{
fn
finalize
(
&
self
)
{
/* c::close(self.sockfd); */
pub
impl
socket_handle
:
Drop
{
fn
finalize
(
&
self
)
{
/* c::close(self.sockfd); */
}
}
}
fn
socket_handle
(
x
:
libc
::
c_int
)
->
socket_handle
{
pub
fn
socket_handle
(
x
:
libc
::
c_int
)
->
socket_handle
{
socket_handle
{
sockfd
:
x
}
}
}
src/test/auxiliary/issue_2316_b.rs
浏览文件 @
2a65842c
...
...
@@ -10,18 +10,12 @@
extern
mod
issue_2316_a
;
mod
cloth
{
#[legacy_exports]
;
use
issue_2316_a
::
*
;
export
calico
,
gingham
,
flannel
;
export
fabric
;
enum
fabric
{
gingham
,
flannel
,
calico
}
pub
mod
cloth
{
use
issue_2316_a
::
*
;
pub
enum
fabric
{
gingham
,
flannel
,
calico
}
}
src/test/auxiliary/issue_2723_a.rs
浏览文件 @
2a65842c
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
;
unsafe
fn
f
(
xs
:
~
[
int
])
{
xs
.map
(|
_
x
|
{
unsafe
fn
q
()
{
fail
;
}
});
}
\ No newline at end of file
pub
unsafe
fn
f
(
xs
:
~
[
int
])
{
xs
.map
(|
_
x
|
{
unsafe
fn
q
()
{
fail
;
}
});
}
src/test/bench/shootout-nbody.rs
浏览文件 @
2a65842c
...
...
@@ -22,8 +22,7 @@
// an llvm intrinsic.
#[nolink]
extern
mod
libc
{
#[legacy_exports]
;
fn
sqrt
(
n
:
float
)
->
float
;
pub
fn
sqrt
(
n
:
float
)
->
float
;
}
fn
main
()
{
...
...
src/test/compile-fail/attr-bad-meta.rs
浏览文件 @
2a65842c
...
...
@@ -12,5 +12,4 @@
// asterisk is bogus
#[attr
*
]
mod
m
{
#[legacy_exports]
;
}
mod
m
{}
src/test/compile-fail/bad-expr-path.rs
浏览文件 @
2a65842c
...
...
@@ -10,7 +10,6 @@
// error-pattern: unresolved name: m1::a
mod
m1
{
#[legacy_exports]
;
}
mod
m1
{}
fn
main
(
args
:
~
[
str
])
{
log
(
debug
,
m1
::
a
);
}
src/test/compile-fail/bad-expr-path2.rs
浏览文件 @
2a65842c
...
...
@@ -11,9 +11,7 @@
// error-pattern: unresolved name: m1::a
mod
m1
{
#[legacy_exports]
;
mod
a
{
#[legacy_exports]
;
}
pub
mod
a
{}
}
fn
main
(
args
:
~
[
str
])
{
log
(
debug
,
m1
::
a
);
}
src/test/compile-fail/crateresolve2.rs
浏览文件 @
2a65842c
...
...
@@ -16,8 +16,7 @@
extern
mod
crateresolve2
(
vers
=
"0.1"
);
mod
m
{
#[legacy_exports]
;
extern
mod
crateresolve2
(
vers
=
"0.2"
);
pub
extern
mod
crateresolve2
(
vers
=
"0.2"
);
}
fn
main
()
{
...
...
src/test/compile-fail/empty-linkname.rs
浏览文件 @
2a65842c
...
...
@@ -12,5 +12,4 @@
#[link_name
=
""
]
extern
mod
foo
{
#[legacy_exports]
;
}
src/test/compile-fail/empty-linkname2.rs
浏览文件 @
2a65842c
...
...
@@ -14,5 +14,4 @@
#[link_name
=
""
]
#[nolink]
extern
mod
foo
{
#[legacy_exports]
;
}
src/test/compile-fail/export-fully-qualified.rs
浏览文件 @
2a65842c
...
...
@@ -15,11 +15,7 @@
// want to change eventually.
mod
foo
{
#[legacy_exports]
;
export
bar
;
fn
bar
()
{
foo
::
baz
();
}
pub
fn
bar
()
{
foo
::
baz
();
}
fn
baz
()
{
}
}
...
...
src/test/compile-fail/export-import.rs
浏览文件 @
2a65842c
...
...
@@ -13,10 +13,7 @@
use
m
::
unexported
;
mod
m
{
#[legacy_exports]
;
export
exported
;
fn
exported
()
{
}
pub
fn
exported
()
{
}
fn
unexported
()
{
}
}
...
...
src/test/compile-fail/export-tag-variant.rs
浏览文件 @
2a65842c
...
...
@@ -11,10 +11,7 @@
// error-pattern: unresolved name
mod
foo
{
#[legacy_exports]
;
export
x
;
fn
x
()
{
}
pub
fn
x
()
{
}
enum
y
{
y1
,
}
}
...
...
src/test/compile-fail/export.rs
浏览文件 @
2a65842c
...
...
@@ -10,9 +10,7 @@
// error-pattern: unresolved name
mod
foo
{
#[legacy_exports]
;
export
x
;
fn
x
(
y
:
int
)
{
log
(
debug
,
y
);
}
pub
fn
x
(
y
:
int
)
{
log
(
debug
,
y
);
}
fn
z
(
y
:
int
)
{
log
(
debug
,
y
);
}
}
...
...
src/test/compile-fail/export2.rs
浏览文件 @
2a65842c
...
...
@@ -11,19 +11,13 @@
// error-pattern: unresolved name
mod
foo
{
#[legacy_exports]
;
export
x
;
fn
x
()
{
bar
::
x
();
}
pub
fn
x
()
{
bar
::
x
();
}
}
mod
bar
{
#[legacy_exports]
;
export
y
;
fn
x
()
{
debug!
(
"x"
);
}
fn
y
()
{
}
pub
fn
y
()
{
}
}
fn
main
()
{
foo
::
x
();
}
src/test/compile-fail/foreign-unsafe-fn-called.rs
浏览文件 @
2a65842c
...
...
@@ -12,8 +12,7 @@
#[abi
=
"cdecl"
]
extern
mod
test
{
#[legacy_exports]
;
unsafe
fn
free
();
pub
unsafe
fn
free
();
}
fn
main
()
{
...
...
src/test/compile-fail/foreign-unsafe-fn.rs
浏览文件 @
2a65842c
...
...
@@ -12,8 +12,7 @@
#[abi
=
"cdecl"
]
extern
mod
test
{
#[legacy_exports]
;
unsafe
fn
free
();
pub
unsafe
fn
free
();
}
fn
main
()
{
...
...
src/test/compile-fail/fully-qualified-type-name2.rs
浏览文件 @
2a65842c
...
...
@@ -11,13 +11,11 @@
// Test that we use fully-qualified type names in error messages.
mod
x
{
#[legacy_exports]
;
enum
foo
{
}
pub
enum
foo
{
}
}
mod
y
{
#[legacy_exports]
;
enum
foo
{
}
pub
enum
foo
{
}
}
fn
bar
(
x
:
x
::
foo
)
->
y
::
foo
{
...
...
src/test/compile-fail/import-from-missing.rs
浏览文件 @
2a65842c
...
...
@@ -12,8 +12,7 @@
use
spam
::{
ham
,
eggs
};
mod
spam
{
#[legacy_exports]
;
fn
ham
()
{
}
pub
fn
ham
()
{
}
}
fn
main
()
{
ham
();
eggs
();
}
src/test/compile-fail/import-from-rename.rs
浏览文件 @
2a65842c
...
...
@@ -13,9 +13,8 @@
use
baz
=
foo
::{
bar
};
mod
foo
{
#[legacy_exports]
;
fn
bar
()
{}
pub
fn
bar
()
{}
}
fn
main
()
{
}
\ No newline at end of file
}
src/test/compile-fail/import-glob-0.rs
浏览文件 @
2a65842c
...
...
@@ -13,15 +13,10 @@
use
module_of_many_things
::
*
;
mod
module_of_many_things
{
#[legacy_exports]
;
export
f1
;
export
f2
;
export
f4
;
fn
f1
()
{
debug!
(
"f1"
);
}
fn
f2
()
{
debug!
(
"f2"
);
}
pub
fn
f1
()
{
debug!
(
"f1"
);
}
pub
fn
f2
()
{
debug!
(
"f2"
);
}
fn
f3
()
{
debug!
(
"f3"
);
}
fn
f4
()
{
debug!
(
"f4"
);
}
pub
fn
f4
()
{
debug!
(
"f4"
);
}
}
...
...
src/test/compile-fail/import-glob-circular.rs
浏览文件 @
2a65842c
...
...
@@ -11,27 +11,18 @@
// error-pattern: unresolved
mod
circ1
{
#[legacy_exports]
;
use
circ1
::
*
;
export
f1
;
export
f2
;
export
common
;
fn
f1
()
{
debug!
(
"f1"
);
}
fn
common
()
->
uint
{
return
0u
;
}
pub
use
circ2
::
f2
;
pub
fn
f1
()
{
debug!
(
"f1"
);
}
pub
fn
common
()
->
uint
{
return
0u
;
}
}
mod
circ2
{
#[legacy_exports]
;
use
circ2
::
*
;
export
f1
;
export
f2
;
export
common
;
fn
f2
()
{
debug!
(
"f2"
);
}
fn
common
()
->
uint
{
return
1u
;
}
pub
use
circ1
::
f1
;
pub
fn
f2
()
{
debug!
(
"f2"
);
}
pub
fn
common
()
->
uint
{
return
1u
;
}
}
mod
test
{
#[legacy_exports]
;
use
circ1
::
*
;
fn
test
()
{
f1066
();
}
...
...
src/test/compile-fail/import-glob-export.rs
已删除
100644 → 0
浏览文件 @
77f2aac3
// 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.
// error-pattern:unresolved name
use
m1
::
*
;
mod
m1
{
#[legacy_exports]
;
export
f1
;
fn
f1
()
{
}
fn
f2
()
{
}
}
fn
main
()
{
f2
();
}
src/test/compile-fail/import-glob-rename.rs
浏览文件 @
2a65842c
...
...
@@ -13,9 +13,8 @@
use
baz
=
foo
::
*
;
mod
foo
{
#[legacy_exports]
;
fn
bar
()
{}
pub
fn
bar
()
{}
}
fn
main
()
{
}
\ No newline at end of file
}
src/test/compile-fail/import-loop-2.rs
浏览文件 @
2a65842c
...
...
@@ -11,15 +11,11 @@
// error-pattern:import
mod
a
{
#[legacy_exports]
;
import
b
::
x
;
export
x
;
pub
use
b
::
x
;
}
mod
b
{
#[legacy_exports]
;
import
a
::
x
;
export
x
;
pub
use
a
::
x
;
fn
main
()
{
let
y
=
x
;
}
}
src/test/compile-fail/import-loop.rs
浏览文件 @
2a65842c
...
...
@@ -13,9 +13,7 @@
use
y
::
x
;
mod
y
{
#[legacy_exports]
;
import
x
;
export
x
;
pub
use
y
::
x
;
}
fn
main
()
{
}
src/test/compile-fail/import.rs
浏览文件 @
2a65842c
...
...
@@ -12,7 +12,6 @@
use
zed
::
bar
;
use
zed
::
baz
;
mod
zed
{
#[legacy_exports]
;
fn
bar
()
{
debug!
(
"bar"
);
}
pub
fn
bar
()
{
debug!
(
"bar"
);
}
}
fn
main
(
args
:
~
[
str
])
{
bar
();
}
src/test/compile-fail/import2.rs
浏览文件 @
2a65842c
...
...
@@ -10,10 +10,8 @@
// error-pattern: unresolved
use
baz
::
zed
::
bar
;
mod
baz
{
#[legacy_exports]
;
}
mod
baz
{}
mod
zed
{
#[legacy_exports]
;
fn
bar
()
{
debug!
(
"bar3"
);
}
pub
fn
bar
()
{
debug!
(
"bar3"
);
}
}
fn
main
(
args
:
~
[
str
])
{
bar
();
}
src/test/compile-fail/import4.rs
浏览文件 @
2a65842c
...
...
@@ -10,9 +10,7 @@
// error-pattern: import
mod
a
{
#[legacy_exports]
;
import
foo
=
b
::
foo
;
export
foo
;
}
mod
b
{
#[legacy_exports]
;
import
foo
=
a
::
foo
;
export
foo
;
}
mod
a
{
pub
use
b
::
foo
;
}
mod
b
{
pub
use
a
::
foo
;
}
fn
main
(
args
:
~
[
str
])
{
debug!
(
"loop"
);
}
src/test/compile-fail/issue-1655.rs
浏览文件 @
2a65842c
...
...
@@ -10,7 +10,6 @@
// error-pattern:expected item
mod
blade_runner
{
#[legacy_exports]
;
#
~
[
doc
(
brief
=
"Blade Runner is probably the best movie ever"
,
desc
=
"I like that in the world of Blade Runner it is always
...
...
src/test/compile-fail/issue-2123.rs
浏览文件 @
2a65842c
...
...
@@ -11,7 +11,6 @@
use
x
=
m
::
f
;
//~ ERROR failed to resolve import
mod
m
{
#[legacy_exports]
;
}
fn
main
()
{
...
...
src/test/compile-fail/issue-2848.rs
浏览文件 @
2a65842c
...
...
@@ -9,8 +9,7 @@
// except according to those terms.
mod
bar
{
#[legacy_exports]
;
enum
foo
{
pub
enum
foo
{
alpha
,
beta
,
charlie
...
...
src/test/compile-fail/issue-2937.rs
浏览文件 @
2a65842c
...
...
@@ -12,7 +12,6 @@
use
x
=
m
::
f
;
mod
m
{
#[legacy_exports]
;
}
fn
main
()
{
...
...
src/test/compile-fail/issue-3099-b.rs
浏览文件 @
2a65842c
...
...
@@ -8,10 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
mod
a
{}
pub
mod
a
{}
#[legacy_exports]
mod
a
{}
//~ ERROR duplicate definition of type a
pub
mod
a
{}
//~ ERROR duplicate definition of type a
fn
main
()
{}
src/test/compile-fail/keyword.rs
浏览文件 @
2a65842c
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports]
mod
break
{
pub
mod
break
{
//~^ ERROR found `break` in ident position
}
\ No newline at end of file
}
src/test/compile-fail/nolink-with-link-args.rs
浏览文件 @
2a65842c
...
...
@@ -16,7 +16,6 @@
#[link_args
=
"aFdEfSeVEEE"
]
#[nolink]
extern
mod
m1
{
#[legacy_exports]
;
}
extern
mod
m1
{}
fn
main
()
{
}
\ No newline at end of file
fn
main
()
{
}
src/test/compile-fail/private-impl-method.rs
浏览文件 @
2a65842c
...
...
@@ -9,12 +9,11 @@
// except according to those terms.
mod
a
{
#[legacy_exports]
;
struct
Foo
{
pub
struct
Foo
{
x
:
int
}
impl
Foo
{
pub
impl
Foo
{
priv
fn
foo
()
{}
}
}
...
...
src/test/compile-fail/private-item-simple.rs
浏览文件 @
2a65842c
...
...
@@ -9,7 +9,6 @@
// except according to those terms.
mod
a
{
#[legacy_exports]
;
priv
fn
f
()
{}
}
...
...
src/test/compile-fail/private-method.rs
浏览文件 @
2a65842c
...
...
@@ -11,25 +11,23 @@
// error-pattern:method `nap` is private
mod
kitties
{
#[legacy_exports]
;
struct
cat
{
priv
mut
meows
:
uint
,
pub
struct
cat
{
priv
mut
meows
:
uint
,
how_hungry
:
int
,
}
how_hungry
:
int
,
}
impl
cat
{
priv
fn
nap
()
{
uint
::
range
(
1u
,
10000u
,
|
_
i
|
false
)}
}
pub
impl
cat
{
priv
fn
nap
()
{
uint
::
range
(
1u
,
10000u
,
|
_
i
|
false
)}
}
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
pub
fn
cat
(
in_x
:
uint
,
in_y
:
int
)
->
cat
{
cat
{
meows
:
in_x
,
how_hungry
:
in_y
}
}
}
}
fn
main
()
{
let
nyan
:
kitties
::
cat
=
kitties
::
cat
(
52u
,
99
);
...
...
src/test/compile-fail/private-struct-field-ctor.rs
浏览文件 @
2a65842c
...
...
@@ -9,8 +9,7 @@
// except according to those terms.
mod
a
{
#[legacy_exports]
;
struct
Foo
{
pub
struct
Foo
{
priv
x
:
int
}
}
...
...
src/test/compile-fail/private-struct-field-pattern.rs
浏览文件 @
2a65842c
...
...
@@ -11,12 +11,11 @@
use
a
::
Foo
;
mod
a
{
#[legacy_exports]
;
struct
Foo
{
pub
struct
Foo
{
priv
x
:
int
}
fn
make
()
->
Foo
{
pub
fn
make
()
->
Foo
{
Foo
{
x
:
3
}
}
}
...
...
src/test/compile-fail/private-struct-field.rs
浏览文件 @
2a65842c
...
...
@@ -9,12 +9,11 @@
// except according to those terms.
mod
cat
{
#[legacy_exports]
;
struct
Cat
{
pub
struct
Cat
{
priv
meows
:
uint
}
fn
new_cat
()
->
Cat
{
pub
fn
new_cat
()
->
Cat
{
Cat
{
meows
:
52
}
}
}
...
...
src/test/compile-fail/private-variant.rs
浏览文件 @
2a65842c
...
...
@@ -9,8 +9,7 @@
// except according to those terms.
mod
a
{
#[legacy_exports]
;
enum
Waffle
{
pub
enum
Waffle
{
Belgian
,
Brussels
,
priv
Liege
...
...
src/test/compile-fail/redundant-link-args.rs
浏览文件 @
2a65842c
...
...
@@ -19,11 +19,9 @@
#[link_name=
"m"
]
#[link_args=
"-foo"
]
// this could have been elided.
extern
mod
m1
{
#[legacy_exports]
;
}
#[link_name=
"m"
]
#[link_args=
"-bar"
]
// this is the actual error trigger.
extern
mod
m2
{
#[legacy_exports]
;
}
src/test/compile-fail/regions-glb-free-free.rs
浏览文件 @
2a65842c
...
...
@@ -9,23 +9,22 @@
// except according to those terms.
mod
argparse
{
#[legacy_exports]
;
extern
mod
std
;
use
either
::{
Either
,
Left
,
Right
};
struct
Flag
{
pub
struct
Flag
{
name
:
&
str
,
desc
:
&
str
,
max_count
:
uint
,
mut
value
:
uint
}
fn
flag
(
name
:
&
r
/
str
,
desc
:
&
r
/
str
)
->
Flag
/&
r
{
pub
fn
flag
(
name
:
&
r
/
str
,
desc
:
&
r
/
str
)
->
Flag
/&
r
{
Flag
{
name
:
name
,
desc
:
desc
,
max_count
:
1
,
value
:
0
}
}
impl
Flag
{
pub
impl
Flag
{
fn
set_desc
(
self
,
s
:
&
str
)
->
Flag
{
Flag
{
//~ ERROR cannot infer an appropriate lifetime
name
:
self
.name
,
...
...
src/test/compile-fail/unused-imports-warn.rs
浏览文件 @
2a65842c
...
...
@@ -13,18 +13,15 @@
use
cal
=
bar
::
c
::
cc
;
mod
foo
{
#[legacy_exports]
;
type
point
=
{
x
:
int
,
y
:
int
};
type
square
=
{
p
:
point
,
h
:
uint
,
w
:
uint
};
pub
type
point
=
{
x
:
int
,
y
:
int
};
pub
type
square
=
{
p
:
point
,
h
:
uint
,
w
:
uint
};
}
mod
bar
{
#[legacy_exports]
;
mod
c
{
#[legacy_exports]
;
pub
mod
c
{
use
foo
::
point
;
use
foo
::
square
;
fn
cc
(
p
:
point
)
->
str
{
return
2
*
(
p
.x
+
p
.y
);
}
pub
fn
cc
(
p
:
point
)
->
str
{
return
2
*
(
p
.x
+
p
.y
);
}
}
}
...
...
src/test/compile-fail/warn-ctypes-err-attr.rs
浏览文件 @
2a65842c
...
...
@@ -13,9 +13,8 @@
#[nolink]
extern
mod
libc
{
#[legacy_exports]
;
fn
malloc
(
size
:
int
)
->
*
u8
;
pub
fn
malloc
(
size
:
int
)
->
*
u8
;
}
fn
main
()
{
}
\ No newline at end of file
}
src/test/compile-fail/warn-ctypes.rs
浏览文件 @
2a65842c
...
...
@@ -12,9 +12,8 @@
// error-pattern:found rust type
#[nolink]
extern
mod
libc
{
#[legacy_exports]
;
fn
malloc
(
size
:
int
)
->
*
u8
;
pub
fn
malloc
(
size
:
int
)
->
*
u8
;
}
fn
main
()
{
}
\ No newline at end of file
}
src/test/compile-fail/warn-foreign-int-types.rs
浏览文件 @
2a65842c
...
...
@@ -10,9 +10,8 @@
//error-pattern:libc::c_int or libc::c_long should be used
extern
mod
xx
{
#[legacy_exports]
;
fn
strlen
(
str
:
*
u8
)
->
uint
;
fn
foo
(
x
:
int
,
y
:
uint
);
pub
fn
strlen
(
str
:
*
u8
)
->
uint
;
pub
fn
foo
(
x
:
int
,
y
:
uint
);
}
fn
main
()
{
...
...
src/test/run-fail/extern-fail.rs
浏览文件 @
2a65842c
...
...
@@ -13,9 +13,8 @@
// Instead the failure will be delivered after the callbacks return.
extern
mod
rustrt
{
#[legacy_exports]
;
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
pub
fn
rust_dbg_call
(
cb
:
*
u8
,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
...
...
src/test/run-fail/morestack2.rs
浏览文件 @
2a65842c
...
...
@@ -18,8 +18,7 @@
extern
mod
std
;
extern
mod
rustrt
{
#[legacy_exports]
;
fn
last_os_error
()
->
~
str
;
pub
fn
last_os_error
()
->
~
str
;
}
fn
getbig_call_c_and_fail
(
i
:
int
)
{
...
...
src/test/run-fail/run-unexported-tests.rs
浏览文件 @
2a65842c
...
...
@@ -14,10 +14,7 @@
extern
mod
std
;
mod
m
{
#[legacy_exports]
;
export
exported
;
fn
exported
()
{
}
pub
fn
exported
()
{
}
#[test]
fn
unexported
()
{
fail
~
"runned an unexported test"
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录