Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
7a846b86
R
Rust
项目概览
int
/
Rust
接近 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7a846b86
编写于
11月 15, 2014
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update tests for `()` notation to use traits not structs
上级
5a28d178
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
23 addition
and
21 deletion
+23
-21
src/test/compile-fail/unboxed-closure-sugar-default.rs
src/test/compile-fail/unboxed-closure-sugar-default.rs
+5
-5
src/test/compile-fail/unboxed-closure-sugar-region.rs
src/test/compile-fail/unboxed-closure-sugar-region.rs
+8
-9
src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs
...ed-closure-sugar-wrong-number-number-type-parameters-1.rs
+3
-2
src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs
...ed-closure-sugar-wrong-number-number-type-parameters-3.rs
+3
-2
src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs
...oxed-closure-sugar-wrong-number-number-type-parameters.rs
+2
-1
src/test/run-pass/unboxed-closures-sugar-1.rs
src/test/run-pass/unboxed-closures-sugar-1.rs
+2
-2
未找到文件。
src/test/compile-fail/unboxed-closure-sugar-default.rs
浏览文件 @
7a846b86
...
...
@@ -14,13 +14,13 @@
#![feature(default_type_params,
unboxed_closures)]
#![allow(dead_code)]
struc
t
Foo
<
T
,
U
,
V
=
T
>
{
t
:
T
,
u
:
U
trai
t
Foo
<
T
,
U
,
V
=
T
>
{
fn
dummy
(
&
self
,
t
:
T
,
u
:
U
,
v
:
V
);
}
trait
Eq
<
X
>
{
}
impl
<
X
>
Eq
<
X
>
for
X
{
}
fn
eq
<
A
,
B
:
Eq
<
A
>>
()
{
}
trait
Eq
<
Sized
?
X
>
for
Sized
?
{
}
impl
<
Sized
?
X
>
Eq
<
X
>
for
X
{
}
fn
eq
<
Sized
?
A
,
Sized
?
B
>
()
where
A
:
Eq
<
B
>
{
}
fn
test
<
'a
,
'b
>
()
{
// Parens are equivalent to omitting default in angle.
...
...
src/test/compile-fail/unboxed-closure-sugar-region.rs
浏览文件 @
7a846b86
...
...
@@ -17,15 +17,14 @@
use
std
::
kinds
::
marker
;
struct
Foo
<
'a
,
T
,
U
>
{
t
:
T
,
u
:
U
,
m
:
marker
::
InvariantLifetime
<
'a
>
trait
Foo
<
'a
,
T
,
U
>
{
fn
dummy
(
&
'a
self
)
->
&
'a
(
T
,
U
);
}
trait
Eq
<
X
>
{
}
impl
<
X
>
Eq
<
X
>
for
X
{
}
fn
eq
<
A
,
B
:
Eq
<
A
>>
()
{
}
trait
Eq
<
Sized
?
X
>
for
Sized
?
{
}
impl
<
Sized
?
X
>
Eq
<
X
>
for
X
{
}
fn
eq
<
Sized
?
A
,
Sized
?
B
:
Eq
<
A
>>
()
{
}
fn
same_type
<
A
,
B
:
Eq
<
A
>>
(
a
:
A
,
b
:
B
)
{
}
fn
test
<
'a
,
'b
>
()
{
...
...
@@ -34,10 +33,10 @@ fn test<'a,'b>() {
// Here we specify 'static explicitly in angle-bracket version.
// Parenthesized winds up getting inferred.
eq
::
<
Foo
<
'static
,
(
int
,),()
>
,
Foo
(
int
)
>
();
eq
::
<
Foo
<
'static
,
(
int
,),()
>
,
Foo
(
int
)
>
();
}
fn
test2
(
x
:
Foo
<
(
int
,),()
>
,
y
:
Foo
(
int
))
{
fn
test2
(
x
:
&
Foo
<
(
int
,),()
>
,
y
:
&
Foo
(
int
))
{
// Here, the omitted lifetimes are expanded to distinct things.
same_type
(
x
,
y
)
//~ ERROR cannot infer
}
...
...
src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs
浏览文件 @
7a846b86
...
...
@@ -8,10 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct
One
<
A
>
;
#![feature(unboxed_closures)]
fn
foo
(
_
:
One
())
//~ ERROR wrong number of type arguments
trait
One
<
A
>
{
fn
foo
(
&
self
)
->
A
;
}
fn
foo
(
_
:
&
One
())
//~ ERROR wrong number of type arguments
{}
fn
main
()
{
}
src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs
浏览文件 @
7a846b86
...
...
@@ -8,10 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct
Three
<
A
,
B
,
C
>
;
#![feature(unboxed_closures)]
fn
foo
(
_
:
Three
())
//~ ERROR wrong number of type arguments
trait
Three
<
A
,
B
,
C
>
{
fn
dummy
(
&
self
)
->
(
A
,
B
,
C
);
}
fn
foo
(
_
:
&
Three
())
//~ ERROR wrong number of type arguments
{}
fn
main
()
{
}
src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs
浏览文件 @
7a846b86
...
...
@@ -8,9 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct
Zero
;
#![feature(unboxed_closures)]
trait
Zero
{
fn
dummy
(
&
self
);
}
fn
foo
(
_
:
Zero
())
//~ ERROR wrong number of type arguments
{}
...
...
src/test/run-pass/unboxed-closures-sugar-1.rs
浏览文件 @
7a846b86
...
...
@@ -15,8 +15,8 @@
#![allow(dead_code)]
struc
t
Foo
<
T
,
U
>
{
t
:
T
,
u
:
U
trai
t
Foo
<
T
,
U
>
{
fn
dummy
(
&
self
)
->
(
T
,
U
);
}
trait
Eq
<
X
>
{
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录